Class WEditor

    • Constructor Detail

      • WEditor

        public WEditor​(org.zkoss.zk.ui.Component comp,
                       GridField gridField)
        Parameters:
        comp -
        gridField -
      • WEditor

        public WEditor​(org.zkoss.zk.ui.Component comp,
                       GridField gridField,
                       boolean tableEditor,
                       IEditorConfiguration editorConfiguration)
        Parameters:
        comp -
        gridField -
        tableEditor -
        editorConfiguration -
      • WEditor

        public WEditor​(org.zkoss.zk.ui.Component comp,
                       GridField gridField,
                       int rowIndex)
        Parameters:
        comp -
        gridField -
        rowIndex -
      • WEditor

        public WEditor​(org.zkoss.zk.ui.Component comp,
                       GridField gridField,
                       int rowIndex,
                       boolean tableEditor,
                       IEditorConfiguration editorConfiguration)
        Parameters:
        comp -
        gridField -
        rowIndex -
        tableEditor -
        editorConfiguration -
      • WEditor

        public WEditor​(org.zkoss.zk.ui.Component comp,
                       String label,
                       String description,
                       boolean mandatory,
                       boolean readonly,
                       boolean updateable)
        Constructor for use if a grid field is unavailable
        Parameters:
        comp - The editor's component
        label - column name (not displayed)
        description - description of component
        mandatory - whether a selection must be made
        readonly - whether or not the editor is read only
        updateable - whether the editor contents can be changed
      • WEditor

        public WEditor​(org.zkoss.zk.ui.Component comp,
                       String columnName,
                       String label,
                       String description,
                       boolean mandatory,
                       boolean readonly,
                       boolean updateable)
        Constructor for use if a grid field is unavailable
        Parameters:
        comp - The editor's component
        label - column name (not displayed)
        description - description of component
        mandatory - whether a selection must be made
        readonly - whether or not the editor is read only
        updateable - whether the editor contents can be changed
    • Method Detail

      • showMenu

        public void showMenu()
        call to show context menu of this field. must call after append component of this field to parent
      • setChangeEventWhenEditing

        public void setChangeEventWhenEditing​(boolean isChangeEventWhenEditing)
        Normal zk component just fire onChange event when user loss focus call this method with true value let component fire event when user type first character remark: editor set true for this method also need handle INIT_EDIT_EVENT to take effect, can refer implement at WStringEditor.onEvent(Event)
        Parameters:
        isChangeEventWhenEditing -
      • getDescription

        public String getDescription()
        Method is used to distinguish between 2 similar WSearchEditors
      • setComponent

        protected void setComponent​(org.zkoss.zk.ui.Component comp)
        Set the editor component.
        Parameters:
        comp - the editor component
      • getGridField

        public GridField getGridField()
        Returns:
        grid field for this editor ( can be null )
      • getColumnName

        public String getColumnName()
        Returns:
        columnNames
      • cleanColumnName

        protected String cleanColumnName​(String originalColumnName)
        Remove the table qualifier from the supplied column name. The column name may be prefixed with the table name i.e. [table name].[column name]. The function returns
        Parameters:
        originalColumnName - The column name to clean
        Returns:
        the column name with any table qualifier removed i.e. [column name]
      • setColumnName

        protected void setColumnName​(String columnName)
      • getComponent

        public org.zkoss.zk.ui.Component getComponent()
        Returns:
        Component
      • setGridTab

        public void setGridTab​(GridTab gridTab)
        Parameters:
        gridTab -
      • getPopupMenu

        public WEditorPopupMenu getPopupMenu()
        Returns:
        popup menu instance ( if available )
      • addValueChangeListener

        public void addValueChangeListener​(ValueChangeListener listener)
        Parameters:
        listener -
      • removeValuechangeListener

        public boolean removeValuechangeListener​(ValueChangeListener listener)
      • getLabel

        public Label getLabel()
        Returns:
        Label
      • setReadWrite

        public abstract void setReadWrite​(boolean readWrite)
        Parameters:
        readWrite -
      • isReadWrite

        public abstract boolean isReadWrite()
        Returns:
        editable
      • setVisible

        public void setVisible​(boolean visible)
        Parameters:
        visible -
      • isVisible

        public boolean isVisible()
        Returns:
        is visible
      • setBackground

        public void setBackground​(boolean error)
      • setBackground

        public void setBackground​(Color color)
      • setValue

        public abstract void setValue​(Object value)
        Parameters:
        value -
      • getValue

        public abstract Object getValue()
        Returns:
        Object
      • getDisplay

        public abstract String getDisplay()
        Returns:
        display text
      • getDisplayTextForGridView

        public String getDisplayTextForGridView​(Object value)
      • getEvents

        public String[] getEvents()
        Returns:
        list of events
      • setMandatory

        public void setMandatory​(boolean mandatory)
        Set whether the editor represents a mandatory field.
        Parameters:
        mandatory - whether the field is mandatory
      • isMandatory

        public boolean isMandatory()
        Returns:
        boolean
      • dynamicDisplay

        public void dynamicDisplay()
      • dynamicDisplay

        public void dynamicDisplay​(Properties ctx)
        allow subclass to perform dynamic loading of data
      • updateStyle

        public void updateStyle​(boolean applyDictionaryStyle)
      • updateStyle

        public void updateStyle()
      • applyLabelStyles

        protected void applyLabelStyles​(boolean applyDictionaryStyle)
      • setLabelStyle

        protected void setLabelStyle​(String style)
      • applyFieldStyles

        protected void applyFieldStyles​(boolean applyDictionaryStyle)
      • setFieldStyle

        protected void setFieldStyle​(String style)
      • isSearchable

        public boolean isSearchable()
        Returns:
        true if usable in find window, false otherwise
      • buildStyle

        protected String buildStyle​(int AD_Style_ID)
      • fillHorizontal

        public void fillHorizontal()
        Stretch editor component to fill container
      • updateLabelStyle

        public void updateLabelStyle()
        Deprecated.
      • isMandatoryStyle

        public boolean isMandatoryStyle()
      • isNullOrEmpty

        public boolean isNullOrEmpty()
      • isZoomable

        public boolean isZoomable()
      • setTableEditor

        public void setTableEditor​(boolean b)
      • isShowPreference

        protected boolean isShowPreference()
        Returns:
        boolean
      • addChangeLogMenu

        protected void addChangeLogMenu​(WEditorPopupMenu popupMenu)
        Parameters:
        popupMenu -
      • addTextEditorMenu

        protected void addTextEditorMenu​(WEditorPopupMenu popupMenu)
        Parameters:
        popupMenu -
      • isComponentOfEditor

        public boolean isComponentOfEditor​(org.zkoss.zk.ui.Component comp)
      • isProcessParameter

        public boolean isProcessParameter()
      • setProcessParameter

        public void setProcessParameter​(boolean isProcessParameter)
      • getDisplayComponent

        public org.zkoss.zk.ui.Component getDisplayComponent()
        return component use for display value in grid view mode in non edit status if return null, a label will replace. because each row must has one instance of this component, don't cache it. just create new instance
        Returns:
      • focusNext

        protected void focusNext()
      • getStyleEvaluatee

        protected Evaluatee getStyleEvaluatee()