Java Code Examples for org.eclipse.jdt.internal.ui.wizards.NewWizardMessages#AbstractOpenWizardAction_createerror_title

The following examples show how to use org.eclipse.jdt.internal.ui.wizards.NewWizardMessages#AbstractOpenWizardAction_createerror_title . 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: EditFilterAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void run() {
	Shell shell= getShell();

	try {
		EditFilterWizard wizard= createWizard();
		wizard.init(PlatformUI.getWorkbench(), new StructuredSelection(getSelectedElements().get(0)));

		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) {
			BuildpathDelta delta= new BuildpathDelta(getToolTipText());

			ArrayList<CPListElement> newEntries= wizard.getExistingEntries();
			delta.setNewEntries(newEntries.toArray(new CPListElement[newEntries.size()]));

			IResource resource= wizard.getCreatedElement().getCorrespondingResource();
			delta.addCreatedResource(resource);

			delta.setDefaultOutputLocation(wizard.getOutputLocation());

			informListeners(delta);

			selectAndReveal(new StructuredSelection(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 4
Source File: CreateLinkedSourceFolderAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void run() {
	Shell shell= getShell();

	try {
		IJavaProject javaProject= (IJavaProject)getSelectedElements().get(0);

		CPListElement newEntrie= new CPListElement(javaProject, IClasspathEntry.CPE_SOURCE);
           CPListElement[] existing= CPListElement.createFromExisting(javaProject);
           boolean isProjectSrcFolder= CPListElement.isProjectSourceFolder(existing, javaProject);

		AddSourceFolderWizard wizard= new AddSourceFolderWizard(existing, newEntrie, getOutputLocation(javaProject), true, false, false, isProjectSrcFolder, isProjectSrcFolder);
		wizard.init(PlatformUI.getWorkbench(), new StructuredSelection(javaProject));

		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) {

			BuildpathDelta delta= new BuildpathDelta(getToolTipText());

			ArrayList<CPListElement> newEntries= wizard.getExistingEntries();
			delta.setNewEntries(newEntries.toArray(new CPListElement[newEntries.size()]));

			IResource resource= wizard.getCreatedElement().getCorrespondingResource();
			delta.addCreatedResource(resource);

			delta.setDefaultOutputLocation(wizard.getOutputLocation());

			informListeners(delta);

			selectAndReveal(new StructuredSelection(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 5
Source File: CreateSourceFolderAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void run() {
	Shell shell= getShell();

	try {
		IJavaProject javaProject= (IJavaProject)getSelectedElements().get(0);

           CPListElement newEntrie= new CPListElement(javaProject, IClasspathEntry.CPE_SOURCE);
           CPListElement[] existing= CPListElement.createFromExisting(javaProject);
           boolean isProjectSrcFolder= CPListElement.isProjectSourceFolder(existing, javaProject);

           AddSourceFolderWizard wizard= new AddSourceFolderWizard(existing, newEntrie, getOutputLocation(javaProject), false, false, false, isProjectSrcFolder, isProjectSrcFolder);
		wizard.init(PlatformUI.getWorkbench(), new StructuredSelection(javaProject));

		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) {
			BuildpathDelta delta= new BuildpathDelta(getToolTipText());

			ArrayList<CPListElement> newEntries= wizard.getExistingEntries();
			delta.setNewEntries(newEntries.toArray(new CPListElement[newEntries.size()]));

			IResource resource= wizard.getCreatedElement().getCorrespondingResource();
			delta.addCreatedResource(resource);

			delta.setDefaultOutputLocation(wizard.getOutputLocation());

			informListeners(delta);

			selectAndReveal(new StructuredSelection(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);
	}
}