Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 202255 Details for
Bug 313392
Support Import operations on 'Plug-in Dependencies' entries in Project and Package Explorer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Adds import action to project/package explorer
importrepoprojectexplorer.patch (text/plain), 7.61 KB, created by
Curtis Windatt
on 2011-08-26 17:27:50 EDT
(
hide
)
Description:
Adds import action to project/package explorer
Filename:
MIME Type:
Creator:
Curtis Windatt
Created:
2011-08-26 17:27:50 EDT
Size:
7.61 KB
patch
obsolete
>diff --git plugin.properties plugin.properties >index 70f38c4..2ec2bc1 100644 >--- plugin.properties >+++ plugin.properties >@@ -1,5 +1,5 @@ > ############################################################################### >-# Copyright (c) 2000, 2010 IBM Corporation and others. >+# Copyright (c) 2000, 2011 IBM Corporation and others. > # All rights reserved. This program and the accompanying materials > # are made available under the terms of the Eclipse Public License v1.0 > # which accompanies this distribution, and is available at >@@ -260,4 +260,5 @@ > structureMergeViewers.manifest.label=Manifest Structure Compare > structureMergeViewers.plugin.label=Plug-in Structure Compare > commandParameter.name = The initial search pattern for the artifact search dialog >-consoleFactory.label = Host OSGi Console >\ No newline at end of file >+consoleFactory.label = Host OSGi Console >+importFromRepository.label = Import from repository... >\ No newline at end of file >diff --git plugin.xml plugin.xml >index e3c2e18..9b90153 100644 >--- plugin.xml >+++ plugin.xml >@@ -925,6 +925,18 @@ > id="org.eclipse.pde.ui.OpenManifestAction"> > </action> > </objectContribution> >+ <objectContribution >+ adaptable="false" >+ id="org.eclipse.pde.ui.referencedLibsToolSet" >+ objectClass="org.eclipse.jdt.core.IPackageFragmentRoot"> >+ <action >+ class="org.eclipse.pde.internal.ui.views.plugins.ImportFromRepositoryActionDelegate" >+ icon="icons/etool16/imp_extplug.gif" >+ id="org.eclipse.pde.ui.importFromRepo" >+ label="%importFromRepository.label" >+ menubarPath="group.import"> >+ </action> >+ </objectContribution> > </extension> > <extension > point="org.eclipse.debug.ui.launchConfigurationTypeImages"> >diff --git src/org/eclipse/pde/internal/ui/pderesources.properties src/org/eclipse/pde/internal/ui/pderesources.properties >index aaa0496..002bc19 100644 >--- src/org/eclipse/pde/internal/ui/pderesources.properties >+++ src/org/eclipse/pde/internal/ui/pderesources.properties >@@ -1067,7 +1067,7 @@ > TemplateSelectionPage_column_point = Extension Point > > ImportActionGroup_binaryWithLinkedContent=Binary Project with &Linked Content >-ImportActionGroup_cannot_import=The selected plug-ins cannot be imported from a repository. >+ImportActionGroup_cannot_import=The selected plug-ins cannot be imported from a repository. The plug-ins do not have an Eclipse-SourceReferences manifest header that can be processed. > ImportActionGroup_importContributingPlugin=&Import Contributing Plug-in as > ImportActionGroup_Repository_project=P&roject from a Repository... > >diff --git src/org/eclipse/pde/internal/ui/views/plugins/ImportActionGroup.java src/org/eclipse/pde/internal/ui/views/plugins/ImportActionGroup.java >index d792f22..1cd3be6 100644 >--- src/org/eclipse/pde/internal/ui/views/plugins/ImportActionGroup.java >+++ src/org/eclipse/pde/internal/ui/views/plugins/ImportActionGroup.java >@@ -12,6 +12,7 @@ > > import java.util.*; > import org.eclipse.core.runtime.CoreException; >+import org.eclipse.jdt.core.IPackageFragmentRoot; > import org.eclipse.jface.action.*; > import org.eclipse.jface.dialogs.MessageDialog; > import org.eclipse.jface.viewers.ISelection; >@@ -81,7 +82,7 @@ > } > } > >- private void handleImport(int importType, IStructuredSelection selection) { >+ static void handleImport(int importType, IStructuredSelection selection) { > ArrayList externalModels = new ArrayList(); > for (Iterator iter = selection.iterator(); iter.hasNext();) { > IPluginModelBase model = getModel(iter.next()); >@@ -111,7 +112,7 @@ > * @param models candidate models > * @return map of importer to import descriptions > */ >- private Map getImportDescriptions(Shell shell, IPluginModelBase[] models) { >+ private static Map getImportDescriptions(Shell shell, IPluginModelBase[] models) { > BundleProjectService service = (BundleProjectService) BundleProjectService.getDefault(); > try { > Map descriptions = service.getImportDescriptions(models); // all possible descriptions >@@ -149,10 +150,23 @@ > } else if (next instanceof BundleDescription) { > model = PDECore.getDefault().getModelManager().findModel((BundleDescription) next); > } else if (next instanceof BundleSpecification) { >+ // Required for contents of Target Platform State View > BundleDescription desc = (BundleDescription) ((BundleSpecification) next).getSupplier(); > if (desc != null) { > model = PDECore.getDefault().getModelManager().findModel(desc); > } >+ } else if (next instanceof IPackageFragmentRoot) { >+ // Required for context menu on PDE classpath container entries >+ IPackageFragmentRoot root = (IPackageFragmentRoot) next; >+ if (root.isExternal()) { >+ String path = root.getPath().toOSString(); >+ IPluginModelBase[] externalModels = PDECore.getDefault().getModelManager().getExternalModels(); >+ for (int i = 0; i < externalModels.length; i++) { >+ if (path.equals(externalModels[i].getInstallLocation())) { >+ return externalModels[i]; >+ } >+ } >+ } > } > return model; > >diff --git src/org/eclipse/pde/internal/ui/views/plugins/ImportFromRepositoryActionDelegate.java src/org/eclipse/pde/internal/ui/views/plugins/ImportFromRepositoryActionDelegate.java >new file mode 0 >index 0000000..ce41d1f 0 >--- /dev/null >+++ src/org/eclipse/pde/internal/ui/views/plugins/ImportFromRepositoryActionDelegate.java >@@ -0,0 +1,60 @@ >+/******************************************************************************* >+ * Copyright (c) 2011 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.pde.internal.ui.views.plugins; >+ >+import org.eclipse.jface.action.IAction; >+import org.eclipse.jface.viewers.ISelection; >+import org.eclipse.jface.viewers.IStructuredSelection; >+import org.eclipse.pde.internal.ui.wizards.imports.PluginImportOperation; >+import org.eclipse.ui.IObjectActionDelegate; >+import org.eclipse.ui.IWorkbenchPart; >+ >+/** >+ * Action delegate to import a selected object if it represents a plug-in with a >+ * Eclipse-SourceReferences header that can be processed by Team. >+ * >+ * @see ImportActionGroup >+ */ >+public class ImportFromRepositoryActionDelegate implements IObjectActionDelegate { >+ >+ /** >+ * Stores the last selection to pass to import operation >+ */ >+ private ISelection fSelection; >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) >+ */ >+ public void run(IAction action) { >+ if (fSelection instanceof IStructuredSelection) { >+ ImportActionGroup.handleImport(PluginImportOperation.IMPORT_FROM_REPOSITORY, (IStructuredSelection) fSelection); >+ } >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) >+ */ >+ public void selectionChanged(IAction action, ISelection selection) { >+ fSelection = selection; >+ boolean enable = false; >+ if (selection instanceof IStructuredSelection && !selection.isEmpty()) { >+ enable = ImportActionGroup.canImport((IStructuredSelection) selection); >+ } >+ action.setEnabled(enable); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart) >+ */ >+ public void setActivePart(IAction action, IWorkbenchPart targetPart) { >+ } >+ >+} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 313392
:
201838
| 202255