Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2007-08-20 19:16:31 +0000
committerDarin Wright2007-08-20 19:16:31 +0000
commitb08d953d070810296389c836da67f34841ca40c2 (patch)
tree1c63299a4c270fb8e3e46cff70ec9ab08e8be36c /org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableMementoProvider.java
parent915e49c30214e6279a4a9fb91a7c70f963c6a256 (diff)
downloadeclipse.platform.debug-b08d953d070810296389c836da67f34841ca40c2.tar.gz
eclipse.platform.debug-b08d953d070810296389c836da67f34841ca40c2.tar.xz
eclipse.platform.debug-b08d953d070810296389c836da67f34841ca40c2.zip
Bug 168574 - Support for IElementMementoProvider on each element in a viewer
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableMementoProvider.java')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableMementoProvider.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableMementoProvider.java
new file mode 100644
index 000000000..f64ff8b7a
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableMementoProvider.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.model.elements;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.model.IVariable;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
+
+/**
+ * Memento provider for variables and registers.
+ *
+ * @since 3.4
+ */
+public class VariableMementoProvider extends DebugElementMementoProvider {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.model.elements.DebugElementMementoProvider#getElementName(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
+ */
+ protected String getElementName(Object element, IPresentationContext context) throws CoreException {
+ if (element instanceof IVariable) {
+ return ((IVariable) element).getName();
+ }
+ return null;
+ }
+
+}

Back to the top