1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

- removed hack with ".valueLabel" for label provided field editors

This commit is contained in:
Alena Laskavaia 2008-04-28 21:54:01 +00:00
parent f493c4a10f
commit 0ad8a0893e
2 changed files with 14 additions and 3 deletions

View file

@ -19,7 +19,7 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin; 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.jface.preference.FieldEditor;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
@ -51,13 +51,15 @@ class DefaultCBreakpointUIContribution implements ICBreakpointsUIContribution {
public FieldEditor getFieldEditor(String name, String labelText, Composite parent) { public FieldEditor getFieldEditor(String name, String labelText, Composite parent) {
String className = fieldEditorClassName; String className = fieldEditorClassName;
if (fieldEditorClassName == null) { if (fieldEditorClassName == null) {
className = LabelFieldEditor.class.getName(); className = ReadOnlyFieldEditor.class.getName();
name = name+".valuelabel";
} }
try { try {
Class cclass = Class.forName(className); Class cclass = Class.forName(className);
Constructor constructor = cclass.getConstructor(fieldSignature); Constructor constructor = cclass.getConstructor(fieldSignature);
FieldEditor editor = (FieldEditor) constructor.newInstance(name, labelText, parent); FieldEditor editor = (FieldEditor) constructor.newInstance(name, labelText, parent);
if (editor instanceof ICBreakpointsUIContributionUser) {
((ICBreakpointsUIContributionUser)editor).setContribution(this);
}
return editor; return editor;
} catch (Exception e) { } catch (Exception e) {
// cannot happened, would have happened when loading extension // cannot happened, would have happened when loading extension
@ -147,4 +149,8 @@ class DefaultCBreakpointUIContribution implements ICBreakpointsUIContribution {
public String toString() { public String toString() {
return attId + " " + attLabel; return attId + " " + attLabel;
} }
public String getFieldEditorClassName() {
return fieldEditorClassName;
}
} }

View file

@ -41,6 +41,11 @@ public interface ICBreakpointsUIContribution {
*/ */
public FieldEditor getFieldEditor(String name, String labelText, Composite parent); 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 list of possible values that attributes can take, of null of no restrictions
* @return * @return