Package com.iizigo.prop.editor
Class BoolPropEditor
- All Implemented Interfaces:
IThemeListener
,IEditedPropControllerOwner<BoolProp,
,Boolean> IEditedPropertyEntry<BoolProp,
,Boolean> IEditedPropertyEntryMultiProp<BoolProp,
,Boolean> IPropertyDefined
,EventListener
,org.eclipse.swt.events.SelectionListener
,org.eclipse.swt.internal.SWTEventListener
- Direct Known Subclasses:
ContentProviderPropEditor
,NullValueAllowedPropEditor
public class BoolPropEditor extends BaseEditor<BoolProp,Boolean> implements org.eclipse.swt.events.SelectionListener
The boolean property editor consists of a simple check box.
- Author:
- Christopher Mindus
Field Summary
Modifier and TypeFieldDescriptionprotected org.eclipse.swt.widgets.Button
The button.protected boolean
The default value.Fields inherited from class com.iizigo.prop.BaseEditor
appUI, combo, control, controller, definedButton, display, editor, focusListener, hasBeenModified, info, more, multipleValueWarningInput, options, parent, propController, shell, text, validator, wasDefinedAtFocusGained
Constructor Summary
Method Summary
Modifier and TypeMethodDescriptionprotected void
create()
Creates the property editor controls.formatValue
(Boolean value) Formats the value for user input as a String.Gets the default defined value to set in the property when defined.protected String
Gets the tooltip text to display in the entry fields (not the one for property errors or validator).protected Boolean
Gets the property value for a user input.void
onError
(String input, String message, int severity, boolean isMultipleValueWarning, boolean isChildError) Called when the property is updated due to an error.void
Called when the property is undefined.void
Called when the property is updated without errors, with a new value.protected void
setColors
(org.eclipse.swt.widgets.Control... additional) Adds label to color.void
widgetDefaultSelected
(org.eclipse.swt.events.SelectionEvent e) Not processed.void
widgetSelected
(org.eclipse.swt.events.SelectionEvent e) Checkbox pressed.Methods inherited from class com.iizigo.prop.BaseEditor
assignMaster, beginProcessEvent, canProcessEvents, checkInput, createCCombo, createControls, createGridLayout, createIzMenu, createMoreButton, createMoreIzMenu, createText, dispose, doUndefineIfEmpty, doValueChangeConversion, endProcessEvent, getBaseEditor, getCurrentInput, getCurrentValue, getCurrentValues, getModifyListener, getNativeToolTip, getOption, getSelectionListener, getSeverity, getShell, getToolTipText2, hasFocus, initialize, isPropReadOnly, onDefine, onDispose, onDoubleClick, onF4List, onFocusGained, onFocusLost, onMore, onReadOnly, onThemeChanged, setCurrentValue, setEditable, setFocus, setInput, setInputValue, setInputValueFromProp, setToolTipText, showMenu, updateTooltip, validate
Field Details
defaultValue
protected boolean defaultValueThe default value.button
protected org.eclipse.swt.widgets.Button buttonThe button.
Constructor Details
BoolPropEditor
public BoolPropEditor()Default constructor called before createControls.
Method Details
create
protected void create()Creates the property editor controls.- Specified by:
create
in classBaseEditor<BoolProp,
Boolean>
getToolTipText
Gets the tooltip text to display in the entry fields (not the one for property errors or validator).- Specified by:
getToolTipText
in classBaseEditor<BoolProp,
Boolean>
getDefaultValue
Gets the default defined value to set in the property when defined.- Specified by:
getDefaultValue
in interfaceIEditedPropControllerOwner<BoolProp,
Boolean> - Specified by:
getDefaultValue
in classBaseEditor<BoolProp,
Boolean>
getValue
Gets the property value for a user input.- Specified by:
getValue
in classBaseEditor<BoolProp,
Boolean> - Parameters:
input
- The current user input.- Returns:
- The property value for the input, or null to un-define the property.
- Throws:
Exception
- For validation errors.
formatValue
Formats the value for user input as a String.- Specified by:
formatValue
in interfaceIEditedPropControllerOwner<BoolProp,
Boolean> - Specified by:
formatValue
in classBaseEditor<BoolProp,
Boolean> - Parameters:
value
- The value.- Returns:
- The formatted value.
onUpdate
Called when the property is updated without errors, with a new value.- Specified by:
onUpdate
in interfaceIEditedPropControllerOwner<BoolProp,
Boolean> - Overrides:
onUpdate
in classBaseEditor<BoolProp,
Boolean>
onError
public void onError(String input, String message, int severity, boolean isMultipleValueWarning, boolean isChildError) Called when the property is updated due to an error.- Specified by:
onError
in interfaceIEditedPropControllerOwner<BoolProp,
Boolean> - Overrides:
onError
in classBaseEditor<BoolProp,
Boolean>
onUndefined
public void onUndefined()Called when the property is undefined.- Specified by:
onUndefined
in interfaceIEditedPropControllerOwner<BoolProp,
Boolean> - Overrides:
onUndefined
in classBaseEditor<BoolProp,
Boolean>
widgetSelected
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) Checkbox pressed.- Specified by:
widgetSelected
in interfaceorg.eclipse.swt.events.SelectionListener
widgetDefaultSelected
public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) Not processed.- Specified by:
widgetDefaultSelected
in interfaceorg.eclipse.swt.events.SelectionListener
setColors
protected void setColors(org.eclipse.swt.widgets.Control... additional) Adds label to color.- Overrides:
setColors
in classBaseEditor<BoolProp,
Boolean>