|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthibergui.Component<T>
hibergui.Edit<T>
public abstract class Edit<T>
Common superclass of HiberGUI components for editing properties of business entities.
| Nested Class Summary | |
|---|---|
static interface |
Edit.DefaultComputation<TT>
|
protected class |
Edit.EditConstraint
|
private class |
Edit.WidgetModificationListener
|
| Field Summary | |
|---|---|
private Edit.DefaultComputation<T> |
defaultComputation
|
private T |
defaultValue
|
private boolean |
dirty
|
private boolean |
dirty2
|
private boolean |
fixed
|
protected Form<?> |
form
The form which the edit is placed on. |
private boolean |
invalid
|
protected org.eclipse.swt.events.TraverseListener |
lsn_TRAVERSE
This SWT listener fires a HiberGUI traverse event when an SWT traverse event is fired. |
protected Edit.WidgetModificationListener |
lsn_WIDGET_MOD
lsn_WIDGET_MOD should be added for every widget used up in the implementation of the Edit. |
private java.util.List<ModificationListener> |
modificationListeners
|
private java.lang.String |
name
|
private java.lang.String |
prop
|
private boolean |
readonly
|
private java.util.List<TraverseListener> |
traverseListeners
|
protected T |
value
The actual value of the edit. |
private SelfVerifier |
verifier
|
| Fields inherited from class hibergui.Component |
|---|
lsn_WIDGET_FOCUS, lsn_WIDGET_KEY, style |
| Constructor Summary | |
|---|---|
protected |
Edit(Form<?> form,
org.eclipse.swt.widgets.Composite cptParent,
int style,
java.lang.String prop,
java.lang.String name)
Constructs an edit. |
| Method Summary | |
|---|---|
void |
addConstraint(Constraint c,
VerificationException e)
|
protected void |
addConstraint(SelfConstraint c,
VerificationException e)
|
void |
addModificationListener(ModificationListener listener)
|
void |
addTraverseListener(TraverseListener lsn)
|
abstract void |
clear()
Clears the controls of the edit. |
abstract T |
extract()
Extracts the value from the controls of the edit. |
abstract void |
fill()
Fills the controls of the edit with its actual value. |
protected void |
fireKeyPressed(KeyEvent event)
|
protected void |
fireKeyReleased(KeyEvent event)
|
private void |
fireModification(ModificationEvent<T> event)
|
protected void |
fireTraversal(Edit<T> edit,
TraverseEvent<?> event)
|
void |
fix(boolean b)
Makes the edit read only. |
T |
get()
If the edit has been modified since its last change, it returns the value extracted from itself. |
T |
getDefault()
|
java.lang.String |
getName()
Returns the name of the edit. |
java.lang.String |
getPropertyName()
Returns the name of the property handled by the edit. |
boolean |
hasDefault()
|
boolean |
isDirty()
|
boolean |
isEditable()
|
abstract boolean |
isEnabled()
|
boolean |
isFixed()
|
boolean |
isValid()
|
void |
markClean()
|
void |
markDirty()
|
void |
markInvalid()
|
void |
markValid()
|
void |
removeConstraint(Constraint c)
|
protected void |
removeConstraint(SelfConstraint c)
|
void |
removeModificationListener(ModificationListener listener)
|
void |
removeTraverseListener(TraverseListener lsn)
|
void |
resetBackground()
|
void |
set(T value)
Sets the actual value of the edit and fills the value into the controls of the edit. |
abstract void |
setBackground(org.eclipse.swt.graphics.Color clr)
|
void |
setDefault()
|
void |
setDefault(Edit.DefaultComputation<T> defaultComp)
|
void |
setDefault(T defaultValue)
|
abstract void |
setEditable(boolean b)
|
abstract void |
setEnabled(boolean b)
|
void |
verify()
|
| Methods inherited from class hibergui.Component |
|---|
addChangeListener, addControlListener, addFocusListener, addKeyListener, createContents, dispose, fireChange, getControl, init, removeChangeListener, removeControlListener, removeFocusListener, removeKeyListener, setFocus, setLayoutData |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected T value
protected final Form<?> form
private final java.lang.String prop
private final java.lang.String name
private boolean dirty
private boolean invalid
private boolean dirty2
private boolean readonly
private boolean fixed
protected org.eclipse.swt.events.TraverseListener lsn_TRAVERSE
private java.util.List<TraverseListener> traverseListeners
protected final Edit.WidgetModificationListener lsn_WIDGET_MOD
private java.util.List<ModificationListener> modificationListeners
private SelfVerifier verifier
private T defaultValue
private Edit.DefaultComputation<T> defaultComputation
| Constructor Detail |
|---|
protected Edit(Form<?> form,
org.eclipse.swt.widgets.Composite cptParent,
int style,
java.lang.String prop,
java.lang.String name)
form - The form which the edit belongs to.cptParent - The composite which the edit will be placed on.style - The style of the edit. It is a combination of constants
defined in hibergui.HiberGUI.prop - The name of the property of the business entity class which
the edit should handle.name - The name of the edit. It may appear in GUI messages.| Method Detail |
|---|
public final void addTraverseListener(TraverseListener lsn)
public final void removeTraverseListener(TraverseListener lsn)
protected void fireTraversal(Edit<T> edit,
TraverseEvent<?> event)
public final T get()
public final void set(T value)
value - public final void fix(boolean b)
b - If true then the edit will be read only, otherwise not.public abstract void clear()
public abstract void fill()
public abstract T extract()
public java.lang.String getPropertyName()
public java.lang.String getName()
public abstract void setBackground(org.eclipse.swt.graphics.Color clr)
public void resetBackground()
public final boolean isDirty()
public final boolean isValid()
public void markClean()
public void markDirty()
public void markValid()
public void markInvalid()
public abstract boolean isEnabled()
public abstract void setEnabled(boolean b)
public boolean isEditable()
public abstract void setEditable(boolean b)
public boolean isFixed()
protected void fireKeyPressed(KeyEvent event)
fireKeyPressed in class Component<T>protected void fireKeyReleased(KeyEvent event)
fireKeyReleased in class Component<T>public void addModificationListener(ModificationListener listener)
public void removeModificationListener(ModificationListener listener)
private final void fireModification(ModificationEvent<T> event)
protected void addConstraint(SelfConstraint c,
VerificationException e)
protected void removeConstraint(SelfConstraint c)
public void addConstraint(Constraint c,
VerificationException e)
public void removeConstraint(Constraint c)
public void verify()
throws VerificationException
VerificationExceptionpublic boolean hasDefault()
public T getDefault()
public void setDefault()
public void setDefault(T defaultValue)
public void setDefault(Edit.DefaultComputation<T> defaultComp)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||