Search in sources :

Example 1 with ImportWizard

use of org.apache.sling.ide.eclipse.ui.wizards.ImportWizard in project sling by apache.

the class ImportContentAction method run.

private void run(ISelection currentSelection) {
    if (!(currentSelection instanceof IStructuredSelection)) {
        return;
    }
    IStructuredSelection structuredSelection = (IStructuredSelection) currentSelection;
    for (Iterator<?> it = structuredSelection.iterator(); it.hasNext(); ) {
        Object selected = it.next();
        if (selected instanceof IResource) {
            IProject project = (IProject) (((IResource) selected).getProject());
            if (!ProjectHelper.isContentProject(project)) {
                continue;
            }
            IModule module = ServerUtil.getModule(project);
            if (module == null) {
                continue;
            }
            ImportWizard wiz = new ImportWizard();
            wiz.init(PlatformUI.getWorkbench(), structuredSelection);
            WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), wiz);
            dialog.open();
        }
    }
}
Also used : IModule(org.eclipse.wst.server.core.IModule) ImportWizard(org.apache.sling.ide.eclipse.ui.wizards.ImportWizard) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) WizardDialog(org.eclipse.jface.wizard.WizardDialog) IResource(org.eclipse.core.resources.IResource) IProject(org.eclipse.core.resources.IProject)

Example 2 with ImportWizard

use of org.apache.sling.ide.eclipse.ui.wizards.ImportWizard in project sling by apache.

the class JcrNodeImportContentHandler method createWizard.

protected ImportWizard createWizard(IResource resource) {
    ImportWizard wiz = new ImportWizard();
    wiz.init(PlatformUI.getWorkbench(), new StructuredSelection(resource));
    return wiz;
}
Also used : ImportWizard(org.apache.sling.ide.eclipse.ui.wizards.ImportWizard) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection)

Aggregations

ImportWizard (org.apache.sling.ide.eclipse.ui.wizards.ImportWizard)2 IProject (org.eclipse.core.resources.IProject)1 IResource (org.eclipse.core.resources.IResource)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 IModule (org.eclipse.wst.server.core.IModule)1