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 133232 Details for
Bug 272068
[category] Hook export to use category definitions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Updated patch
clipboard.txt (text/plain), 11.43 KB, created by
Ian Bull
on 2009-04-25 18:21:04 EDT
(
hide
)
Description:
Updated patch
Filename:
MIME Type:
Creator:
Ian Bull
Created:
2009-04-25 18:21:04 EDT
Size:
11.43 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/wizards/exports/FeatureOptionsTab.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureOptionsTab.java,v >retrieving revision 1.8 >diff -u -r1.8 FeatureOptionsTab.java >--- src/org/eclipse/pde/internal/ui/wizards/exports/FeatureOptionsTab.java 9 Mar 2009 19:04:54 -0000 1.8 >+++ src/org/eclipse/pde/internal/ui/wizards/exports/FeatureOptionsTab.java 25 Apr 2009 22:21:21 -0000 >@@ -10,27 +10,35 @@ > *******************************************************************************/ > package org.eclipse.pde.internal.ui.wizards.exports; > >+import java.io.File; >+import java.net.URI; > import org.eclipse.jface.dialogs.IDialogSettings; > import org.eclipse.pde.internal.core.FeatureModelManager; > import org.eclipse.pde.internal.core.PDECore; > import org.eclipse.pde.internal.core.ifeature.IFeatureModel; >-import org.eclipse.pde.internal.ui.PDEUIMessages; >-import org.eclipse.pde.internal.ui.SWTFactory; >+import org.eclipse.pde.internal.ui.*; >+import org.eclipse.pde.internal.ui.util.SWTUtil; > import org.eclipse.swt.SWT; > import org.eclipse.swt.events.SelectionAdapter; > import org.eclipse.swt.events.SelectionEvent; > import org.eclipse.swt.layout.GridData; >-import org.eclipse.swt.widgets.Button; >-import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.*; > > public class FeatureOptionsTab extends ExportOptionsTab { > > private static final String S_MULTI_PLATFORM = "multiplatform"; //$NON-NLS-1$ > private static final String S_EXPORT_METADATA = "p2metadata"; //$NON-NLS-1$ >+ private static final String S_CATEGORY_FILE = "category_file"; //$NON-NLS-1$ >+ private static final String S_CREATE_CATEGORIES = "create_categories"; //$NON-NLS-1$ > > private Button fMultiPlatform; > private Button fExportMetadata; > >+ private Button fCategoryButton; >+ private Combo fCategoryCombo; >+ private Button fCategoryBrowse; >+ > public FeatureOptionsTab(FeatureExportWizardPage page) { > super(page); > } >@@ -39,6 +47,8 @@ > fJarButton.addSelectionListener(new SelectionAdapter() { > public void widgetSelected(SelectionEvent e) { > fExportMetadata.setEnabled(fJarButton.getSelection()); >+ fCategoryButton.setEnabled(fExportMetadata.getSelection() && fJarButton.getSelection()); >+ updateCategoryGeneration(); > } > }); > fExportMetadata = SWTFactory.createCheckButton(comp, PDEUIMessages.ExportWizard_includesMetadata, null, false, 1); >@@ -51,6 +61,31 @@ > fMultiPlatform = new Button(comp, SWT.CHECK); > fMultiPlatform.setText(PDEUIMessages.ExportWizard_multi_platform); > } >+ Composite categoryComposite = new Composite(comp, SWT.NONE); >+ >+ data = new GridData(SWT.FILL, SWT.FILL, true, false); >+ data.horizontalIndent = 20; >+ categoryComposite.setLayoutData(data); >+ GridLayout layout = new GridLayout(3, false); >+ layout.marginRight = 0; >+ layout.marginLeft = 0; >+ layout.marginWidth = 0; >+ layout.marginHeight = 0; >+ layout.marginBottom = 0; >+ layout.marginTop = 0; >+ categoryComposite.setLayout(layout); >+ >+ fCategoryButton = new Button(categoryComposite, SWT.CHECK); >+ fCategoryButton.setText(PDEUIMessages.ExportWizard_generateCategories + ":"); //$NON-NLS-1$ >+ fCategoryButton.setSelection(true); >+ >+ fCategoryCombo = new Combo(categoryComposite, SWT.NONE); >+ fCategoryCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ >+ fCategoryBrowse = new Button(categoryComposite, SWT.PUSH); >+ fCategoryBrowse.setText(PDEUIMessages.ExportWizard_browse); >+ fCategoryBrowse.setLayoutData(new GridData()); >+ SWTUtil.setButtonDimensionHint(fCategoryBrowse); > > } > >@@ -65,6 +100,22 @@ > return fExportMetadata.isEnabled() && fExportMetadata.getSelection(); > } > >+ protected URI getCategoryDefinition() { >+ if (doExportCategories()) { >+ File f = new File(fCategoryCombo.getText().trim()); >+ if (f.exists()) >+ return f.toURI(); >+ } >+ return null; >+ } >+ >+ /** >+ * @return whether to publish categories when exporting >+ */ >+ private boolean doExportCategories() { >+ return doExportMetadata() && fCategoryButton.getSelection() && fCategoryCombo.getText().trim().length() > 0; >+ } >+ > protected void initialize(IDialogSettings settings) { > super.initialize(settings); > if (fMultiPlatform != null) { >@@ -74,6 +125,13 @@ > String selected = settings.get(S_EXPORT_METADATA); > fExportMetadata.setSelection(selected == null ? true : Boolean.TRUE.toString().equals(selected)); > fExportMetadata.setEnabled(fJarButton.getSelection()); >+ selected = settings.get(S_CREATE_CATEGORIES); >+ >+ fCategoryButton.setEnabled(fExportMetadata.getSelection() && fJarButton.getSelection()); >+ fCategoryButton.setSelection(selected == null ? true : Boolean.TRUE.toString().equals(selected)); >+ if (settings.get(S_CATEGORY_FILE) != null) >+ fCategoryCombo.setText(settings.get(S_CATEGORY_FILE)); >+ updateCategoryGeneration(); > } > > protected void saveSettings(IDialogSettings settings) { >@@ -82,6 +140,8 @@ > settings.put(S_MULTI_PLATFORM, fMultiPlatform.getSelection()); > } > settings.put(S_EXPORT_METADATA, doExportMetadata()); >+ settings.put(S_CREATE_CATEGORIES, fCategoryButton.getSelection()); >+ settings.put(S_CATEGORY_FILE, fCategoryCombo.getText()); > } > > protected void hookListeners() { >@@ -93,6 +153,29 @@ > } > }); > } >+ >+ fExportMetadata.addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ fCategoryButton.setEnabled(fExportMetadata.getSelection() && fJarButton.getSelection()); >+ updateCategoryGeneration(); >+ } >+ }); >+ fCategoryButton.addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ updateCategoryGeneration(); >+ } >+ }); >+ >+ fCategoryBrowse.addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ openFile(fCategoryCombo, new String[] {"*.xml", "*.*"}); //$NON-NLS-1$ //$NON-NLS-2$ >+ } >+ }); >+ } >+ >+ protected void updateCategoryGeneration() { >+ fCategoryBrowse.setEnabled(fExportMetadata.getSelection() && fCategoryButton.getSelection() && fJarButton.getSelection()); >+ fCategoryCombo.setEnabled(fExportMetadata.getSelection() && fCategoryButton.getSelection() && fJarButton.getSelection()); > } > > protected boolean doMultiplePlatform() { >@@ -102,6 +185,24 @@ > protected void setEnabledForInstall(boolean enabled) { > super.setEnabledForInstall(enabled); > fExportMetadata.setEnabled(enabled); >+ fCategoryButton.setEnabled(enabled); >+ fCategoryCombo.setEnabled(enabled); >+ fCategoryBrowse.setEnabled(enabled); >+ } >+ >+ protected void openFile(Combo combo, String[] filter) { >+ FileDialog dialog = new FileDialog(fPage.getShell(), SWT.OPEN); >+ String path = combo.getText(); >+ if (path.trim().length() == 0) >+ path = PDEPlugin.getWorkspace().getRoot().getLocation().toString(); >+ dialog.setFilterExtensions(filter); >+ dialog.setFileName(path); >+ String res = dialog.open(); >+ if (res != null) { >+ if (combo.indexOf(res) == -1) >+ combo.add(res, 0); >+ combo.setText(res); >+ } > } > > } >Index: src/org/eclipse/pde/internal/ui/wizards/exports/FeatureExportWizard.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureExportWizard.java,v >retrieving revision 1.64 >diff -u -r1.64 FeatureExportWizard.java >--- src/org/eclipse/pde/internal/ui/wizards/exports/FeatureExportWizard.java 3 Feb 2009 19:55:58 -0000 1.64 >+++ src/org/eclipse/pde/internal/ui/wizards/exports/FeatureExportWizard.java 25 Apr 2009 22:21:21 -0000 >@@ -13,6 +13,7 @@ > import java.io.File; > import javax.xml.parsers.*; > import org.eclipse.core.resources.ResourcesPlugin; >+import org.eclipse.core.runtime.URIUtil; > import org.eclipse.core.runtime.jobs.IJobChangeEvent; > import org.eclipse.core.runtime.jobs.JobChangeAdapter; > import org.eclipse.pde.internal.build.site.QualifierReplacer; >@@ -74,6 +75,8 @@ > info.signingInfo = fPage.getSigningInfo(); > info.jnlpInfo = ((FeatureExportWizardPage) fPage).getJNLPInfo(); > info.qualifier = fPage.getQualifier(); >+ if (((FeatureExportWizardPage) fPage).getCategoryDefinition() != null) >+ info.categoryDefinition = URIUtil.toUnencodedString(((FeatureExportWizardPage) fPage).getCategoryDefinition()); > > final boolean installAfterExport = fPage.doInstall(); > if (installAfterExport) { >Index: src/org/eclipse/pde/internal/ui/wizards/exports/FeatureExportWizardPage.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureExportWizardPage.java,v >retrieving revision 1.35 >diff -u -r1.35 FeatureExportWizardPage.java >--- src/org/eclipse/pde/internal/ui/wizards/exports/FeatureExportWizardPage.java 9 May 2008 17:54:43 -0000 1.35 >+++ src/org/eclipse/pde/internal/ui/wizards/exports/FeatureExportWizardPage.java 25 Apr 2009 22:21:21 -0000 >@@ -10,6 +10,7 @@ > *******************************************************************************/ > package org.eclipse.pde.internal.ui.wizards.exports; > >+import java.net.URI; > import org.eclipse.core.resources.IProject; > import org.eclipse.core.runtime.IAdaptable; > import org.eclipse.jface.dialogs.IDialogSettings; >@@ -143,6 +144,16 @@ > return false; > } > >+ /** >+ * @return the location of the category definition file. Null if none specified. >+ */ >+ protected URI getCategoryDefinition() { >+ if (fOptionsTab instanceof FeatureOptionsTab) { >+ return ((FeatureOptionsTab) fOptionsTab).getCategoryDefinition(); >+ } >+ return null; >+ } >+ > public IWizardPage getNextPage() { > return doMultiPlatform() ? getWizard().getNextPage(this) : null; > } >Index: src/org/eclipse/pde/internal/ui/PDEUIMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEUIMessages.java,v >retrieving revision 1.435 >diff -u -r1.435 PDEUIMessages.java >--- src/org/eclipse/pde/internal/ui/PDEUIMessages.java 20 Apr 2009 15:49:48 -0000 1.435 >+++ src/org/eclipse/pde/internal/ui/PDEUIMessages.java 25 Apr 2009 22:21:18 -0000 >@@ -1654,6 +1654,7 @@ > public static String ExportWizard_includeSourceInBinaryBundles; > public static String ExportWizard_generateAssociatedSourceBundles; > public static String ExportWizard_includesMetadata; >+ public static String ExportWizard_generateCategories; > public static String ExportWizard_multi_platform; > public static String ExportWizard_destination; > public static String ExportWizard_options; >Index: src/org/eclipse/pde/internal/ui/pderesources.properties >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/pderesources.properties,v >retrieving revision 1.1077 >diff -u -r1.1077 pderesources.properties >--- src/org/eclipse/pde/internal/ui/pderesources.properties 20 Apr 2009 15:49:48 -0000 1.1077 >+++ src/org/eclipse/pde/internal/ui/pderesources.properties 25 Apr 2009 22:21:21 -0000 >@@ -1501,6 +1501,7 @@ > ExportWizard_includeSourceInBinaryBundles = Include source in exported plug-ins > ExportWizard_generateAssociatedSourceBundles = Generate source bundles > ExportWizard_includesMetadata = Generate metadata &repository >+ExportWizard_generateCategories = &Categorize repository > ExportWizard_multi_platform = Export for &multiple platforms > ExportWizard_destination = &Destination > ExportWizard_options = &Options
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 272068
:
131864
|
131865
|
131878
|
131879
|
132296
| 133232 |
133233