@Override public void run() { Display.getDefault().syncExec(new Runnable() { @Override public void run() { final NewProjectAction newProjectAction = new NewProjectAction(PlatformUI.getWorkbench().getActiveWorkbenchWindow()); newProjectAction.run(); } }); }
/** * Opens the new project dialog if the workspace is empty. This method is * called on {@link #run()}. * * @param shell the shell to use * @return returns <code>true</code> when a project has been created, or * <code>false</code> when the new project has been canceled. */ protected boolean doCreateProjectFirstOnEmptyWorkspace(Shell shell) { IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); if (workspaceRoot.getProjects().length == 0) { String title = NewWizardMessages.AbstractOpenWizardAction_noproject_title; String message = NewWizardMessages.AbstractOpenWizardAction_noproject_message; if (MessageDialog.openQuestion(shell, title, message)) { new NewProjectAction().run(); return workspaceRoot.getProjects().length != 0; } return false; } return true; }
/** * Opens the new project dialog if the workspace is empty. This method is called on {@link #run()}. * @param shell the shell to use * @return returns <code>true</code> when a project has been created, or <code>false</code> when the * new project has been canceled. */ protected boolean doCreateProjectFirstOnEmptyWorkspace(Shell shell) { IWorkspaceRoot workspaceRoot= ResourcesPlugin.getWorkspace().getRoot(); if (workspaceRoot.getProjects().length == 0) { String title= NewWizardMessages.AbstractOpenWizardAction_noproject_title; String message= NewWizardMessages.AbstractOpenWizardAction_noproject_message; if (MessageDialog.openQuestion(shell, title, message)) { new NewProjectAction().run(); return workspaceRoot.getProjects().length != 0; } return false; } return true; }
/** * Opens the new project dialog if the workspace is empty. * @param parent the parent shell * @return returns <code>true</code> when a project has been created, or <code>false</code> when the * new project has been canceled. */ protected boolean doCreateProjectFirstOnEmptyWorkspace(Shell parent) { IWorkspaceRoot workspaceRoot= ResourcesPlugin.getWorkspace().getRoot(); if (workspaceRoot.getProjects().length == 0) { String title= JavaUIMessages.OpenTypeAction_dialogTitle; String message= JavaUIMessages.OpenTypeAction_createProjectFirst; if (MessageDialog.openQuestion(parent, title, message)) { new NewProjectAction().run(); return workspaceRoot.getProjects().length != 0; } return false; } return true; }