org.eclipse.ui.IImportWizard Java Examples

The following examples show how to use org.eclipse.ui.IImportWizard. 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: JarImportWizardAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void run(final IAction action) {
	if (fWorkbenchPart == null || fSelection == null)
		return;
	final IImportWizard wizard= new JarImportWizard(false);
	final IWorkbenchWindow window= fWorkbenchPart.getSite().getWorkbenchWindow();
	wizard.init(window.getWorkbench(), fSelection);
	final WizardDialog dialog= new WizardDialog(window.getShell(), wizard);
	dialog.create();
	dialog.getShell().setSize(Math.max(SIZING_WIZARD_WIDTH, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT);
	PlatformUI.getWorkbench().getHelpSystem().setHelp(dialog.getShell(), IJavaHelpContextIds.JARIMPORT_WIZARD_PAGE);
	dialog.open();
}
 
Example #2
Source File: LibrariesWorkbookPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void replaceJarFile() {
	final IPackageFragmentRoot root= getSelectedPackageFragmentRoot();
	if (root != null) {
		final IImportWizard wizard= new JarImportWizard(false);
		wizard.init(PlatformUI.getWorkbench(), new StructuredSelection(root));
		final WizardDialog dialog= new WizardDialog(getShell(), wizard);
		dialog.create();
		dialog.getShell().setSize(Math.max(JarImportWizardAction.SIZING_WIZARD_WIDTH, dialog.getShell().getSize().x), JarImportWizardAction.SIZING_WIZARD_HEIGHT);
		PlatformUI.getWorkbench().getHelpSystem().setHelp(dialog.getShell(), IJavaHelpContextIds.JARIMPORT_WIZARD_PAGE);
		dialog.open();
	}
}