Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2013-03-11 15:07:29 -0400
committerPawel Piech2013-03-11 15:07:29 -0400
commit00f6e99dc7478899c4054a9c431c1bf8fc71eaed (patch)
treec763cbf329fac563299b8388098dabdb97a2b205
parent6fc665f50d6c006ea36d617d912c1b039d22f26b (diff)
downloadeclipse.platform.debug-00f6e99dc7478899c4054a9c431c1bf8fc71eaed.tar.gz
eclipse.platform.debug-00f6e99dc7478899c4054a9c431c1bf8fc71eaed.tar.xz
eclipse.platform.debug-00f6e99dc7478899c4054a9c431c1bf8fc71eaed.zip
Revert "Bug 372181 - Working set support for Expressions View"
-rw-r--r--org.eclipse.debug.ui/plugin.properties3
-rw-r--r--org.eclipse.debug.ui/plugin.xml6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/AssignWorkingSetsAction.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionLabelProvider.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionLabelProvider.java)2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetElementAdapter.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionWorkingSetElementAdapter.java)2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetFilter.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionWorkingSetFilter.java)24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetFilterManager.java405
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetMessages.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionWorkingSetMessages.java)2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetMessages.properties (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionWorkingSetMessages.properties)0
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetPage.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionWorkingSetPage.java)2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetsAction.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ExpressionWorkingSetsAction.java)11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/IExpressionWorkingSetConstants.java25
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerContentProvider.java47
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/IAddNewExpression.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java85
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java18
18 files changed, 514 insertions, 148 deletions
diff --git a/org.eclipse.debug.ui/plugin.properties b/org.eclipse.debug.ui/plugin.properties
index 6f83288f9..2a491ddce 100644
--- a/org.eclipse.debug.ui/plugin.properties
+++ b/org.eclipse.debug.ui/plugin.properties
@@ -11,7 +11,6 @@
# Wind River Systems - Pawel Piech - Added Modules view (bug 211158)
# Wind River Systems - Ted Williams -[Memory View] Memory View: Workflow Enhancements (bug 215432)
# Patrick Chuong (Texas Instruments) - Move debug toolbar actions to main window (Bug 332784)
-# Abeer Bagul (Tensilica) - Working set support for Expressions view (Bug 372181)
###############################################################################
pluginName=Debug UI
@@ -273,8 +272,6 @@ addWatchExpressionAction.label=&Add Watch Expression...
addWatchExpressionAction.tooltip=Create a new watch expression
convertToWatchExpressionAction.label=Convert to &Watch Expression
convertToWatchExpressionAction.tooltip=Convert an inspect expression to a watch expression
-assignWatchExpressionToWorkingSet.label=Assign Working Sets
-assignWatchExpressionToWorkingSet.tooltip=Assign selected watch expressions to a working set
Watch.label=Wa&tch
Watch.description=Create a watch expression from the current selection and add it to the Expressions view
diff --git a/org.eclipse.debug.ui/plugin.xml b/org.eclipse.debug.ui/plugin.xml
index 15a24ea3b..ce52c69fc 100644
--- a/org.eclipse.debug.ui/plugin.xml
+++ b/org.eclipse.debug.ui/plugin.xml
@@ -3172,8 +3172,8 @@ M4 = Platform-specific fourth key
name="%ExpressionWorkingSet.name"
description="%ExpressionWorkingSet.description"
icon="icons/full/obj16/expression_workingset.gif"
- pageClass="org.eclipse.debug.internal.ui.views.expression.ExpressionWorkingSetPage"
- elementAdapterClass="org.eclipse.debug.internal.ui.views.expression.ExpressionWorkingSetElementAdapter"
+ pageClass="org.eclipse.debug.internal.ui.expression.workingset.ExpressionWorkingSetPage"
+ elementAdapterClass="org.eclipse.debug.internal.ui.expression.workingset.ExpressionWorkingSetElementAdapter"
/>
</extension>
@@ -3183,7 +3183,7 @@ M4 = Platform-specific fourth key
targetID="org.eclipse.debug.ui.ExpressionView"
id="org.eclipse.debug.ui.expressionview.toolbar.workingset">
<action
- class="org.eclipse.debug.internal.ui.actions.expressions.ExpressionWorkingSetsAction"
+ class="org.eclipse.debug.internal.ui.expression.workingset.ExpressionWorkingSetsAction"
helpContextId="expression_working_sets_action_context"
id="org.eclipse.debug.ui.expressionView.toolbar.workingSets"
label="%ExpressionWorkingSet.manageAction.label"
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
index d9292f61c..5893e5b85 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
@@ -560,7 +560,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
BreakpointOrganizerManager.getDefault();
//start the expression workingset manager
-// ExpressionWorkingSetFilterManager.getInstance().init();
+ ExpressionWorkingSetFilterManager.getInstance().init();
getLaunchConfigurationManager().startup();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/AssignWorkingSetsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/AssignWorkingSetsAction.java
index a3c2a4791..090262338 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/AssignWorkingSetsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/AssignWorkingSetsAction.java
@@ -16,7 +16,7 @@ import java.util.List;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.debug.core.model.IWatchExpression;
-import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.debug.internal.ui.expression.workingset.IExpressionWorkingSetConstants;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
@@ -130,7 +130,7 @@ public class AssignWorkingSetsAction extends WatchExpressionAction {
public void run() {
IWorkingSetManager manager = PlatformUI.getWorkbench().getWorkingSetManager();
IWorkingSetNewWizard wizard = manager.createWorkingSetNewWizard(
- new String[] {IDebugUIConstants.EXPRESSION_WORKINGSET_ID});
+ new String[] {IExpressionWorkingSetConstants.EXPRESSION_WORKINGSET_ID});
if (wizard != null)
{
WizardDialog dialog = new WizardDialog(
@@ -215,7 +215,7 @@ public class AssignWorkingSetsAction extends WatchExpressionAction {
for (int i=0; i<allWorkingSets.length; i++)
{
IWorkingSet workingSet = allWorkingSets[i];
- if (IDebugUIConstants.EXPRESSION_WORKINGSET_ID.equals(workingSet.getId()))
+ if (IExpressionWorkingSetConstants.EXPRESSION_WORKINGSET_ID.equals(workingSet.getId()))
expressionWorkingSets.add(workingSet);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionLabelProvider.java
index 99801dbd4..01c3f98e9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionLabelProvider.java
@@ -8,7 +8,7 @@
* Contributors:
* Abeer Bagul (Tensilica Inc) - initial API and implementation (Bug 372181)
*******************************************************************************/
-package org.eclipse.debug.internal.ui.views.expression;
+package org.eclipse.debug.internal.ui.expression.workingset;
import org.eclipse.debug.core.model.IExpression;
import org.eclipse.debug.ui.DebugUITools;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionWorkingSetElementAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetElementAdapter.java
index b4e514eae..5a9906395 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionWorkingSetElementAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetElementAdapter.java
@@ -8,7 +8,7 @@
* Contributors:
* Abeer Bagul (Tensilica Inc) - initial API and implementation (Bug 372181)
*******************************************************************************/
-package org.eclipse.debug.internal.ui.views.expression;
+package org.eclipse.debug.internal.ui.expression.workingset;
import java.util.ArrayList;
import java.util.List;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionWorkingSetFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetFilter.java
index 4a2b199f7..d169b6388 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionWorkingSetFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetFilter.java
@@ -8,10 +8,11 @@
* Contributors:
* Abeer Bagul (Tensilica Inc) - initial API and implementation (Bug 372181)
*******************************************************************************/
-package org.eclipse.debug.internal.ui.views.expression;
+package org.eclipse.debug.internal.ui.expression.workingset;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.debug.core.model.IExpression;
+import org.eclipse.debug.internal.ui.model.elements.IAddNewExpression;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewerFilter;
import org.eclipse.jface.viewers.Viewer;
@@ -39,18 +40,25 @@ public class ExpressionWorkingSetFilter extends TreeModelViewerFilter {
public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (selectedWorkingSets == null || selectedWorkingSets.length == 0) return true;
+ if (selectedWorkingSets == null)
+ return true;
- if (element instanceof IAdaptable) {
+ if (selectedWorkingSets.length == 0)
+ return true;
+
+ if (element instanceof IAddNewExpression)
+ return true;
+
+ if (element instanceof IAdaptable)
+ {
IExpression expressionToFilter = (IExpression) ((IAdaptable) element).getAdapter(IExpression.class);
- if (expressionToFilter != null) {
+ if (expressionToFilter != null)
+ {
return isInWorkingSet(expressionToFilter);
- }
+ }
}
- // Do not filter out elements which do not adapt to IExpression. These may
- // include special elements, such as the "Add New Expression..." element.
- return true;
+ return false;
}
private boolean isInWorkingSet(IExpression expression)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetFilterManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetFilterManager.java
new file mode 100644
index 000000000..bcaee16cb
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetFilterManager.java
@@ -0,0 +1,405 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Tensilica Inc 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abeer Bagul (Tensilica Inc) - initial API and implementation (Bug 372181)
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.expression.workingset;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
+import org.eclipse.debug.internal.ui.views.expression.ExpressionView;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IPartListener2;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.IWindowListener;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPartReference;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkingSet;
+import org.eclipse.ui.IWorkingSetManager;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.WorkbenchException;
+import org.eclipse.ui.XMLMemento;
+import org.eclipse.ui.progress.WorkbenchJob;
+
+/**
+ * Manages expression working set filters for all expression views in the workbench.
+ * <p>
+ * It saves info about which working sets are applied to each expression view,
+ * and restores the info and filter when an expression view is opened.
+ *
+ * @since 3.9
+ */
+public class ExpressionWorkingSetFilterManager implements IPropertyChangeListener
+{
+
+ private static final String PREF_WORKINGSETS = "expressionWorkingSets"; //$NON-NLS-1$
+ private static final String ELEMENT_WORKINGSETS = "expressionWorkingsets"; //$NON-NLS-1$
+ private static final String ELEMENT_EXPRESSIONVIEW = "expressionView"; //$NON-NLS-1$
+ private static final String ELEMENT_WORKINGSET = "workingSet"; //$NON-NLS-1$
+
+ private static ExpressionWorkingSetFilterManager INSTANCE;
+
+ private static boolean fInitialized = false;
+
+ private ExpressionWorkingSetFilterManager()
+ {
+
+ }
+
+ synchronized public static ExpressionWorkingSetFilterManager getInstance() {
+ if (INSTANCE == null) {
+ INSTANCE = new ExpressionWorkingSetFilterManager();
+ }
+ return INSTANCE;
+ }
+
+ synchronized public void init() {
+ if (fInitialized) return;
+ fInitialized = true;
+
+ initListeners();
+
+ final XMLMemento fworkingSetsMemento = getMemento();
+
+ new WorkbenchJob("Initializing expression view working sets") { //$NON-NLS-1$
+ { setSystem(true); }
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
+ for (int i=0; i<windows.length; i++) {
+ IWorkbenchWindow window = windows[i];
+ IViewReference[] viewRefs = window.getActivePage().getViewReferences();
+ for (int j=0; j<viewRefs.length; j++) {
+ IViewReference viewRef = viewRefs[j];
+ try {
+ if (IDebugUIConstants.ID_EXPRESSION_VIEW.equals(viewRef.getId()))
+ {
+ IViewPart expressionView = viewRef.getView(false);
+ if (expressionView != null)
+ applyFilter(expressionView, fworkingSetsMemento);
+ }
+ }
+ finally {
+
+ }
+ }
+ }
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+
+ private void applyFilter(IViewPart expressionView, XMLMemento workingSetsMemento)
+ {
+ String mementoID = expressionView.getViewSite().getId() +
+ expressionView.getViewSite().getSecondaryId();
+
+ List workingSets = new ArrayList();
+
+ if (workingSetsMemento != null)
+ {
+ IMemento[] viewMementos = workingSetsMemento.getChildren(ELEMENT_EXPRESSIONVIEW);
+ for (int i=0; i<viewMementos.length; i++) {
+ IMemento viewMemento = viewMementos[i];
+ if (mementoID.equals(viewMemento.getID())) {
+ IMemento[] workingsetMementos = viewMemento.getChildren(ELEMENT_WORKINGSET);
+ for (int j=0; j<workingsetMementos.length; j++) {
+ IMemento workingSetMemento = workingsetMementos[j];
+ String workingSetName = workingSetMemento.getID();
+ IWorkingSet workingSet = PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(workingSetName);
+ if (workingSet != null)
+ workingSets.add(workingSet);
+ }
+
+ break;
+ }
+ }
+ }
+
+ applyWorkingSets((ExpressionView) expressionView, (IWorkingSet[]) workingSets.toArray(new IWorkingSet[0]));
+ }
+
+ private void initListeners() {
+ IWorkbench wb = PlatformUI.getWorkbench();
+
+ final IPartListener2 partListener = new IPartListener2() {
+
+ public void partVisible(IWorkbenchPartReference partRef) {}
+
+ public void partInputChanged(IWorkbenchPartReference partRef) {}
+
+ public void partHidden(IWorkbenchPartReference partRef) {}
+
+ public void partDeactivated(IWorkbenchPartReference partRef) {}
+
+ public void partBroughtToTop(IWorkbenchPartReference partRef) {}
+
+ public void partActivated(IWorkbenchPartReference partRef) {}
+
+ public void partOpened(IWorkbenchPartReference partRef) {
+ if (partRef instanceof IViewReference) {
+ if (! partRef.getId().equals(IDebugUIConstants.ID_EXPRESSION_VIEW))
+ return;
+ IViewPart part = ((IViewReference) partRef).getView(false);
+ if (part != null)
+ {
+ applyFilter(part, getMemento());
+ }
+ }
+ }
+
+ public void partClosed(IWorkbenchPartReference partRef) {}
+ };
+ // subscribe to existing workbench window listener
+ IWorkbenchWindow[] windows = wb.getWorkbenchWindows();
+ for (int i=0; i<windows.length; i++) {
+ IWorkbenchWindow ww = windows[i];
+ ww.getPartService().addPartListener(partListener);
+ }
+
+ // subscribe to new workbench window listener
+ wb.addWindowListener(new IWindowListener() {
+
+ public void windowDeactivated(IWorkbenchWindow window) {}
+
+ public void windowActivated(IWorkbenchWindow window) {}
+
+ public void windowClosed(IWorkbenchWindow window) {}
+
+ public void windowOpened(IWorkbenchWindow window) {
+ window.getPartService().addPartListener(partListener);
+ }
+ });
+
+ PlatformUI.getWorkbench().getWorkingSetManager().addPropertyChangeListener(this);
+ }
+
+ private static XMLMemento getMemento()
+ {
+ IPreferenceStore prefStore = DebugUIPlugin.getDefault().getPreferenceStore();
+ String workingSetsMementoRaw = prefStore.getString(PREF_WORKINGSETS);
+ workingSetsMementoRaw = workingSetsMementoRaw.trim();
+ if (workingSetsMementoRaw.length() == 0)
+ return null;
+ XMLMemento workingSetsMemento = null;
+ try {
+ workingSetsMemento = XMLMemento.createReadRoot(new StringReader(workingSetsMementoRaw));
+ } catch (WorkbenchException e) {
+ DebugUIPlugin.log(e);
+ }
+ return workingSetsMemento;
+ }
+
+ public static void applyWorkingSets(ExpressionView exprView, IWorkingSet[] selectedWorkingSets)
+ {
+ ExpressionWorkingSetFilter workingSetFilter = getFilter(exprView);
+
+ workingSetFilter.setSelectedWorkingSets(selectedWorkingSets);
+
+ exprView.getViewer().refresh();
+
+ saveWorkingSets(exprView, selectedWorkingSets);
+ }
+
+ private static ExpressionWorkingSetFilter getFilter(ExpressionView exprView)
+ {
+ ExpressionWorkingSetFilter workingSetFilter = null;
+
+ ViewerFilter[] existingFilters = ((TreeModelViewer) exprView.getViewer()).getFilters();
+ for (int i=0; i<existingFilters.length; i++) {
+ ViewerFilter existingFilter = existingFilters[i];
+ if (existingFilter instanceof ExpressionWorkingSetFilter)
+ {
+ workingSetFilter = (ExpressionWorkingSetFilter) existingFilter;
+ break;
+ }
+ }
+
+ if (workingSetFilter == null)
+ {
+ workingSetFilter = new ExpressionWorkingSetFilter();
+ ((TreeModelViewer) exprView.getViewer()).addFilter(workingSetFilter);
+ }
+
+ return workingSetFilter;
+ }
+
+ private static ExpressionView[] getExpressionViews()
+ {
+ List expressionViews = new ArrayList();
+
+ IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
+ for (int i=0; i<windows.length; i++) {
+ IWorkbenchWindow window = windows[i];
+ IViewReference[] viewRefs = window.getActivePage().getViewReferences();
+ for (int j=0; j<viewRefs.length; j++) {
+ IViewReference viewRef = viewRefs[j];
+ if (IDebugUIConstants.ID_EXPRESSION_VIEW.equals(viewRef.getId())) {
+ IViewPart expressionView = viewRef.getView(false);
+ if (expressionView != null)
+ expressionViews.add(expressionView);
+ }
+ }
+ }
+
+ return (ExpressionView[]) expressionViews.toArray(new ExpressionView[0]);
+ }
+
+ public static IWorkingSet[] getWorkingSets(ExpressionView exprView)
+ {
+ ExpressionWorkingSetFilter workingSetFilter = getFilter(exprView);
+ if (workingSetFilter == null)
+ return null;
+
+ return workingSetFilter.getSelectedWorkingSets();
+ }
+
+ private static void saveWorkingSets(ExpressionView exprView, IWorkingSet[] selectedWorkingSets)
+ {
+ String mementoID = exprView.getViewSite().getId() +
+ exprView.getViewSite().getSecondaryId();
+
+ XMLMemento rootMemento = XMLMemento.createWriteRoot(ELEMENT_WORKINGSETS);
+
+ XMLMemento savedMemento = getMemento();
+
+ if (savedMemento != null) {
+ IMemento[] viewMementos = savedMemento.getChildren(ELEMENT_EXPRESSIONVIEW);
+ for (int i=0; i<viewMementos.length; i++) {
+ IMemento savedViewMemento = viewMementos[i];
+ if (!mementoID.equals(savedViewMemento.getID()))
+ {
+ IMemento newViewMemento = rootMemento.createChild(ELEMENT_EXPRESSIONVIEW, savedViewMemento.getID());
+
+ IMemento[] savedWorkingSetMementos = savedViewMemento.getChildren(ELEMENT_WORKINGSET);
+ for (int j=0; j<savedWorkingSetMementos.length; j++) {
+ IMemento savedWorkingSetMemento = savedWorkingSetMementos[j];
+ newViewMemento.createChild(ELEMENT_WORKINGSET, savedWorkingSetMemento.getID());
+ }
+ }
+ }
+ }
+
+ IMemento viewMemento = rootMemento.createChild(ELEMENT_EXPRESSIONVIEW, mementoID);
+
+ for (int i=0; i<selectedWorkingSets.length; i++) {
+ IWorkingSet workingSet = selectedWorkingSets[i];
+ viewMemento.createChild(ELEMENT_WORKINGSET, workingSet.getName());
+ }
+
+ ByteArrayOutputStream mementoOutputStream = new ByteArrayOutputStream();
+ try {
+ rootMemento.save(new OutputStreamWriter(mementoOutputStream));
+ } catch (IOException e) {
+ DebugUIPlugin.log(e);
+ }
+
+ String workingSetsMementoRaw = mementoOutputStream.toString();
+
+ IPreferenceStore prefStore = DebugUIPlugin.getDefault().getPreferenceStore();
+ prefStore.setValue(PREF_WORKINGSETS, workingSetsMementoRaw);
+ }
+
+// private static IWorkingSet[] getExpressionWorkingSets()
+// {
+// List expressionWorkingSets = new ArrayList();
+//
+// IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
+// IWorkingSet[] workingSets = workingSetManager.getWorkingSets();
+// for (int i=0; i<workingSets.length; i++) {
+// IWorkingSet workingSet = workingSets[i];
+// if (workingSet.getId().equals(IExpressionWorkingSetConstants.EXPRESSION_WORKINGSET_ID))
+// {
+// expressionWorkingSets.add(workingSet);
+// }
+// }
+//
+// return (IWorkingSet[]) expressionWorkingSets.toArray(new IWorkingSet[0]);
+// }
+
+ public void propertyChange(PropertyChangeEvent event) {
+ if (IWorkingSetManager.CHANGE_WORKING_SET_REMOVE.equals(event.getProperty()))
+ {
+ IWorkingSet removedWorkingSet = (IWorkingSet) event.getOldValue();
+
+ ExpressionView[] views = getExpressionViews();
+ for (int i=0; i<views.length; i++) {
+ ExpressionView expressionView = views[i];
+ IWorkingSet[] appliedWorkingSets = getWorkingSets(expressionView);
+ if (appliedWorkingSets == null)
+ continue;
+ if (appliedWorkingSets.length == 0)
+ continue;
+
+ List remainingWorkingSets = new ArrayList();
+
+ boolean isRemoved = false;
+ for (int j=0; j<appliedWorkingSets.length; j++) {
+ IWorkingSet appliedWorkingSet = appliedWorkingSets[j];
+ if (removedWorkingSet.getName().equals(appliedWorkingSet.getName()))
+ {
+ isRemoved = true;
+ continue;
+ }
+ remainingWorkingSets.add(appliedWorkingSet);
+ }
+
+ if (isRemoved)
+ applyWorkingSets(expressionView, (IWorkingSet[]) remainingWorkingSets.toArray(new IWorkingSet[0]));
+ }
+ }
+ else if (IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE.equals(event.getProperty()))
+ {
+ IWorkingSet changedWorkingSet = (IWorkingSet) event.getNewValue();
+
+ ExpressionView[] views = getExpressionViews();
+ for (int i=0; i<views.length; i++) {
+ ExpressionView expressionView = views[i];
+ IWorkingSet[] appliedWorkingSets = getWorkingSets(expressionView);
+ if (appliedWorkingSets == null)
+ continue;
+ if (appliedWorkingSets.length == 0)
+ continue;
+
+ List remainingWorkingSets = new ArrayList();
+
+ boolean isChanged = false;
+ for (int j=0; j<appliedWorkingSets.length; j++) {
+ IWorkingSet appliedWorkingSet = appliedWorkingSets[j];
+ if (changedWorkingSet.getName().equals(appliedWorkingSet.getName()))
+ {
+ isChanged = true;
+ }
+ remainingWorkingSets.add(appliedWorkingSet);
+ }
+
+ if (isChanged)
+ applyWorkingSets(expressionView, (IWorkingSet[]) remainingWorkingSets.toArray(new IWorkingSet[0]));
+ }
+ }
+
+ }
+
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionWorkingSetMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetMessages.java
index 93eceae57..efd40b135 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionWorkingSetMessages.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetMessages.java
@@ -8,7 +8,7 @@
* Contributors:
* Abeer Bagul (Tensilica Inc) - initial API and implementation (Bug 372181)
*******************************************************************************/
-package org.eclipse.debug.internal.ui.views.expression;
+package org.eclipse.debug.internal.ui.expression.workingset;
import org.eclipse.osgi.util.NLS;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionWorkingSetMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetMessages.properties
index c721e6cb2..c721e6cb2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionWorkingSetMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetMessages.properties
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionWorkingSetPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetPage.java
index 1834fcd84..c7cfc9a95 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionWorkingSetPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetPage.java
@@ -8,7 +8,7 @@
* Contributors:
* Abeer Bagul (Tensilica Inc) - initial API and implementation (Bug 372181)
*******************************************************************************/
-package org.eclipse.debug.internal.ui.views.expression;
+package org.eclipse.debug.internal.ui.expression.workingset;
import java.util.ArrayList;
import java.util.Iterator;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ExpressionWorkingSetsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetsAction.java
index 3b91e5a40..646ffd733 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ExpressionWorkingSetsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/ExpressionWorkingSetsAction.java
@@ -8,10 +8,9 @@
* Contributors:
* Abeer Bagul (Tensilica Inc) - initial API and implementation (Bug 372181)
*******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.expressions;
+package org.eclipse.debug.internal.ui.expression.workingset;
import org.eclipse.debug.internal.ui.views.expression.ExpressionView;
-import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.window.Window;
@@ -25,7 +24,6 @@ import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog;
/**
* Opens the Working set wizard where user can define expression working sets.
- *
* @since 3.9
*/
public class ExpressionWorkingSetsAction implements IViewActionDelegate,
@@ -37,9 +35,9 @@ public class ExpressionWorkingSetsAction implements IViewActionDelegate,
IWorkingSetSelectionDialog selectionDialog = PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetSelectionDialog(
PlatformUI.getWorkbench().getDisplay().getActiveShell(),
true,
- new String[] {IDebugUIConstants.EXPRESSION_WORKINGSET_ID});
+ new String[] {IExpressionWorkingSetConstants.EXPRESSION_WORKINGSET_ID});
- selectionDialog.setSelection(fView.getWorkingSets());
+ selectionDialog.setSelection(ExpressionWorkingSetFilterManager.getWorkingSets(fView));
if (selectionDialog.open() != Window.OK)
return;
@@ -47,7 +45,8 @@ public class ExpressionWorkingSetsAction implements IViewActionDelegate,
IWorkingSet[] selectedWorkingSets = selectionDialog.getSelection();
if (selectedWorkingSets == null)
return;
- fView.applyWorkingSets(selectedWorkingSets);
+
+ ExpressionWorkingSetFilterManager.applyWorkingSets(fView, selectedWorkingSets);
}
public void selectionChanged(IAction action, ISelection selection) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/IExpressionWorkingSetConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/IExpressionWorkingSetConstants.java
new file mode 100644
index 000000000..b1146d8bc
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/expression/workingset/IExpressionWorkingSetConstants.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Tensilica Inc 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abeer Bagul (Tensilica Inc) - initial API and implementation (Bug 372181)
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.expression.workingset;
+
+/**
+ * @since 3.9
+ */
+public interface IExpressionWorkingSetConstants
+{
+ /**
+ * Identifier for expression working set type.
+ * <br>
+ * Value is: <code>org.eclipse.cdt.dsf.ui.expressionWorkingSet</code>
+ *
+ */
+ public static final String EXPRESSION_WORKINGSET_ID = "org.eclipse.debug.ui.expressionWorkingSet"; //$NON-NLS-1$
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerContentProvider.java
index 4ab234688..227b6fefa 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerContentProvider.java
@@ -23,11 +23,13 @@ import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
import org.eclipse.debug.internal.ui.DebugUIMessages;
import org.eclipse.debug.internal.ui.DefaultLabelProvider;
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.debug.internal.ui.expression.workingset.ExpressionWorkingSetFilterManager;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementEditor;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
+import org.eclipse.debug.internal.ui.views.expression.ExpressionView;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jface.resource.JFaceResources;
@@ -37,6 +39,7 @@ import org.eclipse.jface.viewers.TextCellEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.PlatformUI;
@@ -51,11 +54,33 @@ public class ExpressionManagerContentProvider extends ElementContentProvider {
*
* @since 3.6
*/
- private static class AddNewExpressionElement implements IElementLabelProvider, IElementEditor, IAddNewExpression {
+ private static class AddNewExpressionElement implements IElementLabelProvider, IElementEditor, ICellModifier, IAddNewExpression {
+ /* Record the working sets applied to this view (none if null).
+ * When a new expression is created, add it to applied working sets.
+ */
+ private String[] workingSetNames = null;
+
public void update(ILabelUpdate[] updates) {
+ workingSetNames = null;
+
for (int i = 0; i < updates.length; i++) {
+
+ if (i == 0)
+ {
+ //from the presentation context, find out the list of
+ //working sets applied to this view.
+ IWorkbenchPart expressionView = updates[i].getPresentationContext().getPart();
+ IWorkingSet[] workingSets = ExpressionWorkingSetFilterManager.getWorkingSets((ExpressionView) expressionView);
+ if (workingSets.length > 0)
+ workingSetNames = new String[workingSets.length];
+ for (int j=0; j<workingSets.length; j++)
+ {
+ workingSetNames[j] = workingSets[j].getName();
+ }
+ }
+
String[] columnIds = updates[i].getColumnIds();
if (columnIds == null) {
updateLabel(updates[i], 0);
@@ -89,17 +114,9 @@ public class ExpressionManagerContentProvider extends ElementContentProvider {
}
public ICellModifier getCellModifier(IPresentationContext context, Object element) {
- return new AddNewExpressionCellModifider(context);
- }
- }
-
- private static class AddNewExpressionCellModifider implements ICellModifier {
-
- private final IPresentationContext fPresentationContext;
-
- AddNewExpressionCellModifider(IPresentationContext presentationContext) {
- fPresentationContext = presentationContext;
- }
+ return this;
+ }
+
public boolean canModify(Object element, String property) {
return (IDebugUIConstants.COLUMN_ID_VARIABLE_NAME.equals(property));
}
@@ -123,10 +140,8 @@ public class ExpressionManagerContentProvider extends ElementContentProvider {
//if any working sets are applied to this view,
//add this expression to all applied working sets,
//otherwise it will be filtered out from the view.
- Object workingSetsProp = fPresentationContext.getProperty(IDebugUIConstants.PROP_EXPRESSIONS_WORKING_SETS);
- if (workingSetsProp instanceof String[])
+ if (workingSetNames != null)
{
- String[] workingSetNames = (String[])workingSetsProp;
for (int i=0; i<workingSetNames.length; i++)
{
String workingSetName = workingSetNames[i];
@@ -140,7 +155,7 @@ public class ExpressionManagerContentProvider extends ElementContentProvider {
}
}
}
-
+
private IDebugElement getContext() {
IAdaptable object = DebugUITools.getDebugContext();
IDebugElement context = null;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/IAddNewExpression.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/IAddNewExpression.java
new file mode 100644
index 000000000..77aeebda3
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/IAddNewExpression.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Tensilica Inc 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abeer Bagul (Tensilica Inc) - initial API and implementation (Bug 372181)
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.model.elements;
+
+/**
+ * A marker interface to be implemented by objects which represent the "Add new expression" node in Expressions view.
+ * An object which implements this interface will always be visible in the view,
+ * even if user has selected working sets to filter expressions visible in the view.
+ */
+public interface IAddNewExpression {
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
index 8a9cbc0c3..54f3d965d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
@@ -13,9 +13,6 @@
package org.eclipse.debug.internal.ui.views.expression;
-import java.util.ArrayList;
-import java.util.List;
-
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.debug.core.DebugPlugin;
@@ -23,14 +20,11 @@ import org.eclipse.debug.core.IExpressionManager;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.model.IDebugElement;
import org.eclipse.debug.core.model.IWatchExpression;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.actions.expressions.EditWatchExpressinInPlaceAction;
import org.eclipse.debug.internal.ui.actions.expressions.PasteWatchExpressionsAction;
import org.eclipse.debug.internal.ui.actions.variables.ChangeVariableValueAction;
import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
import org.eclipse.debug.internal.ui.views.variables.AvailableLogicalStructuresAction;
@@ -47,19 +41,14 @@ import org.eclipse.jface.action.Separator;
import org.eclipse.jface.util.LocalSelectionTransfer;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IMemento;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchCommandConstants;
-import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionFactory;
@@ -69,18 +58,9 @@ import org.eclipse.ui.actions.ActionFactory;
*/
public class ExpressionView extends VariablesView {
- /**
- * the preference name for the view part of the sash form
- * @since 3.9
- */
- private static final String PREF_ELEMENT_WORKINGSET = DebugUIPlugin.getUniqueIdentifier() + ".workingSet"; //$NON-NLS-1$
-
-
private PasteWatchExpressionsAction fPasteAction;
private EditWatchExpressinInPlaceAction fEditInPlaceAction;
- private IWorkingSet[] fWorkingSets;
-
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getHelpContextId()
*/
@@ -273,70 +253,5 @@ public class ExpressionView extends VariablesView {
}
}
- public Viewer createViewer(Composite parent) {
- TreeModelViewer viewer = (TreeModelViewer)super.createViewer(parent);
-
- List list = new ArrayList();
- IMemento[] workingsetMementos = getMemento().getChildren(PREF_ELEMENT_WORKINGSET);
- for (int j=0; j<workingsetMementos.length; j++) {
- IMemento workingSetMemento = workingsetMementos[j];
- String workingSetName = workingSetMemento.getID();
- IWorkingSet workingSet = PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(workingSetName);
- if (workingSet != null)
- list.add(workingSet);
- }
- fWorkingSets = (IWorkingSet[]) list.toArray(new IWorkingSet[list.size()]);
- getWorkingSetFilter(viewer).setSelectedWorkingSets(fWorkingSets);
- updateWorkingSetsProperty(viewer.getPresentationContext());
-
- return viewer;
- }
-
- public void saveViewerState(IMemento memento) {
- super.saveViewerState(memento);
-
-
- for (int i=0; i<fWorkingSets.length; i++) {
- memento.createChild(PREF_ELEMENT_WORKINGSET, fWorkingSets[i].getName());
- }
- }
-
- public void applyWorkingSets(IWorkingSet[] selectedWorkingSets) {
- fWorkingSets = selectedWorkingSets;
- TreeModelViewer viewer = (TreeModelViewer)getViewer();
- getWorkingSetFilter(viewer).setSelectedWorkingSets(fWorkingSets);
- updateWorkingSetsProperty(viewer.getPresentationContext());
- getViewer().refresh();
- }
-
- private void updateWorkingSetsProperty(IPresentationContext presentationContext) {
- if (fWorkingSets.length > 0) {
- String[] workingSetNames = new String[fWorkingSets.length];
- for (int j=0; j<fWorkingSets.length; j++) {
- workingSetNames[j] = fWorkingSets[j].getName();
- }
- presentationContext.setProperty(IDebugUIConstants.PROP_EXPRESSIONS_WORKING_SETS, workingSetNames);
- } else {
- presentationContext.setProperty(IDebugUIConstants.PROP_EXPRESSIONS_WORKING_SETS, new String[0]);
- }
- }
- public IWorkingSet[] getWorkingSets() {
- return fWorkingSets;
- }
-
- private ExpressionWorkingSetFilter getWorkingSetFilter(ITreeModelViewer viewer) {
- ViewerFilter[] existingFilters = viewer.getFilters();
- for (int i=0; i<existingFilters.length; i++) {
- ViewerFilter existingFilter = existingFilters[i];
- if (existingFilter instanceof ExpressionWorkingSetFilter) {
- return (ExpressionWorkingSetFilter) existingFilter;
- }
- }
-
- ExpressionWorkingSetFilter workingSetFilter = new ExpressionWorkingSetFilter();
- viewer.addFilter(workingSetFilter);
- return workingSetFilter;
- }
-
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java
index d9d8c7de9..29c6d6202 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java
@@ -270,7 +270,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
*/
public void createControl(Composite parent) {
Viewer viewer = createViewer(parent);
- setViewer(viewer);
+ setViewer(viewer);
}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
index 0605fb950..bc849b74d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
@@ -1153,16 +1153,6 @@ public interface IDebugUIConstants {
public static final String BREAKPOINT_WORKINGSET_ID = "org.eclipse.debug.ui.breakpointWorkingSet"; //$NON-NLS-1$
/**
- * Identifier for expression working set type.
- * <br>
- * Value is: <code>org.eclipse.debug.ui.expressionWorkingSet</code>
- *
- * @since 3.9
- */
- public static final String EXPRESSION_WORKINGSET_ID = "org.eclipse.debug.ui.expressionWorkingSet"; //$NON-NLS-1$
-
-
- /**
* Memory view identifier (value <code>"org.eclipse.debug.ui.MemoryView"</code>).
*
* @since 3.2
@@ -1334,12 +1324,4 @@ public interface IDebugUIConstants {
* @since 3.8
*/
public final static String COLUMN_ID_VARIABLE_VALUE_TYPE = COLUMN_PRESENTATION_ID_VARIABLE + ".COL_VALUE_TYPE"; //$NON-NLS-1$
-
- /**
- * Expression view property used to store the currently selected working
- * set names. The working set names are stored as a <code>String[]</code>.
- *
- * @since 3.9
- */
- public final static String PROP_EXPRESSIONS_WORKING_SETS = IDebugUIConstants.PLUGIN_ID + ".PROP_EXPRESSION_WORKING_SETS"; //$NON-NLS-1$
}

Back to the top