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 37155 Details for
Bug 133692
Add an 'Open Manifest' to projects to open the manifest editor
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 OpenManifest to a plugin project
open-manifest.patch (text/plain), 6.76 KB, created by
Alex Blewitt
on 2006-03-28 17:40:35 EST
(
hide
)
Description:
Adds OpenManifest to a plugin project
Filename:
MIME Type:
Creator:
Alex Blewitt
Created:
2006-03-28 17:40:35 EST
Size:
6.76 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ui >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/plugin.properties,v >retrieving revision 1.153 >diff -u -r1.153 plugin.properties >--- plugin.properties 27 Mar 2006 22:32:24 -0000 1.153 >+++ plugin.properties 28 Mar 2006 22:35:54 -0000 >@@ -371,6 +371,8 @@ > > OrganizeManifest.label= &Organize Manifests... > >+OpenManifest.label= Open &Manifest >+ > UpdateClasspathAction.label= &Update Classpath... > > OpenDependenciesAction.label= Ope&n Dependencies >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/plugin.xml,v >retrieving revision 1.339 >diff -u -r1.339 plugin.xml >--- plugin.xml 28 Mar 2006 14:59:36 -0000 1.339 >+++ plugin.xml 28 Mar 2006 22:36:00 -0000 >@@ -1095,6 +1095,14 @@ > enablesFor="+" > id="org.eclipse.pde.ui.OrganizeManifest"> > </action> >+ <!-- TODO No help for this yet helpContextId="org.eclipse.pde.doc.user.open_manifest" --> >+ <action >+ label="%OpenManifest.label" >+ class="org.eclipse.pde.internal.ui.util.OpenManifestAction" >+ menubarPath="org.eclipse.pde.ui.project.tools/group0" >+ enablesFor="+" >+ id="org.eclipse.pde.ui.OpenManifestAction"> >+ </action> > <action > label="%MigrationAction.label" > class="org.eclipse.pde.internal.ui.wizards.tools.MigrationAction" >Index: src/org/eclipse/pde/internal/ui/pderesources.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/pderesources.properties,v >retrieving revision 1.676 >diff -u -r1.676 pderesources.properties >--- src/org/eclipse/pde/internal/ui/pderesources.properties 27 Mar 2006 23:23:13 -0000 1.676 >+++ src/org/eclipse/pde/internal/ui/pderesources.properties 28 Mar 2006 22:36:19 -0000 >@@ -2396,6 +2396,9 @@ > OrganizeRequireBundleResolution_Label=Organize required bundles > OrganizeImportPackageResolution_Label=Organize imported packages > OrganizeExportPackageResolution_Label=Organize exported packages >+OpenManifest_label=Open Manifest >+OpenManifest_cannotFind=Cannot find manifest for {0} >+OpenManifest_cannotOpen=Cannot open manifest for {0} > SyntaxColorTab_elements=Elements: > SyntaxColorTab_color=&Color: > SyntaxColorTab_bold=&Bold >Index: src/org/eclipse/pde/internal/ui/PDEUIMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEUIMessages.java,v >retrieving revision 1.147 >diff -u -r1.147 PDEUIMessages.java >--- src/org/eclipse/pde/internal/ui/PDEUIMessages.java 27 Mar 2006 22:51:58 -0000 1.147 >+++ src/org/eclipse/pde/internal/ui/PDEUIMessages.java 28 Mar 2006 22:36:09 -0000 >@@ -2809,4 +2809,10 @@ > > public static String AddNewDependenciesOperation_searchForDependency; > >+ public static String OpenManifestsAction_cannotFind; >+ >+ public static String OpenManifestsAction_cannotOpen; >+ >+ public static String OpenManifestsAction_title; >+ > } >\ No newline at end of file >Index: src/org/eclipse/pde/internal/ui/util/OpenManifestAction.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/ui/util/OpenManifestAction.java >diff -N src/org/eclipse/pde/internal/ui/util/OpenManifestAction.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/ui/util/OpenManifestAction.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,86 @@ >+package org.eclipse.pde.internal.ui.util; >+import java.util.ArrayList; >+import java.util.Iterator; >+import org.eclipse.core.resources.IFile; >+import org.eclipse.core.resources.IProject; >+import org.eclipse.jface.action.IAction; >+import org.eclipse.jface.dialogs.MessageDialog; >+import org.eclipse.jface.viewers.ISelection; >+import org.eclipse.jface.viewers.IStructuredSelection; >+import org.eclipse.osgi.util.NLS; >+import org.eclipse.pde.internal.core.WorkspaceModelManager; >+import org.eclipse.pde.internal.ui.PDEPlugin; >+import org.eclipse.pde.internal.ui.PDEUIMessages; >+import org.eclipse.swt.custom.BusyIndicator; >+import org.eclipse.ui.IWorkbenchWindow; >+import org.eclipse.ui.IWorkbenchWindowActionDelegate; >+import org.eclipse.ui.PartInitException; >+import org.eclipse.ui.ide.IDE; >+public class OpenManifestAction implements IWorkbenchWindowActionDelegate { >+ private ISelection fSelection; >+ public OpenManifestAction() { >+ super(); >+ } >+ public void dispose() { >+ } >+ public void init(IWorkbenchWindow window) { >+ } >+ public void run(IAction action) { >+ if (fSelection instanceof IStructuredSelection) { >+ IStructuredSelection ssel = (IStructuredSelection) fSelection; >+ Iterator it = ssel.iterator(); >+ final ArrayList projects = new ArrayList(); >+ while (it.hasNext()) { >+ Object element = it.next(); >+ IProject proj = null; >+ if (element instanceof IFile) >+ proj = ((IFile) element).getProject(); >+ else if (element instanceof IProject) >+ proj = (IProject) element; >+ if (proj != null >+ && (WorkspaceModelManager.hasBundleManifest(proj) >+ || WorkspaceModelManager.hasPluginManifest(proj))) >+ projects.add(proj); >+ } >+ if (projects.size() > 0) { >+ BusyIndicator.showWhile(PDEPlugin.getActiveWorkbenchShell() >+ .getDisplay(), new Runnable() { >+ public void run() { >+ Iterator it = projects.iterator(); >+ while (it.hasNext()) { >+ IProject project = (IProject) it.next(); >+ // TODO is there a nicer way to get this? >+ IFile file = project >+ .getFile("META-INF/MANIFEST.MF"); //$NON-NLS-1$ >+ if (file == null || !file.exists()) >+ file = project.getFile("plugin.xml"); //$NON-NLS-1$ >+ if (file == null || !file.exists()) >+ MessageDialog.openError(PDEPlugin >+ .getActiveWorkbenchShell(), >+ PDEUIMessages.OpenManifestsAction_title, >+ NLS.bind(PDEUIMessages.OpenManifestsAction_cannotFind, project.getName())); >+ else >+ try { >+ IDE.openEditor(PDEPlugin.getActivePage(), >+ file); >+ } catch (PartInitException e) { >+ MessageDialog.openError(PDEPlugin >+ .getActiveWorkbenchShell(), >+ PDEUIMessages.OpenManifestsAction_title, >+ NLS.bind(PDEUIMessages.OpenManifestsAction_cannotOpen, project.getName())); >+ } >+ } >+ } >+ }); >+ } else >+ // TODO Update message >+ MessageDialog.openInformation(PDEPlugin >+ .getActiveWorkbenchShell(), >+ PDEUIMessages.OpenManifestsAction_title, >+ PDEUIMessages.OpenManifestsAction_cannotFind); >+ } >+ } >+ public void selectionChanged(IAction action, ISelection selection) { >+ fSelection = selection; >+ } >+}
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 133692
:
37155
|
37180