diff options
author | Mike Rennie | 2013-07-31 17:08:43 +0000 |
---|---|---|
committer | Mike Rennie | 2013-07-31 17:08:43 +0000 |
commit | e99d75b75f99059cb37a779556620eab5b40ebc9 (patch) | |
tree | c22e5807fe0713a106edde5963f662aac6fad6b2 | |
parent | 6e51f1ff97e3aed10fb5b3759c3c136b397a0ad8 (diff) | |
download | eclipse.pde.ui-e99d75b75f99059cb37a779556620eab5b40ebc9.tar.gz eclipse.pde.ui-e99d75b75f99059cb37a779556620eab5b40ebc9.tar.xz eclipse.pde.ui-e99d75b75f99059cb37a779556620eab5b40ebc9.zip |
Bug 414020 - Adapt to new Platform Debug API
Change-Id: If1b12445700040780f6c465f5781fbbddc65644b
4 files changed, 37 insertions, 17 deletions
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/TracingOptionsManager.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/TracingOptionsManager.java index 1209044087..6ed9b2c1fc 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/TracingOptionsManager.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/TracingOptionsManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2013 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 @@ -65,7 +65,7 @@ public class TracingOptionsManager { return pluginId.equalsIgnoreCase(firstSegment); } - public Properties getTracingOptions(Map<?, ?> storedOptions) { + public Properties getTracingOptions(Map<String, String> storedOptions) { // Start with the fresh template from plugins Properties defaults = getTracingTemplateCopy(); if (storedOptions != null) { @@ -74,7 +74,7 @@ public class TracingOptionsManager { while (iter.hasNext()) { String key = iter.next().toString(); if (defaults.containsKey(key)) { - defaults.setProperty(key, (String) storedOptions.get(key)); + defaults.setProperty(key, storedOptions.get(key)); } } } @@ -140,7 +140,7 @@ public class TracingOptionsManager { } } - public void save(String filename, Map<?, ?> map, HashSet<?> selected) { + public void save(String filename, Map<String, String> map, HashSet<?> selected) { Properties properties = getTracingOptions(map); for (Enumeration<?> keys = properties.keys(); keys.hasMoreElements();) { String key = keys.nextElement().toString(); @@ -152,7 +152,7 @@ public class TracingOptionsManager { save(filename, properties); } - public void save(String filename, Map<?, ?> map) { + public void save(String filename, Map<String, String> map) { save(filename, getTracingOptions(map)); } diff --git a/ui/org.eclipse.pde.ui/META-INF/MANIFEST.MF b/ui/org.eclipse.pde.ui/META-INF/MANIFEST.MF index 84a716e217..efbb334a87 100644 --- a/ui/org.eclipse.pde.ui/META-INF/MANIFEST.MF +++ b/ui/org.eclipse.pde.ui/META-INF/MANIFEST.MF @@ -75,7 +75,7 @@ Require-Bundle: org.eclipse.jface.text;bundle-version="[3.7.0,4.0.0)", org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)", org.eclipse.ui.editors;bundle-version="[3.2.0,4.0.0)", - org.eclipse.debug.ui;bundle-version="[3.2.0,4.0.0)", + org.eclipse.debug.ui;bundle-version="[3.10.0,4.0.0)", org.eclipse.jdt.core;bundle-version="[3.2.0,4.0.0)", org.eclipse.jdt.debug.ui;bundle-version="[3.2.0,4.0.0)", org.eclipse.jdt.launching;bundle-version="[3.2.0,4.0.0)", @@ -116,7 +116,7 @@ Require-Bundle: org.eclipse.team.ui;bundle-version="[3.6.100,4.0.0)", org.eclipse.help;bundle-version="[3.4.0,4.0.0)", org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)", - org.eclipse.debug.core;bundle-version="[3.6.0,4.0.0)", + org.eclipse.debug.core;bundle-version="[3.9.0,4.0.0)", org.eclipse.ui.trace;bundle-version="[1.0.0,2.0.0)" Eclipse-LazyStart: true Import-Package: com.ibm.icu.text, diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/FeatureBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/FeatureBlock.java index dcab50229d..561a505836 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/FeatureBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/FeatureBlock.java @@ -123,6 +123,7 @@ public class FeatureBlock { return ""; //$NON-NLS-1$ } + @Override public void update(ViewerCell cell) { switch (cell.getColumnIndex()) { case COLUMN_FEATURE_NAME : @@ -185,6 +186,7 @@ public class FeatureBlock { class ButtonSelectionListener extends SelectionAdapter { + @Override public void widgetSelected(SelectionEvent e) { Object source = e.getSource(); if (source == fValidateButton) { @@ -329,6 +331,7 @@ public class FeatureBlock { if (fOperation == null) // Unlike PluginBlock, we don't want to validate the application/product requirements because we will grab them automatically at launch time fOperation = new LaunchValidationOperation(fLaunchConfig) { + @Override protected IPluginModelBase[] getModels() throws CoreException { // The feature block is used in both the OSGi config and Eclipse configs, use the tab id to determine which we are using boolean isOSGiTab = fTab.getId().equals(IPDELauncherConstants.TAB_BUNDLES_ID); @@ -605,6 +608,7 @@ public class FeatureBlock { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) */ + @Override public int compare(Viewer viewer, Object e1, Object e2) { if (e1 == fAdditionalPluginsParentElement) { return 1; @@ -712,6 +716,7 @@ public class FeatureBlock { /* (non-Javadoc) * @see java.lang.Object#toString() */ + @Override public String toString() { if (fWorkspaceModel != null) { return fWorkspaceModel.getFeature().getId() + " " + fPluginResolution; //$NON-NLS-1$ @@ -786,6 +791,7 @@ public class FeatureBlock { public void createControl(Composite parent, int span, int indent) { fListener = new ButtonSelectionListener(); fSelectedOnlyFilter = new ViewerFilter() { + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { return fTree.getChecked(element); } @@ -827,6 +833,7 @@ public class FeatureBlock { private void createCheckBoxTree(Composite parent) { PatternFilter filter = new PatternFilter() { + @Override public boolean isElementVisible(Viewer viewer, Object element) { if (element instanceof FeatureLaunchModel) { return super.isElementVisible(viewer, ((FeatureLaunchModel) element).getId()); @@ -841,10 +848,12 @@ public class FeatureBlock { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.FilteredCheckboxTree#doCreateRefreshJob() */ + @Override protected WorkbenchJob doCreateRefreshJob() { // If we are only showing selected items, we need to redo the filter after text filtering is applied. The only selected filter uses the tree's check state, which hasn't been restored correctly at filter time. WorkbenchJob job = super.doCreateRefreshJob(); job.addJobChangeListener(new JobChangeAdapter() { + @Override public void done(IJobChangeEvent event) { if (event.getResult().isOK()) { getDisplay().asyncExec(new Runnable() { @@ -923,6 +932,7 @@ public class FeatureBlock { } }); fTree.getTree().addKeyListener(new KeyAdapter() { + @Override public void keyReleased(KeyEvent e) { if (e.keyCode == SWT.DEL) { // Any changes here need to be reflected in the remove button handling @@ -1173,8 +1183,7 @@ public class FeatureBlock { tree.setInput(models); // Loop through the saved config to determine location settings and selection - @SuppressWarnings("unchecked") - Set<Object> selected = config.getAttribute(IPDELauncherConstants.SELECTED_FEATURES, (Set<Object>) null); + Set<String> selected = config.getAttribute(IPDELauncherConstants.SELECTED_FEATURES, (Set<String>) null); if (selected == null) { tree.setCheckedElements(fFeatureModels.values().toArray()); } else { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/TracingBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/TracingBlock.java index 3de3af314e..844a611b64 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/TracingBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/TracingBlock.java @@ -13,6 +13,7 @@ package org.eclipse.pde.internal.ui.launcher; import java.util.*; +import java.util.Map.Entry; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; @@ -70,6 +71,7 @@ public class TracingBlock { fTracingCheck.setText(PDEUIMessages.TracingLauncherTab_tracing); fTracingCheck.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fTracingCheck.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { masterCheckChanged(true); fTab.updateLaunchConfigurationDialog(); @@ -155,6 +157,7 @@ public class TracingBlock { fSelectAllButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); SWTUtil.setButtonDimensionHint(fSelectAllButton); fSelectAllButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fPluginViewer.setAllChecked(true); pluginSelected(getSelectedModel(), true); @@ -167,6 +170,7 @@ public class TracingBlock { fDeselectAllButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); SWTUtil.setButtonDimensionHint(fDeselectAllButton); fDeselectAllButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fPluginViewer.setAllChecked(false); pluginSelected(getSelectedModel(), false); @@ -202,12 +206,12 @@ public class TracingBlock { disposePropertySources(); try { fTracingCheck.setSelection(config.getAttribute(IPDELauncherConstants.TRACING, false)); - Map<?, ?> options = config.getAttribute(IPDELauncherConstants.TRACING_OPTIONS, (Map<?, ?>) null); - if (options == null) - options = PDECore.getDefault().getTracingOptionsManager().getTracingTemplateCopy(); - else - options = PDECore.getDefault().getTracingOptionsManager().getTracingOptions(options); - fMasterOptions.putAll(options); + Map<String, String> options = config.getAttribute(IPDELauncherConstants.TRACING_OPTIONS, (Map<String, String>) null); + if (options == null) { + fMasterOptions.putAll(PDECore.getDefault().getTracingOptionsManager().getTracingTemplateCopy()); + } else { + fMasterOptions.putAll(PDECore.getDefault().getTracingOptionsManager().getTracingOptions(options)); + } masterCheckChanged(false); String checked = config.getAttribute(IPDELauncherConstants.TRACING_CHECKED, (String) null); if (checked == null) { @@ -251,8 +255,13 @@ public class TracingBlock { source.save(); } } - if (changes) - config.setAttribute(IPDELauncherConstants.TRACING_OPTIONS, fMasterOptions); + if (changes) { + HashMap<String, String> atts = new HashMap<String, String>(fMasterOptions.size()); + for (Entry<Object, Object> entry : fMasterOptions.entrySet()) { + atts.put((String) entry.getKey(), (String) entry.getValue()); + } + config.setAttribute(IPDELauncherConstants.TRACING_OPTIONS, atts); + } } Object[] checked = fPluginViewer.getCheckedElements(); @@ -405,6 +414,7 @@ public class TracingBlock { fEnabled = enabled; } + @Override public boolean equals(Object object) { if (object instanceof PageBookKey) { return fEnabled == ((PageBookKey) object).fEnabled && fModel.equals(((PageBookKey) object).fModel); @@ -412,6 +422,7 @@ public class TracingBlock { return false; } + @Override public int hashCode() { return fModel.hashCode() + (fEnabled ? 1 : 0); } |