Search in sources :

Example 1 with JarImportWizard

use of org.eclipse.jdt.internal.ui.jarimport.JarImportWizard in project eclipse.jdt.ui by eclipse-jdt.

the class MigrateJarFileAction method run.

@Override
public void run(final IAction action) {
    if (fWindow != null) {
        final JarImportWizard wizard = new JarImportWizard(true);
        final ISelection selection = fWindow.getSelectionService().getSelection();
        if (selection instanceof IStructuredSelection)
            wizard.init(fWindow.getWorkbench(), (IStructuredSelection) selection);
        final WizardDialog dialog = new WizardDialog(fWindow.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 : JarImportWizard(org.eclipse.jdt.internal.ui.jarimport.JarImportWizard) ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 2 with JarImportWizard

use of org.eclipse.jdt.internal.ui.jarimport.JarImportWizard 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 3 with JarImportWizard

use of org.eclipse.jdt.internal.ui.jarimport.JarImportWizard 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)3 WizardDialog (org.eclipse.jface.wizard.WizardDialog)3 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 IImportWizard (org.eclipse.ui.IImportWizard)2 IPackageFragmentRoot (org.eclipse.jdt.core.IPackageFragmentRoot)1 ISelection (org.eclipse.jface.viewers.ISelection)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)1