Search this API

y.option
Interface ItemEditor

All Superinterfaces:
Editor
All Known Implementing Classes:
AbstractItemEditor

public interface ItemEditor
extends Editor

Specifies the general contract of an option item editor.

 

Nested Class Summary
 
Nested classes/interfaces inherited from interface y.option.Editor
Editor.Event, Editor.Listener
 
Field Summary
static java.lang.String ATTRIBUTE_AUTO_ADOPT
          If the value of this attribute equals Boolean.TRUE, the editor is initialized to be in autoAdopt mode.
static java.lang.String ATTRIBUTE_AUTO_COMMIT
          If the value of this attribute equals Boolean.TRUE, the editor is initialized to be in autoCommit state.
static java.lang.String ATTRIBUTE_FONT_NAME
          Specifies the font family name for editors of text/string based option items.
static java.lang.String ATTRIBUTE_SELECT_TEXT_ON_FOCUS
          If the value of this attribute equals Boolean.TRUE, text-based editors should select their text content when they receive focus due to a focus traversal event (i.e. receiving the focus due to mouse clicks should not trigger the content selection).
 
Method Summary
 OptionItem getItem()
          Returns the option item whose value can be edited with this editor.
 java.lang.Object getValue()
          Returns the value of this editor.
 boolean isAutoAdopt()
          Returns whether this editor is in autoAdopt state, i.e. if changes in the underlying option item be automatically adopted by the editor.
 boolean isAutoCommit()
          Returns whether this editor is in autoCommit state, i.e. if editor changes will be automatically propagated to the underlying option item.
 boolean isEnabled()
          Returns the enabled state of this editor.
 boolean isValueUndefined()
          Returns whether or not the editor should start up displaying an undefined value.
 void setAutoAdopt(boolean autoAdopt)
          Specifies the autoAdopt state of this editor.
 void setAutoCommit(boolean autoCommit)
          Specifies the autoCommit state of this editor.
 void setEnabled(boolean b)
          Sets the enabled state of this editor.
 void setValue(java.lang.Object value)
          Sets the value of this editor.
 void setValueUndefined(boolean b)
          Specifies whether or not the editor should display an undefined value.
 
Methods inherited from interface y.option.Editor
adoptItemValue, commitValue, getComponent, resetValue
 

Field Detail

ATTRIBUTE_AUTO_COMMIT

static final java.lang.String ATTRIBUTE_AUTO_COMMIT
If the value of this attribute equals Boolean.TRUE, the editor is initialized to be in autoCommit state.

See Also:
isAutoCommit(), setAutoCommit(boolean), Constant Field Values

ATTRIBUTE_AUTO_ADOPT

static final java.lang.String ATTRIBUTE_AUTO_ADOPT
If the value of this attribute equals Boolean.TRUE, the editor is initialized to be in autoAdopt mode.

See Also:
isAutoAdopt(), setAutoAdopt(boolean), Constant Field Values

ATTRIBUTE_SELECT_TEXT_ON_FOCUS

static final java.lang.String ATTRIBUTE_SELECT_TEXT_ON_FOCUS
If the value of this attribute equals Boolean.TRUE, text-based editors should select their text content when they receive focus due to a focus traversal event (i.e. receiving the focus due to mouse clicks should not trigger the content selection).

See Also:
Constant Field Values

ATTRIBUTE_FONT_NAME

static final java.lang.String ATTRIBUTE_FONT_NAME
Specifies the font family name for editors of text/string based option items. Unlike the other attributes in this interface, this attribute has to be specified for editor instances (that implement AttributeOwner) instead of option items.

See Also:
Constant Field Values
Method Detail

getItem

OptionItem getItem()
Returns the option item whose value can be edited with this editor.


isAutoCommit

boolean isAutoCommit()
Returns whether this editor is in autoCommit state, i.e. if editor changes will be automatically propagated to the underlying option item.

Note:
It is the responsibility of the editor to update the value property of its associated option item.


setAutoCommit

void setAutoCommit(boolean autoCommit)
Specifies the autoCommit state of this editor.

Parameters:
autoCommit - if true changes in this editor will be automatically propagated to the underlying option item

isAutoAdopt

boolean isAutoAdopt()
Returns whether this editor is in autoAdopt state, i.e. if changes in the underlying option item be automatically adopted by the editor.

Note:
It is the responsibility of the OptionItem to update the properties value, valueUndefined, and enabled of editors that are in autoAdopt state.

See Also:
OptionItem.publishValue(Object), OptionItem.publishValueUndefined(boolean), OptionItem.publishEnabled(boolean)

setAutoAdopt

void setAutoAdopt(boolean autoAdopt)
Specifies the autoAdopt state of this editor.

Parameters:
autoAdopt - if true changes in the underlying option item will be automatically adopted by the editor

getValue

java.lang.Object getValue()
Returns the value of this editor.


setValue

void setValue(java.lang.Object value)
Sets the value of this editor.


isEnabled

boolean isEnabled()
Returns the enabled state of this editor.


setEnabled

void setEnabled(boolean b)
Sets the enabled state of this editor.


isValueUndefined

boolean isValueUndefined()
Returns whether or not the editor should start up displaying an undefined value.


setValueUndefined

void setValueUndefined(boolean b)
Specifies whether or not the editor should display an undefined value.

Parameters:
b - if true the editor should display an undefined value

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