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 110364 Details for
Bug 244088
[ds] new service component wizard should modify Service-Component header in MANIFEST.MF
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]
Wizard updates Manifest.mf
org.eclipse.pde.ds.ui.127.patch (text/plain), 3.92 KB, created by
Rafael Oliveira Nóbrega
on 2008-08-19 12:56:05 EDT
(
hide
)
Description:
Wizard updates Manifest.mf
Filename:
MIME Type:
Creator:
Rafael Oliveira Nóbrega
Created:
2008-08-19 12:56:05 EDT
Size:
3.92 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ds.ui >Index: src/org/eclipse/pde/internal/ds/ui/wizards/DSCreationOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/pde-incubator/ds/org.eclipse.pde.ds.ui/src/org/eclipse/pde/internal/ds/ui/wizards/DSCreationOperation.java,v >retrieving revision 1.5 >diff -u -r1.5 DSCreationOperation.java >--- src/org/eclipse/pde/internal/ds/ui/wizards/DSCreationOperation.java 9 Jul 2008 00:04:10 -0000 1.5 >+++ src/org/eclipse/pde/internal/ds/ui/wizards/DSCreationOperation.java 19 Aug 2008 16:54:53 -0000 >@@ -20,8 +20,13 @@ > import org.eclipse.core.resources.IProjectDescription; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.SubProgressMonitor; > import org.eclipse.jface.viewers.ISelection; > import org.eclipse.jface.viewers.StructuredSelection; >+import org.eclipse.pde.core.IBaseModel; >+import org.eclipse.pde.internal.core.ibundle.IBundleModel; >+import org.eclipse.pde.internal.core.ibundle.IBundleModelFactory; >+import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase; > import org.eclipse.pde.internal.core.util.CoreUtility; > import org.eclipse.pde.internal.ds.core.IDSComponent; > import org.eclipse.pde.internal.ds.core.IDSDocumentFactory; >@@ -31,6 +36,8 @@ > import org.eclipse.pde.internal.ds.ui.Activator; > import org.eclipse.pde.internal.ds.ui.IConstants; > import org.eclipse.pde.internal.ds.ui.Messages; >+import org.eclipse.pde.internal.ui.util.ModelModification; >+import org.eclipse.pde.internal.ui.util.PDEModelUtility; > import org.eclipse.swt.widgets.Display; > import org.eclipse.ui.IWorkbenchPage; > import org.eclipse.ui.IWorkbenchPart; >@@ -46,6 +53,7 @@ > private String fComponentName; > private String fImplementationClass; > >+ > /** > * > */ >@@ -67,7 +75,49 @@ > createContent(); > monitor.worked(1); > openFile(); >+ writeDSPropIntoManifest(fFile.getProject(), new SubProgressMonitor( >+ monitor, 1)); >+ monitor.done(); >+ } >+ >+ private void writeDSPropIntoManifest(IProject project, >+ SubProgressMonitor monitor) { >+ >+ PDEModelUtility.modifyModel(new ModelModification(project) { >+ >+ protected void modifyModel(IBaseModel model, >+ IProgressMonitor monitor) throws CoreException { >+ >+ if (model instanceof IBundlePluginModelBase) >+ updateManifest((IBundlePluginModelBase) model, monitor); >+ } >+ }, monitor); > monitor.done(); >+ >+ } >+ >+ >+ private void updateManifest(IBundlePluginModelBase model, >+ IProgressMonitor monitor) throws CoreException { >+ IBundleModel bundleModel = model.getBundleModel(); >+ >+ IFile manifestFile = (IFile) bundleModel >+ .getUnderlyingResource(); >+ >+ IBundleModelFactory factory = bundleModel.getFactory(); >+ >+ String filePath = fFile.getFullPath().toOSString(); >+ >+ // gets the second index of "\" (the first is index=0) >+ filePath = filePath.substring(1); >+ int index = filePath.indexOf("\\"); //$NON-NLS-1$ >+ if (index > -1) { >+ // dsFilePath = "OSGI-INF/dsFile.xml"; >+ String dsFilePath = filePath.substring(index + 1); >+ bundleModel.getBundle().setHeader( >+ IConstants.DS_Manifest_Header_Key, dsFilePath); >+ } >+ > } > > protected void createContent() throws CoreException { >@@ -92,9 +142,8 @@ > component.setImplementation(implementation); > > // Component Attributes >- >+ > component.setAttributeName(fComponentName); >- > > try { > // Add builder >@@ -103,8 +152,7 @@ > ICommand[] commands = description.getBuildSpec(); > > for (int i = 0; i < commands.length; ++i) { >- if (commands[i].getBuilderName().equals( >- IConstants.ID_BUILDER)) { >+ if (commands[i].getBuilderName().equals(IConstants.ID_BUILDER)) { > return; > } > } >@@ -120,8 +168,7 @@ > } catch (CoreException e) { > Activator.logException(e, null, null); > } >- >- >+ > } > > /**
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 244088
:
110351
|
110352
| 110364