Search this API

y.option
Class DefaultEditorFactory

java.lang.Object
  extended by y.option.DefaultEditorFactory
All Implemented Interfaces:
EditorFactory, ItemEditorFactory

public class DefaultEditorFactory
extends java.lang.Object
implements EditorFactory, ItemEditorFactory

Editor factory that creates editors which represent the parameters managed by a given OptionHandler in a tabbed pane fashion. Each section is represented by a distinct tab of the tabbed pane layout within the editor component. The parameters contained in a given section are arranged in top down fashion, each one in a line, on the left side a name, on the right side an input mask for the parameter.

 

Field Summary
static java.lang.Object ALIGNMENT_HORIZONTAL
          Value for attribute enum alignment.
static java.lang.Object ALIGNMENT_VERTICAL
          Value for attribute enum alignment.
static java.lang.String ATTRIBUTE_CARD_ID
          Attribute key used to store a String id tag.
static java.lang.String ATTRIBUTE_CONTROLLER_ID
          Attribute key used to store an Object id tag usable as a key in a Map.
static java.lang.String ATTRIBUTE_ENUM_ALIGNMENT
          Attribute key used to store enum alignment hint.
static java.lang.String ATTRIBUTE_ENUM_STYLE
          Attribute key used to store enum style hint.
static java.lang.String ATTRIBUTE_MAX_VALUE_LABEL_TEXT
          Attribute key used to specify an alternative label text for the maximum value tick editors of bounded numerical option items, i.e.
static java.lang.String ATTRIBUTE_MIN_VALUE_LABEL_TEXT
          Attribute key used to specify an alternative label text for the minimum value tick for editors of bounded numerical option items, i.e.
static java.lang.String ATTRIBUTE_STRING_STYLE
          Attribute key used to store string style hint.
static java.lang.String FILL_SPACE_WEIGHT
          Attribute key used to store a Double to indicate that the item should take up more space if that space is available.
static java.lang.Object STYLE_COMBO_BOX
          Value for attribute enum style specifying that a combo box view should be used.
static java.lang.Object STYLE_RADIO_BUTTONS
          Value for attribute enum style specifying that a group of radio buttons should be used.
static java.lang.Object STYLE_TEXT_AREA
          Value for attribute string style specifying that a text area view should be used.
static java.lang.Object STYLE_TEXT_FIELD
          Value for attribute string style specifying that a text field view should be used.
 
Constructor Summary
DefaultEditorFactory()
          Creates a new instance of DefaultEditorFactory.
 
Method Summary
 Editor createEditor(OptionHandler handler)
          Creates a default editor for the specified option handler.
 Editor createEditor(OptionHandler handler, java.util.Map attributes)
          Creates a default editor for the specified option handler.
 ItemEditor createEditor(OptionItem item)
          Creates a default editor for the specified option item.
 ItemEditor createEditor(OptionItem item, java.util.Map attributes)
          Creates a default editor for the specified option item.
protected  Editor createEditor(OptionSection section)
          Creates a default editor for the specified option section.
 GuiFactory getGuiFactory()
          Returns the GuiFactory that is used for I18N by this factory.
 void setGuiFactory(GuiFactory factory)
          Specifies the GuiFactory used for I18N by this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTE_ENUM_ALIGNMENT

public static final java.lang.String ATTRIBUTE_ENUM_ALIGNMENT
Attribute key used to store enum alignment hint. Ignored, unless enum style radio buttons is chosen.


ATTRIBUTE_ENUM_STYLE

public static final java.lang.String ATTRIBUTE_ENUM_STYLE
Attribute key used to store enum style hint.


ATTRIBUTE_STRING_STYLE

public static final java.lang.String ATTRIBUTE_STRING_STYLE
Attribute key used to store string style hint.


ATTRIBUTE_CONTROLLER_ID

public static final java.lang.String ATTRIBUTE_CONTROLLER_ID
Attribute key used to store an Object id tag usable as a key in a Map.
Setting this attribute for a OptionItem specifies the item as a controller for a set of option groups for which the same controller tag has been set. Only the group whose card id tag matches the string representation of the editor value of the item will be visible. The tag has to be unique among all items in a given OptionSection.
Setting this attribute for a OptionGroup will result in the group's view being controlled by the OptionItem with the same controller tag.

See Also:
ATTRIBUTE_CARD_ID

FILL_SPACE_WEIGHT

public static final java.lang.String FILL_SPACE_WEIGHT
Attribute key used to store a Double to indicate that the item should take up more space if that space is available.
Leftover space will be distributed among Items according to their weights.


ATTRIBUTE_CARD_ID

public static final java.lang.String ATTRIBUTE_CARD_ID
Attribute key used to store a String id tag.
The tag should be set for a OptionGroup and its value should equal the string representation of a possible value of the editor of the OptionItem that was specified to be the layout controller.
The tag has to be unique among all groups with the same controller id tag.

See Also:
ATTRIBUTE_CONTROLLER_ID

ATTRIBUTE_MAX_VALUE_LABEL_TEXT

public static final java.lang.String ATTRIBUTE_MAX_VALUE_LABEL_TEXT
Attribute key used to specify an alternative label text for the maximum value tick editors of bounded numerical option items, i.e. IntOptionItem and/or DoubleOptionItem instances with both ATTRIBUTE_MAX_VALUE and ATTRIBUTE_MIN_VALUE set. Values have to be of type String.


ATTRIBUTE_MIN_VALUE_LABEL_TEXT

public static final java.lang.String ATTRIBUTE_MIN_VALUE_LABEL_TEXT
Attribute key used to specify an alternative label text for the minimum value tick for editors of bounded numerical option items, i.e. IntOptionItem and/or DoubleOptionItem instances with both ATTRIBUTE_MAX_VALUE and ATTRIBUTE_MIN_VALUE set. Values have to be of type String.


STYLE_COMBO_BOX

public static final java.lang.Object STYLE_COMBO_BOX
Value for attribute enum style specifying that a combo box view should be used. The default.


STYLE_RADIO_BUTTONS

public static final java.lang.Object STYLE_RADIO_BUTTONS
Value for attribute enum style specifying that a group of radio buttons should be used.


STYLE_TEXT_AREA

public static final java.lang.Object STYLE_TEXT_AREA
Value for attribute string style specifying that a text area view should be used.


STYLE_TEXT_FIELD

public static final java.lang.Object STYLE_TEXT_FIELD
Value for attribute string style specifying that a text field view should be used.


ALIGNMENT_HORIZONTAL

public static final java.lang.Object ALIGNMENT_HORIZONTAL
Value for attribute enum alignment. If enum style radio buttons is chosen, the radio buttons will be aligned in a single row.


ALIGNMENT_VERTICAL

public static final java.lang.Object ALIGNMENT_VERTICAL
Value for attribute enum alignment. If enum style radio buttons is chosen, the radio buttons will be aligned in a single column.

Constructor Detail

DefaultEditorFactory

public DefaultEditorFactory()
Creates a new instance of DefaultEditorFactory.

Method Detail

getGuiFactory

public GuiFactory getGuiFactory()
Description copied from interface: EditorFactory
Returns the GuiFactory that is used for I18N by this factory.

Specified by:
getGuiFactory in interface EditorFactory
Specified by:
getGuiFactory in interface ItemEditorFactory
Returns:
the GuiFactory that is used for I18N by this factory
See Also:
ItemEditorFactory.setGuiFactory(GuiFactory)

setGuiFactory

public void setGuiFactory(GuiFactory factory)
Description copied from interface: EditorFactory
Specifies the GuiFactory used for I18N by this factory.

Specified by:
setGuiFactory in interface EditorFactory
Specified by:
setGuiFactory in interface ItemEditorFactory
Parameters:
factory - the GuiFactory
See Also:
ItemEditorFactory.getGuiFactory()

createEditor

public Editor createEditor(OptionHandler handler)
Creates a default editor for the specified option handler. Calling this method is equivalent to calling
createEditor( handler, null )

Specified by:
createEditor in interface EditorFactory
Parameters:
handler - the OptionHandler for which an editor is created
Returns:
an editor for the specified option handler

createEditor

public Editor createEditor(OptionHandler handler,
                           java.util.Map attributes)
Creates a default editor for the specified option handler. The editor is added to the specified option handler.

Specified by:
createEditor in interface EditorFactory
Parameters:
handler - the OptionHandler for which an editor is created
attributes - preference settings for the editor UI
Returns:
an editor for the specified option handler

createEditor

public ItemEditor createEditor(OptionItem item)
Creates a default editor for the specified option item. Calling this method is equivalent to calling
createEditor( item, null )

Specified by:
createEditor in interface ItemEditorFactory
Parameters:
item - the OptionItem for which an editor is created
Returns:
an editor for the specified option item

createEditor

public ItemEditor createEditor(OptionItem item,
                               java.util.Map attributes)
Creates a default editor for the specified option item. The editor is added to the specified option item.

Specified by:
createEditor in interface ItemEditorFactory
Parameters:
item - the OptionItem for which an editor is created
attributes - preference settings for the editor UI
Returns:
an editor for the specified option item

createEditor

protected Editor createEditor(OptionSection section)
Creates a default editor for the specified option section.

Parameters:
section - the section for which an editor is created
Returns:
an editor for the specified option section

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.