Class PTChooserEditor
- java.lang.Object
-
- org.eclipse.nebula.widgets.opal.propertytable.editor.PTEditor
-
- org.eclipse.nebula.widgets.opal.propertytable.editor.PTChooserEditor
-
- Direct Known Subclasses:
PTColorEditor
,PTDirectoryEditor
,PTFileEditor
,PTFontEditor
,PTWindowEditor
public abstract class PTChooserEditor extends PTEditor
This abstract class represents a chooser. A chooser is composed of :- a displayed value (text)
- a "X" button to erase the value (set to null)
- a "..." button to open an extra window to set up the value
-
-
Field Summary
Fields Modifier and Type Field Description private org.eclipse.swt.widgets.Item
item
private PTProperty
property
private PTWidget
widget
-
Constructor Summary
Constructors Constructor Description PTChooserEditor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private void
createEraseButton(org.eclipse.swt.widgets.Composite buttonHolder)
Creates the "erase" buttonprivate void
createPlusButton(org.eclipse.swt.widgets.Composite buttonHolder)
Creates the "plus" buttonprotected abstract org.eclipse.swt.graphics.Color
getBackgroundColor(PTProperty property)
Get the background color of an itemprotected abstract java.lang.String
getTextFor(PTProperty property)
protected abstract void
openWindow(PTWidget widget, org.eclipse.swt.widgets.Item item, PTProperty property)
Open the window to edit the propertyorg.eclipse.swt.custom.ControlEditor
render(PTWidget widget, org.eclipse.swt.widgets.Item item, PTProperty property)
Renders an editor
-
-
-
Field Detail
-
widget
private PTWidget widget
-
item
private org.eclipse.swt.widgets.Item item
-
property
private PTProperty property
-
-
Method Detail
-
render
public org.eclipse.swt.custom.ControlEditor render(PTWidget widget, org.eclipse.swt.widgets.Item item, PTProperty property)
Description copied from class:PTEditor
Renders an editor- Specified by:
render
in classPTEditor
- Parameters:
widget
- the parent PTWidget (a table or a tree table)item
- the item on which the editor is displayedproperty
- the property associated to the editor- Returns:
- a control editor
- See Also:
PTEditor.render(org.eclipse.nebula.widgets.opal.propertytable.PTWidget, org.eclipse.swt.widgets.Item, org.eclipse.nebula.widgets.opal.propertytable.PTProperty)
-
createEraseButton
private void createEraseButton(org.eclipse.swt.widgets.Composite buttonHolder)
Creates the "erase" button- Parameters:
buttonHolder
- parent composite
-
createPlusButton
private void createPlusButton(org.eclipse.swt.widgets.Composite buttonHolder)
Creates the "plus" button- Parameters:
buttonHolder
- aprent composite
-
openWindow
protected abstract void openWindow(PTWidget widget, org.eclipse.swt.widgets.Item item, PTProperty property)
Open the window to edit the property- Parameters:
widget
- parent widgetitem
- itemproperty
- edited property
-
getTextFor
protected abstract java.lang.String getTextFor(PTProperty property)
- Parameters:
property
- property- Returns:
- the string representation of the value stored in the property
-
getBackgroundColor
protected abstract org.eclipse.swt.graphics.Color getBackgroundColor(PTProperty property)
Get the background color of an item- Parameters:
property
- property- Returns:
- a background color (for the PTColorEditor) or null (for other editors).
-
-