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 110351 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.
Adding Service-Component tag to Manifest.mf
org.eclipse.pde.ds.ui.126.patch (text/plain), 3.77 KB, created by
Rafael Oliveira Nóbrega
on 2008-08-19 11:42:36 EDT
(
hide
)
Description:
Adding Service-Component tag to Manifest.mf
Filename:
MIME Type:
Creator:
Rafael Oliveira Nóbrega
Created:
2008-08-19 11:42:36 EDT
Size:
3.77 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 15:41:34 -0000 >@@ -12,7 +12,14 @@ > *******************************************************************************/ > package org.eclipse.pde.internal.ds.ui.wizards; > >+import java.io.File; >+import java.io.FileInputStream; >+import java.io.FileNotFoundException; >+import java.io.FileOutputStream; >+import java.io.IOException; >+import java.io.OutputStreamWriter; > import java.lang.reflect.InvocationTargetException; >+import java.util.Map; > > import org.eclipse.core.resources.ICommand; > import org.eclipse.core.resources.IFile; >@@ -22,6 +29,9 @@ > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.jface.viewers.ISelection; > import org.eclipse.jface.viewers.StructuredSelection; >+import org.eclipse.osgi.util.ManifestElement; >+import org.eclipse.pde.internal.core.ICoreConstants; >+import org.eclipse.pde.internal.core.converter.PluginConverter; > import org.eclipse.pde.internal.core.util.CoreUtility; > import org.eclipse.pde.internal.ds.core.IDSComponent; > import org.eclipse.pde.internal.ds.core.IDSDocumentFactory; >@@ -39,6 +49,7 @@ > import org.eclipse.ui.actions.WorkspaceModifyOperation; > import org.eclipse.ui.ide.IDE; > import org.eclipse.ui.part.ISetSelectionTarget; >+import org.osgi.framework.BundleException; > > public class DSCreationOperation extends WorkspaceModifyOperation { > >@@ -67,9 +78,48 @@ > createContent(); > monitor.worked(1); > openFile(); >+ updateManifest(); > monitor.done(); > } > >+ private void updateManifest() { >+ >+ IProject project = fFile.getProject(); >+ File outputFile = new File(project.getLocation().append( >+ ICoreConstants.BUNDLE_FILENAME_DESCRIPTOR).toOSString()); >+ Map prop; >+ try { >+ OutputStreamWriter out = new OutputStreamWriter( >+ new FileOutputStream(outputFile)); >+ >+ prop = ManifestElement.parseBundleManifest(new FileInputStream( >+ outputFile), null); >+ >+ addDSProp(prop); >+ >+ PluginConverter.getDefault().writeManifest(prop, >+ out); >+ >+ out.close(); >+ >+ >+ } catch (FileNotFoundException e) { >+ } catch (IOException e) { >+ } catch (BundleException e) { >+ } >+ } >+ >+ private void addDSProp(Map prop) { >+ String key = "Service-Component"; >+ String filePath = fFile.getFullPath().toOSString(); >+ filePath = filePath.substring(1); >+ int index = filePath.indexOf("\\"); >+ if (index > -1) { >+ String string = filePath.substring(index + 1); >+ prop.put(key, string); >+ } >+ } >+ > protected void createContent() throws CoreException { > IDSModel model = new DSModel(CoreUtility.getTextDocument(fFile > .getContents()), false); >@@ -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 Raw
Actions:
View
Attachments on
bug 244088
:
110351
|
110352
|
110364