org.eclipse.ui.wizards.newresource.BasicNewResourceWizard Java Examples

The following examples show how to use org.eclipse.ui.wizards.newresource.BasicNewResourceWizard. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DartProjectWizard.java    From dartboard with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public boolean performFinish() {
	createNewProject();
	if (newProject == null) {
		return false;
	}
	BasicNewResourceWizard.selectAndReveal(newProject, getWorkbench().getActiveWorkbenchWindow());
	return true;
}
 
Example #2
Source File: XtextProjectCreator.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected void execute(final IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
	SubMonitor subMonitor = SubMonitor.convert(monitor, getCreateModelProjectMessage(), getMonitorTicks());
	for (ProjectDescriptor descriptor : projectInfo.getEnabledProjects()) {
		IProject project = createProject(descriptor, SubMonitor.convert(subMonitor, 1));
		createdProjects.put(descriptor, project);
	}

	IProject runtimeProject = createdProjects.get(projectInfo.getRuntimeProject());
	IFile dslGrammarFile = runtimeProject.getFile(getPath(projectInfo.getRuntimeProject().getGrammarFile()));
	BasicNewResourceWizard.selectAndReveal(dslGrammarFile, PlatformUI.getWorkbench().getActiveWorkbenchWindow());
	result = dslGrammarFile;
}
 
Example #3
Source File: NewHybridProjectWizard.java    From thym with Eclipse Public License 1.0 5 votes vote down vote up
private void openAndSelectConfigFile(IProject project){
	IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
	HybridProject hp = HybridProject.getHybridProject(project);
	IFile file = hp.getConfigFile();
	
	BasicNewResourceWizard.selectAndReveal(file, PlatformUI.getWorkbench().getActiveWorkbenchWindow());
	try {
		IDE.openEditor(activePage, file);
	} catch (PartInitException e) {
		HybridUI.log(IStatus.ERROR, "Error opening the config.xml", e);
	}
}
 
Example #4
Source File: PythonProjectWizard.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * The user clicked Finish button
 *
 * Launches another thread to create Python project. A progress monitor is shown in the UI thread.
 */
@Override
public boolean performFinish() {
    createdProject = createNewProject();

    IWorkingSet[] workingSets = projectPage.getWorkingSets();
    if (workingSets.length > 0) {
        PlatformUI.getWorkbench().getWorkingSetManager().addToWorkingSets(createdProject, workingSets);

        //Workaround to properly show project in Package Explorer: if Top Level Elements are
        //working sets, and the destination working set of the new project is selected, that set
        //must be reselected in order to display the project.
        PydevPackageExplorer pView = (PydevPackageExplorer) PlatformUI.getWorkbench()
                .getActiveWorkbenchWindow().getActivePage()
                .findView("org.python.pydev.navigator.view");
        if (pView != null) {
            IWorkingSet[] inputSets = ((PydevCommonViewer) pView.getCommonViewer()).getSelectedWorkingSets();
            if (inputSets != null && inputSets.length == 1) {
                IWorkingSet inputSet = inputSets[0];
                if (inputSet != null) {
                    for (IWorkingSet destinationSet : workingSets) {
                        if (inputSet.equals(destinationSet)) {
                            pView.getCommonViewer().setInput(inputSet);
                            break;
                        }
                    }
                }
            }
        }
    }

    // Switch to default perspective (will ask before changing)
    BasicNewProjectResourceWizard.updatePerspective(fConfigElement);
    BasicNewResourceWizard.selectAndReveal(createdProject, workbench.getActiveWorkbenchWindow());

    return true;
}
 
Example #5
Source File: WizardNewTypeScriptProjectCreationPage.java    From typescript.java with MIT License 4 votes vote down vote up
public WizardNewTypeScriptProjectCreationPage(String pageName, BasicNewResourceWizard wizard) {
	super(pageName, wizard);
}
 
Example #6
Source File: AbstractWizardNewTypeScriptProjectCreationPage.java    From typescript.java with MIT License 4 votes vote down vote up
public AbstractWizardNewTypeScriptProjectCreationPage(String pageName, BasicNewResourceWizard wizard) {
	super(pageName);
	this.wizard = wizard;
}
 
Example #7
Source File: NewElementWizard.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
protected void selectAndReveal(IResource newResource) {
	BasicNewResourceWizard.selectAndReveal(newResource, fWorkbench.getActiveWorkbenchWindow());
}
 
Example #8
Source File: LangNewProjectWizard.java    From goclipse with Eclipse Public License 1.0 4 votes vote down vote up
protected void selectAndReveal(IResource newResource) {
	BasicNewResourceWizard.selectAndReveal(newResource, workbench.getActiveWorkbenchWindow());
}
 
Example #9
Source File: FileOpener.java    From xtext-eclipse with Eclipse Public License 2.0 2 votes vote down vote up
/**
 * @param file
 *            the file that should be selected. May be <code>null</code>.
 */
public void selectAndReveal(IFile file) {
	BasicNewResourceWizard.selectAndReveal(file, workbench.getActiveWorkbenchWindow());
}