Search in sources :

Example 1 with IImportWizard

use of org.eclipse.ui.IImportWizard in project eclipse.jdt.ui by eclipse-jdt.

the class LibrariesWorkbookPage method replaceJarFile.

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();
    }
}
Also used : IImportWizard(org.eclipse.ui.IImportWizard) JarImportWizard(org.eclipse.jdt.internal.ui.jarimport.JarImportWizard) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) WizardDialog(org.eclipse.jface.wizard.WizardDialog) IPackageFragmentRoot(org.eclipse.jdt.core.IPackageFragmentRoot)

Example 2 with IImportWizard

use of org.eclipse.ui.IImportWizard in project eclipse.jdt.ui by eclipse-jdt.

the class JarImportWizardAction method run.

@Override
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();
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) IImportWizard(org.eclipse.ui.IImportWizard) JarImportWizard(org.eclipse.jdt.internal.ui.jarimport.JarImportWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Aggregations

JarImportWizard (org.eclipse.jdt.internal.ui.jarimport.JarImportWizard)2 WizardDialog (org.eclipse.jface.wizard.WizardDialog)2 IImportWizard (org.eclipse.ui.IImportWizard)2 IPackageFragmentRoot (org.eclipse.jdt.core.IPackageFragmentRoot)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)1