mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 06:32:10 +02:00
- removed hack with ".valueLabel" for label provided field editors
This commit is contained in:
parent
f493c4a10f
commit
0ad8a0893e
2 changed files with 14 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue