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 129367 Details for
Bug 245782
[product] creating products from OSGi launch configs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
org.eclipse.pde.ui.patch
clipboard.txt (text/plain), 11.01 KB, created by
Chris Aniszczyk
on 2009-03-19 12:12:24 EDT
(
hide
)
Description:
org.eclipse.pde.ui.patch
Filename:
MIME Type:
Creator:
Chris Aniszczyk
Created:
2009-03-19 12:12:24 EDT
Size:
11.01 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/wizards/product/ProductFromConfigOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductFromConfigOperation.java,v >retrieving revision 1.13 >diff -u -r1.13 ProductFromConfigOperation.java >--- src/org/eclipse/pde/internal/ui/wizards/product/ProductFromConfigOperation.java 17 Apr 2008 16:17:34 -0000 1.13 >+++ src/org/eclipse/pde/internal/ui/wizards/product/ProductFromConfigOperation.java 19 Mar 2009 16:12:28 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2008 IBM Corporation and others. >+ * Copyright (c) 2005, 2009 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 >@@ -7,9 +7,11 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * EclipseSource Corporation - ongoing enhancements > *******************************************************************************/ > package org.eclipse.pde.internal.ui.wizards.product; > >+import java.util.*; > import org.eclipse.core.resources.IContainer; > import org.eclipse.core.resources.IFile; > import org.eclipse.core.runtime.*; >@@ -19,7 +21,7 @@ > import org.eclipse.pde.internal.core.iproduct.*; > import org.eclipse.pde.internal.core.iproduct.IProduct; > import org.eclipse.pde.internal.ui.PDEPlugin; >-import org.eclipse.pde.internal.ui.launcher.LaunchPluginValidator; >+import org.eclipse.pde.internal.ui.launcher.BundleLauncherHelper; > import org.eclipse.pde.ui.launcher.IPDELauncherConstants; > > /** >@@ -67,7 +69,19 @@ > product.setJREInfo(jreInfo); > } > >- addPlugins(factory, product, LaunchPluginValidator.getPluginList(fLaunchConfiguration)); >+ // fetch the plug-ins models >+ String workspaceId = IPDELauncherConstants.SELECTED_WORKSPACE_PLUGINS; >+ String targetId = IPDELauncherConstants.SELECTED_TARGET_PLUGINS; >+ if (fLaunchConfiguration.getType().getIdentifier().equals(IPDELauncherConstants.OSGI_CONFIGURATION_TYPE)) { >+ workspaceId = IPDELauncherConstants.WORKSPACE_BUNDLES; >+ targetId = IPDELauncherConstants.TARGET_BUNDLES; >+ } >+ Set set = new HashSet(); >+ Map map = BundleLauncherHelper.getWorkspaceBundleMap(fLaunchConfiguration, set, workspaceId); >+ map.putAll(BundleLauncherHelper.getTargetBundleMap(fLaunchConfiguration, set, targetId)); >+ >+ addPlugins(factory, product, map); >+ > if (fLaunchConfiguration.getAttribute(IPDELauncherConstants.CONFIG_GENERATE_DEFAULT, true)) { > super.initializeProduct(product); > } else { >@@ -83,7 +97,7 @@ > } > } > } catch (CoreException e) { >+ PDEPlugin.logException(e); > } > } >- > } >Index: src/org/eclipse/pde/internal/ui/wizards/product/BaseProductCreationOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/BaseProductCreationOperation.java,v >retrieving revision 1.27 >diff -u -r1.27 BaseProductCreationOperation.java >--- src/org/eclipse/pde/internal/ui/wizards/product/BaseProductCreationOperation.java 6 Mar 2009 22:52:06 -0000 1.27 >+++ src/org/eclipse/pde/internal/ui/wizards/product/BaseProductCreationOperation.java 19 Mar 2009 16:12:28 -0000 >@@ -12,8 +12,7 @@ > package org.eclipse.pde.internal.ui.wizards.product; > > import java.lang.reflect.InvocationTargetException; >-import java.util.Properties; >-import java.util.StringTokenizer; >+import java.util.*; > import org.eclipse.core.resources.IFile; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IProgressMonitor; >@@ -157,14 +156,34 @@ > } > } > >- protected void addPlugins(IProductModelFactory factory, IProduct product, IPluginModelBase[] plugins) { >- IProductPlugin[] pplugins = new IProductPlugin[plugins.length]; >- for (int i = 0; i < plugins.length; i++) { >+ protected void addPlugins(IProductModelFactory factory, IProduct product, Map plugins) { >+ IProductPlugin[] pplugins = new IProductPlugin[plugins.size()]; >+ List configurations = new ArrayList(3); >+ IPluginModelBase[] models = (IPluginModelBase[]) plugins.keySet().toArray(new IPluginModelBase[plugins.size()]); >+ for (int i = 0; i < models.length; i++) { >+ IPluginModelBase model = models[i]; >+ >+ // create plug-in model > IProductPlugin pplugin = factory.createPlugin(); >- pplugin.setId(plugins[i].getPluginBase().getId()); >+ pplugin.setId(model.getPluginBase().getId()); > pplugins[i] = pplugin; >+ >+ // create plug-in configuration model >+ String sl = (String) plugins.get(model); >+ if (!model.isFragmentModel() && !sl.equals("default:default")) { //$NON-NLS-1$ >+ IPluginConfiguration configuration = factory.createPluginConfiguration(); >+ configuration.setId(model.getPluginBase().getId()); >+ // TODO do we want to set the version here? >+ String[] slinfo = sl.split(":"); //$NON-NLS-1$ >+ configuration.setStartLevel(Integer.valueOf(slinfo[0]).intValue()); >+ configuration.setAutoStart(slinfo[0].equals("true")); //$NON-NLS-1$ >+ configurations.add(configuration); >+ } > } > product.addPlugins(pplugins); >+ int size = configurations.size(); >+ if (size > 0) >+ product.addPluginConfigurations((IPluginConfiguration[]) configurations.toArray(new IPluginConfiguration[size])); > } > > protected void addPlugins(IProductModelFactory factory, IProduct product, String[] plugins) { >Index: src/org/eclipse/pde/internal/ui/wizards/product/ProductFileWizardPage.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductFileWizardPage.java,v >retrieving revision 1.5 >diff -u -r1.5 ProductFileWizardPage.java >--- src/org/eclipse/pde/internal/ui/wizards/product/ProductFileWizardPage.java 16 Jan 2008 17:08:26 -0000 1.5 >+++ src/org/eclipse/pde/internal/ui/wizards/product/ProductFileWizardPage.java 19 Mar 2009 16:12:28 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2007 IBM Corporation and others. >+ * Copyright (c) 2005, 2009 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 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * EclipseSource Corporation - ongoing enhancements > *******************************************************************************/ > package org.eclipse.pde.internal.ui.wizards.product; > >@@ -20,9 +21,10 @@ > import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.jface.viewers.IStructuredSelection; > import org.eclipse.pde.core.plugin.*; >-import org.eclipse.pde.internal.ui.IHelpContextIds; >-import org.eclipse.pde.internal.ui.PDEUIMessages; >+import org.eclipse.pde.internal.ui.*; > import org.eclipse.pde.internal.ui.wizards.PDEWizardNewFileCreationPage; >+import org.eclipse.pde.ui.launcher.EclipseLaunchShortcut; >+import org.eclipse.pde.ui.launcher.IPDELauncherConstants; > import org.eclipse.swt.SWT; > import org.eclipse.swt.events.SelectionAdapter; > import org.eclipse.swt.events.SelectionEvent; >@@ -146,13 +148,21 @@ > ArrayList list = new ArrayList(); > try { > ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); >- ILaunchConfigurationType type = manager.getLaunchConfigurationType("org.eclipse.pde.ui.RuntimeWorkbench"); //$NON-NLS-1$ >+ ILaunchConfigurationType type = manager.getLaunchConfigurationType(EclipseLaunchShortcut.CONFIGURATION_TYPE); > ILaunchConfiguration[] configs = manager.getLaunchConfigurations(type); > for (int i = 0; i < configs.length; i++) { > if (!DebugUITools.isPrivate(configs[i])) > list.add(configs[i].getName()); > } >+ // add osgi launch configs to the list >+ type = manager.getLaunchConfigurationType(IPDELauncherConstants.OSGI_CONFIGURATION_TYPE); >+ configs = manager.getLaunchConfigurations(type); >+ for (int i = 0; i < configs.length; i++) { >+ if (!DebugUITools.isPrivate(configs[i])) >+ list.add(configs[i].getName()); >+ } > } catch (CoreException e) { >+ PDEPlugin.logException(e); > } > return (String[]) list.toArray(new String[list.size()]); > } >@@ -164,13 +174,19 @@ > String configName = fLaunchConfigCombo.getText(); > try { > ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); >- ILaunchConfigurationType type = manager.getLaunchConfigurationType("org.eclipse.pde.ui.RuntimeWorkbench"); //$NON-NLS-1$ >+ ILaunchConfigurationType type = manager.getLaunchConfigurationType(EclipseLaunchShortcut.CONFIGURATION_TYPE); >+ ILaunchConfigurationType type2 = manager.getLaunchConfigurationType(IPDELauncherConstants.OSGI_CONFIGURATION_TYPE); > ILaunchConfiguration[] configs = manager.getLaunchConfigurations(type); >- for (int i = 0; i < configs.length; i++) { >- if (configs[i].getName().equals(configName) && !DebugUITools.isPrivate(configs[i])) >- return configs[i]; >+ ILaunchConfiguration[] configs2 = manager.getLaunchConfigurations(type2); >+ ILaunchConfiguration[] configurations = new ILaunchConfiguration[configs.length + configs2.length]; >+ System.arraycopy(configs, 0, configurations, 0, configs.length); >+ System.arraycopy(configs2, 0, configurations, configs.length, configs2.length); >+ for (int i = 0; i < configurations.length; i++) { >+ if (configurations[i].getName().equals(configName) && !DebugUITools.isPrivate(configurations[i])) >+ return configurations[i]; > } > } catch (CoreException e) { >+ PDEPlugin.logException(e); > } > return null; > } >Index: src/org/eclipse/pde/internal/ui/launcher/LaunchAction.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/LaunchAction.java,v >retrieving revision 1.30 >diff -u -r1.30 LaunchAction.java >--- src/org/eclipse/pde/internal/ui/launcher/LaunchAction.java 18 Mar 2009 20:50:34 -0000 1.30 >+++ src/org/eclipse/pde/internal/ui/launcher/LaunchAction.java 19 Mar 2009 16:12:28 -0000 >@@ -111,13 +111,13 @@ > > private void appendBundle(StringBuffer buffer, IPluginModelBase model) { > IPluginConfiguration configuration = (IPluginConfiguration) fPluginConfigurations.get(model.getPluginBase().getId()); >- int sl = 4; >- String autostart = "false"; //$NON-NLS-1$ >+ String sl = "default"; //$NON-NLS-1$ >+ String autostart = "default"; //$NON-NLS-1$ > if (configuration != null) { >- sl = configuration.getStartLevel(); >+ sl = Integer.toString(configuration.getStartLevel()); > autostart = Boolean.toString(configuration.isAutoStart()); > } >- String entry = BundleLauncherHelper.writeBundleEntry(model, Integer.toString(sl), autostart); >+ String entry = BundleLauncherHelper.writeBundleEntry(model, sl, autostart); > buffer.append(entry); > buffer.append(','); > }
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 245782
:
129318
| 129367 |
129369
|
129370