public abstract class ComponentAdapter
extends Object
Modifier and Type | Field and Description |
---|---|
static long |
HANDLE_DOCUMENT_CHANGE
if set adapter will notify model when component's document has changed.
|
static long |
HANDLE_ITEM_SELECTION
if set the adapter will react on item selction events in lists and tables
|
static long |
IGNORE_FOCUS_CHANGE
if set adapter will ignore focus change event.
|
static long |
NONE
NO behavior modifications
|
static long |
NOT_MUTABLE
component value is not changing when model is changing
|
static long |
READ_ACTION_LISTENERS
if set the default action listeners for the button will be removed
|
Constructor and Description |
---|
ComponentAdapter()
Instantiates a new ComponentAdapter.
|
ComponentAdapter(View view,
Object component)
Instantiates a new ComponentAdapter.
|
Modifier and Type | Method and Description |
---|---|
Object |
access()
Returns a component value, such as field.getText() using convertForStorage(...).
|
protected void |
actionOccured()
Excuted when ActionEvent is fired by the component.
|
protected void |
actionOccured(String command)
Excuted when ActionEvent for the particular command is fired by the component.
|
Object |
convertForDisplay(Object input)
Converts value for display.
|
Object |
convertForStorage(Object input)
Convert value for storage.
|
void |
dettach()
Dettach from the view.
|
void |
display(Object newValue)
Executed when model has changed.
|
Object |
getComponent()
Gets the component.
|
abstract String |
getName()
Gets the name.
|
View |
getView()
Gets the view.
|
abstract void |
invalidate()
Requests repaint for the component.
|
boolean |
isBehaviorSet(long value)
Checks if is the behavior modificator is set.
|
void |
populate(Object newValue)
Sets new value for the component.
|
void |
setBehaviorMask(long value)
Sets the behavior modification mask.
|
void |
valueChanging(Object newValue)
Notifies view when component value has changed.
|
public static final long NONE
public static final long NOT_MUTABLE
public static final long HANDLE_DOCUMENT_CHANGE
public static final long IGNORE_FOCUS_CHANGE
public static final long READ_ACTION_LISTENERS
public static final long HANDLE_ITEM_SELECTION
public ComponentAdapter()
public ComponentAdapter(View view, Object component)
view
- the viewcomponent
- the componentpublic Object access()
protected void actionOccured()
protected void actionOccured(String command)
command
- the commandpublic Object convertForDisplay(Object input)
input
- the inputpublic Object convertForStorage(Object input)
input
- the inputpublic void dettach()
public void display(Object newValue)
newValue
- the new valuepublic Object getComponent()
public abstract String getName()
public View getView()
public abstract void invalidate()
public boolean isBehaviorSet(long value)
value
- the behavior modificatorpublic void populate(Object newValue)
newValue
- the new valuepublic void setBehaviorMask(long value)
value
- the new behavior modification maskpublic void valueChanging(Object newValue)
newValue
- the new valueCopyright © 2010-2020 Toolsverse. All Rights Reserved.