From 0ad8a0893ee44bd87e11ddb12fbfc6c8078eddcb Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Mon, 28 Apr 2008 21:54:01 +0000 Subject: [PATCH] - removed hack with ".valueLabel" for label provided field editors --- .../DefaultCBreakpointUIContribution.java | 12 +++++++++--- .../ui/breakpoints/ICBreakpointsUIContribution.java | 5 +++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/DefaultCBreakpointUIContribution.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/DefaultCBreakpointUIContribution.java index 20ec477aabb..0929361cd72 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/DefaultCBreakpointUIContribution.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/DefaultCBreakpointUIContribution.java @@ -19,7 +19,7 @@ import java.util.Map; import java.util.Set; import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.cdt.debug.ui.preferences.LabelFieldEditor; +import org.eclipse.cdt.debug.ui.preferences.ReadOnlyFieldEditor; import org.eclipse.jface.preference.FieldEditor; import org.eclipse.swt.widgets.Composite; @@ -51,13 +51,15 @@ class DefaultCBreakpointUIContribution implements ICBreakpointsUIContribution { public FieldEditor getFieldEditor(String name, String labelText, Composite parent) { String className = fieldEditorClassName; if (fieldEditorClassName == null) { - className = LabelFieldEditor.class.getName(); - name = name+".valuelabel"; + className = ReadOnlyFieldEditor.class.getName(); } try { Class cclass = Class.forName(className); Constructor constructor = cclass.getConstructor(fieldSignature); FieldEditor editor = (FieldEditor) constructor.newInstance(name, labelText, parent); + if (editor instanceof ICBreakpointsUIContributionUser) { + ((ICBreakpointsUIContributionUser)editor).setContribution(this); + } return editor; } catch (Exception e) { // cannot happened, would have happened when loading extension @@ -147,4 +149,8 @@ class DefaultCBreakpointUIContribution implements ICBreakpointsUIContribution { public String toString() { return attId + " " + attLabel; } + + public String getFieldEditorClassName() { + return fieldEditorClassName; + } } \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/ICBreakpointsUIContribution.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/ICBreakpointsUIContribution.java index 7d701585708..311b325fe56 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/ICBreakpointsUIContribution.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/ICBreakpointsUIContribution.java @@ -41,6 +41,11 @@ public interface ICBreakpointsUIContribution { */ public FieldEditor getFieldEditor(String name, String labelText, Composite parent); + /** + * Get raw field editor class name + * @return class name + */ + public String getFieldEditorClassName(); /** * Return list of possible values that attributes can take, of null of no restrictions * @return