|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.option.TableEditorFactory
public class TableEditorFactory
Editor factory that creates editors which represent the parameters managed
by a given OptionHandler
in a tabular fashion.
Sections can be collapsed or expanded to hide or show the contained
parameters.
--------------------------------- | - Section Name | --------------------------------- | Parameter Name | Input Mask | --------------------------------- | Parameter Name | Input Mask | --------------------------------- | ... | --------------------------------- | + Section Name | --------------------------------- | - Section Name | --------------------------------- | Parameter Name | Input Mask | --------------------------------- | ... | ---------------------------------
Nested Class Summary | |
---|---|
static class |
TableEditorFactory.EditorLocation
Enumeration to specify where external item editors should appear. |
static class |
TableEditorFactory.InfoPosition
Enumeration to specify the position of the editor's info component. |
static interface |
TableEditorFactory.ItemEditorOwner
This interface should be implemented by TableCellEditor and
TableCellRenderer classes used with the
TableEditorFactory that need to know additional information
to display the editor value. |
static class |
TableEditorFactory.Theme
This class can be used to customize the look of editors created by a TableEditorFactory . |
Field Summary | |
---|---|
static java.lang.String |
ATTRIBUTE_EDITOR_LOCATION
Attribute key that can be used to specify where external item editors should appear. |
static java.lang.String |
ATTRIBUTE_EDITOR_LOCATION_REFERENCE_COMPONENT
Attribute key that can be used to specify a reference component for TableEditorFactory.EditorLocation.RELATIVE_TO_REFERENCE_COMPONENT . |
static java.lang.String |
ATTRIBUTE_INFO_POSITION
Attribute key that can be used to specify the info style of the editor component. |
static java.lang.String |
ATTRIBUTE_STRING_REPRESENTATION
Attribute key used to store String representations of the option item or value. |
static java.lang.String |
ATTRIBUTE_TABLE_EDITOR
Attribute key that can be used to store a cell editor to use instead of the cell editor returned by getDefaultEditor(OptionItem) . |
static java.lang.String |
ATTRIBUTE_TABLE_RENDERER
Attribute key that can be used to store a cell renderer to use instead of the cell renderer returned by getDefaultRenderer(OptionItem) . |
static java.lang.String |
ATTRIBUTE_THEME
Attribute key that can be used to specify a color theme for the editor component. |
static java.lang.String |
ATTRIBUTE_USE_ITEM_NAME_AS_TOOLTIP_FALLBACK
Attribute key that controls whether the name of an OptionItem should be used as its tool tip text if no
explicit tip text has been specified. |
Constructor Summary | |
---|---|
TableEditorFactory()
Creates a new instance of TableEditorFactory. |
Method Summary | |
---|---|
Editor |
createEditor(OptionHandler handler)
Creates an editor for the specified option handler. |
Editor |
createEditor(OptionHandler handler,
java.util.Map overrides)
Creates an editor for the specified option handler. |
static TableEditorFactory.Theme |
createTheme()
Creates a new Theme object, which can be used to customize
the look of editors created by a TableEditorFactory . |
protected javax.swing.table.TableCellEditor |
getDefaultEditor(OptionItem item)
Returns the default editor for the specified OptionItem. |
protected javax.swing.table.TableCellRenderer |
getDefaultRenderer(OptionItem item)
Returns the default renderer for the specified OptionItem. |
GuiFactory |
getGuiFactory()
Returns the GuiFactory that is used for I18N by this factory. |
ItemEditorFactory |
getItemFactory()
Returns the ItemEditorFactory used to create item editors
for items that cannot be edited in the table. |
boolean |
isAutoAdopt()
Returns whether this factory creates editors in autoAdopt
state. |
boolean |
isAutoCommit()
Returns whether this factory create editors in autoCommit
state. |
void |
resetEditor(OptionHandler handler,
Editor editor)
Resets the specified editor for use with the specified handler. |
void |
resetEditor(OptionHandler handler,
java.util.Map overrides,
Editor editor)
Resets the specified editor for use with the specified handler. |
void |
setAutoAdopt(boolean autoAdopt)
Specifies whether this factory creates editors in autoAdopt
state. |
void |
setAutoCommit(boolean autoCommit)
Specifies whether this factory creates editors in autoCommit
state. |
void |
setGuiFactory(GuiFactory factory)
Specifies the GuiFactory used for I18N by this factory. |
void |
setItemFactory(ItemEditorFactory itemFactory)
Sets the ItemEditorFactory used to create item editors
for items that cannot be edited in the table. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ATTRIBUTE_INFO_POSITION
TableEditorFactory.InfoPosition
.
This attribute has to be set for an OptionHandler
or
in the overrides map.
public static final java.lang.String ATTRIBUTE_THEME
TableEditorFactory.Theme
.
This attribute has to be set for an OptionHandler
or
in the overrides map.
createTheme()
public static final java.lang.String ATTRIBUTE_TABLE_EDITOR
getDefaultEditor(OptionItem)
.
Attribute values have to implement TableCellEditor
.
public static final java.lang.String ATTRIBUTE_TABLE_RENDERER
getDefaultRenderer(OptionItem)
.
Attribute values have to implement
TableCellRenderer
.
public static final java.lang.String ATTRIBUTE_STRING_REPRESENTATION
public static final java.lang.String ATTRIBUTE_USE_ITEM_NAME_AS_TOOLTIP_FALLBACK
OptionItem
should be used as its tool tip text if no
explicit tip text has been specified. Attribute values have to be of
type Boolean
.
public static final java.lang.String ATTRIBUTE_EDITOR_LOCATION
TableEditorFactory.EditorLocation
.
This attribute may be set for an OptionItem
,
an OptionHandler
, or in the overrides map.
public static final java.lang.String ATTRIBUTE_EDITOR_LOCATION_REFERENCE_COMPONENT
TableEditorFactory.EditorLocation.RELATIVE_TO_REFERENCE_COMPONENT
.
Attribute values have to be of type Component
.
This attribute may be set for an OptionItem
,
an OptionHandler
, or in the overrides map.
Constructor Detail |
---|
public TableEditorFactory()
Method Detail |
---|
public ItemEditorFactory getItemFactory()
ItemEditorFactory
used to create item editors
for items that cannot be edited in the table.
public void setItemFactory(ItemEditorFactory itemFactory)
ItemEditorFactory
used to create item editors
for items that cannot be edited in the table.
Editors created in this way are displayed in an external dialog.
itemFactory
- the ItemEditorFactory
public void resetEditor(OptionHandler handler, Editor editor)
Editor
, the attribute info style is ignored.
handler
- the OptionHandler
editor
- the Editor
java.lang.IllegalArgumentException
- if the specified editor was not created
by a TableEditorFactory
public void resetEditor(OptionHandler handler, java.util.Map overrides, Editor editor)
Editor
, the attribute info style is ignored.
handler
- the OptionHandler
overrides
- a Map
specifying overrides for the
handler attributeseditor
- the Editor
java.lang.IllegalArgumentException
- if the specified editor was not created
by a TableEditorFactory
public boolean isAutoCommit()
autoCommit
state.
public void setAutoCommit(boolean autoCommit)
autoCommit
state.
autoCommit
- if true
editors created by this factory
will be in autoCommit
statepublic boolean isAutoAdopt()
autoAdopt
state.
public void setAutoAdopt(boolean autoAdopt)
autoAdopt
state.
autoAdopt
- if true
editors created by this factory
will be in autoAdopt
statepublic Editor createEditor(OptionHandler handler)
EditorFactory
createEditor
in interface EditorFactory
handler
- the OptionHandler
public Editor createEditor(OptionHandler handler, java.util.Map overrides)
EditorFactory
createEditor
in interface EditorFactory
handler
- the OptionHandler
overrides
- a Map
specifying overrides for the
handler attributes
protected javax.swing.table.TableCellEditor getDefaultEditor(OptionItem item)
null
implies that the value of the item is not
editable.
If the attribute "TableEditorFactory.tableEditor" is set, then the default
editor returned by this method is ignored and the value of the mentioned
attribute is used.
item
- the OptionItem
protected javax.swing.table.TableCellRenderer getDefaultRenderer(OptionItem item)
null
implies that the display component may choose
a renderer.
If the attribute "TableEditorFactory.tableRenderer" is set, then the
default renderer returned by this method is ignored and the value of the
mentioned attribute is used.
item
- the OptionItem
public GuiFactory getGuiFactory()
EditorFactory
GuiFactory
that is used for I18N by this factory.
getGuiFactory
in interface EditorFactory
public void setGuiFactory(GuiFactory factory)
EditorFactory
GuiFactory
used for I18N by this factory.
setGuiFactory
in interface EditorFactory
public static TableEditorFactory.Theme createTheme()
Theme
object, which can be used to customize
the look of editors created by a TableEditorFactory
.
For the theme to be used, it has to be set as an OptionHandler
attribute when creating or resetting an editor.
ATTRIBUTE_THEME
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |