public abstract class Component extends TreeNode
| Modifier and Type | Field and Description |
|---|---|
protected Color |
backgroundColor |
protected String |
caption |
protected Color |
color |
protected boolean |
disabled |
static String |
EVENT_BEFORE_REFRESH_VIEW
refresh only sync abstract view to (remote) native view.
|
static String |
EVENT_BEFORE_UPDATE_VIEW
usually view should load data from model.
|
static String |
EVENT_STATE_CHANGE
any part of the view changes that the Controller may interested.
|
static String |
EVENT_VALUE_CHANGE
usually used to update model.
|
protected Font |
font |
protected String |
id
it is unique
|
protected String |
name |
protected boolean |
readOnly |
protected boolean |
visible |
| Constructor and Description |
|---|
Component() |
| Modifier and Type | Method and Description |
|---|---|
abstract Object |
accept(Visitor visitor) |
void |
addChild(Component comp) |
void |
addChild(Component uic,
boolean autoremovePackingCase) |
void |
addChildren(Component[] uics) |
void |
addEventListener(String event,
EventListener listener) |
void |
clearEventListener() |
boolean |
containsListener(String event) |
void |
destroy()
free resource, such as file, thread, etc.
|
boolean |
existsEventListener(String event,
EventListener listener) |
Window |
findWindow()
find the belonging window
|
void |
forceUpdateView()
trigger STATE_CHANGE event.
|
Color |
getBackgroundColor() |
String |
getCaption() |
Component |
getChildComponentById(String id) |
Component |
getChildComponentByName(String name) |
List<Component> |
getChildrenComponents() |
Color |
getColor() |
protected Component |
getComponentByClass(Class clazz)
original idea is to make a "getWindow()", but, I don't want to let this
class depend on the Window class.
|
Object |
getExtraAttribute(String name) |
Map<String,Object> |
getExtraAttributes() |
Font |
getFont() |
Font |
getFont(boolean createIfNull) |
String |
getId() |
Object |
getModel() |
String |
getName() |
Window |
getWindow() |
void |
hide() |
boolean |
isDisabled() |
boolean |
isReadOnly() |
boolean |
isVisible() |
boolean |
isWindow() |
void |
notifyEventListeners(String event) |
void |
notifyEventListeners(String event,
Object... parameters) |
void |
removeChild(Component uic) |
void |
removeEventListener(String event,
EventListener listener) |
void |
removeExtraAttribute(String name) |
void |
setBackgroundColor(Color backgroundColor) |
void |
setCaption(String caption) |
void |
setColor(Color color) |
void |
setDisabled(boolean disabled) |
void |
setExtraAttribute(String name,
Object value) |
void |
setFont(Font font) |
void |
setId(String id) |
void |
setModel(Object model) |
void |
setModel(Object model,
boolean updateView) |
void |
setName(String name) |
void |
setReadOnly(boolean readOnly) |
void |
setVisible(boolean visible) |
void |
show() |
String |
toString() |
protected Component |
tranverse(net.abstractfactory.plum.view.component.Component.Find find,
int depth) |
void |
updateModel()
sync values from view to model
|
void |
updateView()
sync values from model to view.
|
addChild, addChild, addChildren, checkConsistency, copy, detach, getChildren, getDepth, getParent, getRoot, isLeaf, isRoot, remove, removeAllChildren, removeChild, replace, replaceSingleNode, setChildren, setParentpublic static final String EVENT_BEFORE_REFRESH_VIEW
public static final String EVENT_BEFORE_UPDATE_VIEW
public static final String EVENT_STATE_CHANGE
public static final String EVENT_VALUE_CHANGE
protected String id
protected String name
protected String caption
protected Font font
protected Color color
protected Color backgroundColor
protected boolean disabled
protected boolean readOnly
protected boolean visible
public String getName()
public void setName(String name)
public String getCaption()
public void setCaption(String caption)
public boolean isDisabled()
public void setDisabled(boolean disabled)
public boolean isReadOnly()
public void setReadOnly(boolean readOnly)
public boolean isVisible()
public void setVisible(boolean visible)
public void show()
public void hide()
public String getId()
public void setId(String id)
public Font getFont()
public Font getFont(boolean createIfNull)
public void setFont(Font font)
public Color getColor()
public void setColor(Color color)
public Color getBackgroundColor()
public void setBackgroundColor(Color backgroundColor)
public void removeExtraAttribute(String name)
public void addChild(Component comp)
public void addChild(Component uic, boolean autoremovePackingCase)
public void addChildren(Component[] uics)
public void removeChild(Component uic)
protected Component tranverse(net.abstractfactory.plum.view.component.Component.Find find, int depth)
public Window findWindow()
public boolean isWindow()
protected Component getComponentByClass(Class clazz)
clazz - public Window getWindow()
public Object getModel()
public void setModel(Object model)
public void setModel(Object model, boolean updateView)
public void updateModel()
public void updateView()
public void addEventListener(String event, EventListener listener)
public void removeEventListener(String event, EventListener listener)
public boolean existsEventListener(String event, EventListener listener)
public void clearEventListener()
public boolean containsListener(String event)
public void notifyEventListeners(String event)
public void forceUpdateView()
public void destroy()
Copyright © 2015. All Rights Reserved.