|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthibergui.Component<T>
T - public abstract class Component<T>
Common superclass of HiberGUI components. Although HiberGUI components themselves are not SWT widgets, widgets can be placed on them, and they can be placed on SWT composites as well. According to the logic of SWT, the the elements of a component must be created during the instantiation of component. This is done by the createContents method. Subclasses should override this method to place widgets or subcomponents on themselves. (In AWT or Swing widgets can be put on containers using "add" methods after the container has been instantiated.) Any activities, which should be performed before the construction of the subcomponents and widgets of the component should be done by the init method. The constructor invokes it before createContents. HiberGUI components cannot handle SWT events directly. They have own event handling based on SWT.
| Field Summary | |
|---|---|
private java.util.List<ChangeListener> |
changeListeners
|
private org.eclipse.swt.widgets.Control |
crl
The SWT control containing the component. |
private java.util.List<FocusListener> |
focusListeners
|
private java.util.List<KeyListener> |
keyListeners
|
protected org.eclipse.swt.events.FocusListener |
lsn_WIDGET_FOCUS
This SWT listener fires a HiberGUI focus event when an SWT focus event is fired. |
protected org.eclipse.swt.events.KeyListener |
lsn_WIDGET_KEY
This SWT listener fires a HiberGUI key event when an SWT key event is fired. |
protected int |
style
The style of the component. |
| Constructor Summary | |
|---|---|
protected |
Component(org.eclipse.swt.widgets.Composite cptParent,
int style)
Initializes the component and creates the GUI elements on them. |
| Method Summary | |
|---|---|
void |
addChangeListener(ChangeListener lsn)
|
void |
addControlListener(org.eclipse.swt.events.ControlListener lsn)
|
void |
addFocusListener(FocusListener lsn)
|
void |
addKeyListener(KeyListener lsn)
|
protected abstract org.eclipse.swt.widgets.Control |
createContents(org.eclipse.swt.widgets.Composite cptParent)
Creates the GUI contents of the component. |
protected void |
dispose()
Disposes the component. |
protected void |
fireChange(ChangeEvent<? extends Component<T>,T> event)
|
private void |
fireFocusGained(FocusEvent<?> event)
|
private void |
fireFocusLost(FocusEvent<?> event)
|
protected void |
fireKeyPressed(KeyEvent<?> event)
|
protected void |
fireKeyReleased(KeyEvent<?> event)
|
org.eclipse.swt.widgets.Control |
getControl()
Returns the SWT control of the component. |
protected void |
init()
Initializes the component. |
void |
removeChangeListener(ChangeListener lsn)
|
void |
removeControlListener(org.eclipse.swt.events.ControlListener lsn)
|
void |
removeFocusListener(FocusListener lsn)
|
void |
removeKeyListener(KeyListener lsn)
|
abstract boolean |
setFocus()
|
void |
setLayoutData(java.lang.Object data)
Sets the layout data of the component. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final int style
private final org.eclipse.swt.widgets.Control crl
protected final org.eclipse.swt.events.FocusListener lsn_WIDGET_FOCUS
private java.util.List<FocusListener> focusListeners
protected final org.eclipse.swt.events.KeyListener lsn_WIDGET_KEY
private java.util.List<KeyListener> keyListeners
private java.util.List<ChangeListener> changeListeners
| Constructor Detail |
|---|
protected Component(org.eclipse.swt.widgets.Composite cptParent,
int style)
cptParent - The composite which the component will be placed on. The
parent of the control of the component.style - The style of the component. It is a combination of constants
defined in hibergui.HiberGUI.| Method Detail |
|---|
protected void init()
protected void dispose()
protected abstract org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite cptParent)
cptParent - The composite which the component will be placed on. The
parent of the control of the component.
public org.eclipse.swt.widgets.Control getControl()
public final void setLayoutData(java.lang.Object data)
data - the layout datapublic final void addFocusListener(FocusListener lsn)
public final void removeFocusListener(FocusListener lsn)
private void fireFocusGained(FocusEvent<?> event)
private void fireFocusLost(FocusEvent<?> event)
public abstract boolean setFocus()
public final void addControlListener(org.eclipse.swt.events.ControlListener lsn)
public final void removeControlListener(org.eclipse.swt.events.ControlListener lsn)
public final void addKeyListener(KeyListener lsn)
public final void removeKeyListener(KeyListener lsn)
protected void fireKeyPressed(KeyEvent<?> event)
protected void fireKeyReleased(KeyEvent<?> event)
public final void addChangeListener(ChangeListener lsn)
public final void removeChangeListener(ChangeListener lsn)
protected void fireChange(ChangeEvent<? extends Component<T>,T> event)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||