Package org.adempiere.webui.editor
Class WColorEditor
java.lang.Object
org.adempiere.webui.editor.WEditor
org.adempiere.webui.editor.WColorEditor
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,IInputValidator
,ContextMenuListener
,org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
Default editor for
Implemented with
DisplayType.Color
.Implemented with
EditorBox
component and HTML color type (<input type="color">).- Author:
- Nicolas Micoud (TGI)
-
Nested Class Summary
Nested classes/interfaces inherited from class org.adempiere.webui.editor.WEditor
WEditor.DynamicDisplayListener
-
Field Summary
Fields inherited from class org.adempiere.webui.editor.WEditor
component, gridField, gridTab, IDEMPIERE_EDITOR_ATTR, INIT_EDIT_EVENT, label, listeners, mandatory, MAX_DISPLAY_LENGTH, popupMenu, readOnly, tableEditor
-
Constructor Summary
ConstructorDescriptionWColorEditor
(GridField gridField) WColorEditor
(GridField gridField, boolean tableEditor, IEditorConfiguration editorConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addColorEditorMenu
(WEditorPopupMenu popupMenu) Add entries to popup context menuprotected String
getBackgroundFillStyle
(String color) org.zkoss.zk.ui.Component
Return component use for display mode inADTabpanel
grid view (GridTabRowRenderer
) or custom editor ofWListItemRenderer
.
ForGridTabRowRenderer
, onlyHtml
is supported and will use content fromWEditor.getDisplayTextForGridView(GridRowCtx, Object)
.
ForWListItemRenderer
,Html
,Label
andInputElement
is supported.
Return null to use the default ofADTabpanel
orWListbox
.
Note: because each row must has one instance of this component, don't reuse, must always create new instance.getDisplayTextForGridView
(GridRowCtx gridRowCtx, Object value) String[]
getValue()
boolean
void
onEvent
(org.zkoss.zk.ui.event.Event event) void
onMenu
(ContextMenuEvent evt) void
Open HTML native color pickerprotected void
processNewValue
(String newValue) Process newValue from color pickervoid
setReadWrite
(boolean readWrite) void
setTableEditor
(boolean b) Set grid view mode.void
Set editor valueMethods inherited from class org.adempiere.webui.editor.WEditor
addChangeLogMenu, addDynamicDisplayListener, addTextEditorMenu, addValueChangeListener, applyFieldStyles, applyLabelStyles, buildStyle, cleanColumnName, dynamicDisplay, dynamicDisplay, fillHorizontal, fireValueChange, focusNext, getColumnName, getDescription, getDisplayTextForGridView, getGridField, getLabel, getPopupMenu, getStyleEvaluatee, getValidInput, isComponentOfEditor, isMandatory, isMandatoryStyle, isNullOrEmpty, isProcessParameter, isSearchable, isShowPreference, isValid, isVisible, isZoomable, propertyChange, removeDynamicDisplayListener, removeValuechangeListener, setBackground, setBackground, setChangeEventWhenEditing, setColumnName, setComponent, setFieldStyle, setGridTab, setLabelStyle, setMandatory, setProcessParameter, setValidInput, setVisible, setVisible, showMenu, toString, updateLabelStyle, updateStyle, updateStyle
-
Field Details
-
COLOR_PICKER_EVENT
- See Also:
-
-
Constructor Details
-
WColorEditor
- Parameters:
gridField
-
-
WColorEditor
public WColorEditor(GridField gridField, boolean tableEditor, IEditorConfiguration editorConfiguration) - Parameters:
gridField
-tableEditor
-editorConfiguration
-
-
-
Method Details
-
addColorEditorMenu
Add entries to popup context menu- Parameters:
popupMenu
-
-
onMenu
- Specified by:
onMenu
in interfaceContextMenuListener
-
getComponent
- Overrides:
getComponent
in classWEditor
- Returns:
- Component
-
setValue
Description copied from class:WEditor
Set editor value -
getBackgroundFillStyle
- Parameters:
color
- hex coded color string- Returns:
- background fill style
-
getValue
-
getDisplay
- Specified by:
getDisplay
in classWEditor
- Returns:
- display text
-
isReadWrite
public boolean isReadWrite()- Specified by:
isReadWrite
in classWEditor
- Returns:
- true if editable
-
setReadWrite
public void setReadWrite(boolean readWrite) - Specified by:
setReadWrite
in classWEditor
-
onEvent
public void onEvent(org.zkoss.zk.ui.event.Event event) - Specified by:
onEvent
in interfaceorg.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
-
openColorPicker
public void openColorPicker()Open HTML native color picker -
processNewValue
Process newValue from color picker- Parameters:
newValue
-
-
getEvents
- Overrides:
getEvents
in classWEditor
- Returns:
- list of
WEditor.component
events that this editor will listen to
-
setTableEditor
public void setTableEditor(boolean b) Description copied from class:WEditor
Set grid view mode. Have no effect if editor doesn't has a separate grid view mode.- Overrides:
setTableEditor
in classWEditor
-
getDisplayTextForGridView
- Overrides:
getDisplayTextForGridView
in classWEditor
- Parameters:
gridRowCtx
-GridRowCtx
- Returns:
- display text for grid view, for consumption by
WEditor.getDisplayComponent()
-
getDisplayComponent
public org.zkoss.zk.ui.Component getDisplayComponent()Description copied from class:WEditor
Return component use for display mode inADTabpanel
grid view (GridTabRowRenderer
) or custom editor ofWListItemRenderer
.
ForGridTabRowRenderer
, onlyHtml
is supported and will use content fromWEditor.getDisplayTextForGridView(GridRowCtx, Object)
.
ForWListItemRenderer
,Html
,Label
andInputElement
is supported.
Return null to use the default ofADTabpanel
orWListbox
.
Note: because each row must has one instance of this component, don't reuse, must always create new instance.- Overrides:
getDisplayComponent
in classWEditor
- Returns:
- Display
Component
-