org.eclipse.ui.INewWizard Java Examples

The following examples show how to use org.eclipse.ui.INewWizard. 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: AbstractOpenWizardAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void run() {
	Shell shell= getShell();
	if (!doCreateProjectFirstOnEmptyWorkspace(shell)) {
		return;
	}
	try {
		INewWizard wizard= createWizard();
		wizard.init(PlatformUI.getWorkbench(), getSelection());

		WizardDialog dialog= new WizardDialog(shell, wizard);
		PixelConverter converter= new PixelConverter(JFaceResources.getDialogFont());
		dialog.setMinimumPageSize(converter.convertWidthInCharsToPixels(70), converter.convertHeightInCharsToPixels(20));
		dialog.create();
		int res= dialog.open();
		if (res == Window.OK && wizard instanceof NewElementWizard) {
			fCreatedElement= ((NewElementWizard)wizard).getCreatedElement();
		}

		notifyResult(res == Window.OK);
	} catch (CoreException e) {
		String title= NewWizardMessages.AbstractOpenWizardAction_createerror_title;
		String message= NewWizardMessages.AbstractOpenWizardAction_createerror_message;
		ExceptionHandler.handle(e, shell, title, message);
	}
}
 
Example #2
Source File: AbstractOpenWizardAction.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void run() {
  Shell localShell = getShell();
  if (!doCreateProjectFirstOnEmptyWorkspace(localShell)) {
    return;
  }

  try {
    INewWizard wizard = createWizard();
    wizard.init(PlatformUI.getWorkbench(), getSelection());

    WizardDialog dialog = new WizardDialog(localShell, wizard);
    IPixelConverter converter =
        PixelConverterFactory.createPixelConverter(JFaceResources.getDialogFont());
    dialog.setMinimumPageSize(converter.convertWidthInCharsToPixels(70),
        converter.convertHeightInCharsToPixels(20));
    dialog.create();
    int res = dialog.open();
    if (res == Window.OK && wizard instanceof NewElementWizard) {
      createdElement = ((NewElementWizard) wizard).getCreatedElement();
    }

    notifyResult(res == Window.OK);
  } catch (CoreException e) {
    String title = NewWizardMessages.AbstractOpenWizardAction_createerror_title;
    String message = NewWizardMessages.AbstractOpenWizardAction_createerror_message;
    ExceptionHandler.handle(e, localShell, title, message);
  }
}
 
Example #3
Source File: OpenNewMRClassWizardAction.java    From hadoop-gpu with Apache License 2.0 5 votes vote down vote up
private INewWizard getWizard(String typeName) {
  if (typeName.equals("Mapper")) {
    return new NewMapperWizard();
  } else if (typeName.equals("Reducer")) {
    return new NewReducerWizard();
  } else if (typeName.equals("Driver")) {
    return new NewDriverWizard();
  } else {
    log.severe("Invalid Wizard requested");
    return null;
  }
}
 
Example #4
Source File: OpenNewMRClassWizardAction.java    From hadoop-gpu with Apache License 2.0 5 votes vote down vote up
public void run(String[] params, ICheatSheetManager manager) {

    if ((params != null) && (params.length > 0)) {
      IWorkbench workbench = PlatformUI.getWorkbench();
      INewWizard wizard = getWizard(params[0]);
      wizard.init(workbench, new StructuredSelection());
      WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench()
          .getActiveWorkbenchWindow().getShell(), wizard);
      dialog.create();
      dialog.open();

      // did the wizard succeed ?
      notifyResult(dialog.getReturnCode() == Window.OK);
    }
  }
 
Example #5
Source File: OpenNewMRClassWizardAction.java    From RDFS with Apache License 2.0 5 votes vote down vote up
private INewWizard getWizard(String typeName) {
  if (typeName.equals("Mapper")) {
    return new NewMapperWizard();
  } else if (typeName.equals("Reducer")) {
    return new NewReducerWizard();
  } else if (typeName.equals("Driver")) {
    return new NewDriverWizard();
  } else {
    log.severe("Invalid Wizard requested");
    return null;
  }
}
 
Example #6
Source File: OpenNewMRClassWizardAction.java    From RDFS with Apache License 2.0 5 votes vote down vote up
public void run(String[] params, ICheatSheetManager manager) {

    if ((params != null) && (params.length > 0)) {
      IWorkbench workbench = PlatformUI.getWorkbench();
      INewWizard wizard = getWizard(params[0]);
      wizard.init(workbench, new StructuredSelection());
      WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench()
          .getActiveWorkbenchWindow().getShell(), wizard);
      dialog.create();
      dialog.open();

      // did the wizard succeed ?
      notifyResult(dialog.getReturnCode() == Window.OK);
    }
  }
 
Example #7
Source File: OpenNewClassWizardAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected final INewWizard createWizard() throws CoreException {
	return new NewClassCreationWizard(fPage, fOpenEditorOnFinish);
}
 
Example #8
Source File: OpenNewEnumWizardAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected final INewWizard createWizard() throws CoreException {
	return new NewEnumCreationWizard(fPage, fOpenEditorOnFinish);
}
 
Example #9
Source File: OpenNewSourceFolderWizardAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected final INewWizard createWizard() throws CoreException {
	return new NewSourceFolderCreationWizard();
}
 
Example #10
Source File: OpenNewInterfaceWizardAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected final INewWizard createWizard() throws CoreException {
	return new NewInterfaceCreationWizard(fPage, fOpenEditorOnFinish);
}
 
Example #11
Source File: OpenNewAnnotationWizardAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected final INewWizard createWizard() throws CoreException {
	return new NewAnnotationCreationWizard(fPage, fOpenEditorOnFinish);
}
 
Example #12
Source File: OpenNewPackageWizardAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected final INewWizard createWizard() throws CoreException {
	return new NewPackageCreationWizard(fPage);
}
 
Example #13
Source File: OpenNewJavaProjectWizardAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected final INewWizard createWizard() throws CoreException {
	return new JavaProjectWizard(fPageOne, fPageTwo);
}
 
Example #14
Source File: NewTypeDropDownAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected INewWizard createWizard() throws CoreException {
	return (INewWizard) CoreUtility.createExtension(fConfigurationElement, ATT_CLASS);
}
 
Example #15
Source File: SourceContainerWorkbookPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected INewWizard createWizard() throws CoreException {
	return fWizard;
}
 
Example #16
Source File: OpenNewWebApplicationWizardAction.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected INewWizard createWizard() throws CoreException {
  return new NewWebAppProjectWizard();
}
 
Example #17
Source File: DynamicWorkingSetWizardExtensionPDETest.java    From eclipse-extras with Eclipse Public License 1.0 4 votes vote down vote up
private static INewWizard getWizardClass( Extension extension ) {
  return extension.createExecutableExtension( "class", INewWizard.class );
}
 
Example #18
Source File: AbstractOpenWizardAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Creates and configures the wizard. This method should only be called once.
 * @return returns the created wizard.
 * @throws CoreException exception is thrown when the creation was not successful.
 */
abstract protected INewWizard createWizard() throws CoreException;
 
Example #19
Source File: AbstractOpenWizardAction.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Creates and configures the wizard. This method should only be called once.
 * 
 * @return returns the created wizard.
 * @throws CoreException exception is thrown when the creation was not
 *           successful.
 */
protected abstract INewWizard createWizard() throws CoreException;