Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model')
-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
2 files changed, 16 insertions, 51 deletions
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 227b6fefa..4ab234688 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,13 +23,11 @@ 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;
@@ -39,7 +37,6 @@ 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;
@@ -54,33 +51,11 @@ public class ExpressionManagerContentProvider extends ElementContentProvider {
*
* @since 3.6
*/
- private static class AddNewExpressionElement implements IElementLabelProvider, IElementEditor, ICellModifier, IAddNewExpression {
+ private static class AddNewExpressionElement implements IElementLabelProvider, IElementEditor, 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);
@@ -114,9 +89,17 @@ public class ExpressionManagerContentProvider extends ElementContentProvider {
}
public ICellModifier getCellModifier(IPresentationContext context, Object element) {
- return this;
- }
-
+ return new AddNewExpressionCellModifider(context);
+ }
+ }
+
+ private static class AddNewExpressionCellModifider implements ICellModifier {
+
+ private final IPresentationContext fPresentationContext;
+
+ AddNewExpressionCellModifider(IPresentationContext presentationContext) {
+ fPresentationContext = presentationContext;
+ }
public boolean canModify(Object element, String property) {
return (IDebugUIConstants.COLUMN_ID_VARIABLE_NAME.equals(property));
}
@@ -140,8 +123,10 @@ 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.
- if (workingSetNames != null)
+ Object workingSetsProp = fPresentationContext.getProperty(IDebugUIConstants.PROP_EXPRESSIONS_WORKING_SETS);
+ if (workingSetsProp instanceof String[])
{
+ String[] workingSetNames = (String[])workingSetsProp;
for (int i=0; i<workingSetNames.length; i++)
{
String workingSetName = workingSetNames[i];
@@ -155,7 +140,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
deleted file mode 100644
index 77aeebda3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/IAddNewExpression.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * 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 {
-
-}

Back to the top