javax.rad.genui.control
Class AbstractControllable<C extends IComponent>

java.lang.Object
  extended by javax.rad.genui.UIResource<C>
      extended by javax.rad.genui.UIComponent<C>
          extended by javax.rad.genui.control.AbstractControllable<C>
Type Parameters:
C - instance of IComponent
All Implemented Interfaces:
IControllable, ITranslatable, IComponent, IResource, INamedObject
Direct Known Subclasses:
UIChart, UIEditor, UITable, UITree

public abstract class AbstractControllable<C extends IComponent>
extends UIComponent<C>
implements IControllable

Base class for all genui IControl implementations. It handles the notification of the controler on focus gained. Therefore a focus listener is added to the technology dependent control. All commands are deligated to seperate is[Command]Enabled and do[Command] functions, to allow easy overwriting.


Field Summary
 
Fields inherited from class javax.rad.genui.UIComponent
bTranslate, lLastTranslationModified, parent, popupMenu
 
Fields inherited from class javax.rad.genui.UIResource
uiResource
 
Fields inherited from interface javax.rad.model.ui.IControllable
COMMAND_DELETE, COMMAND_DUPLICATE, COMMAND_EDIT, COMMAND_EXPORT, COMMAND_FIRST, COMMAND_INSERT, COMMAND_INSERT_SUB, COMMAND_LAST, COMMAND_NEXT, COMMAND_PREVIOUS, COMMAND_RESTORE, COMMAND_SEARCH
 
Constructor Summary
protected AbstractControllable(C pComponent)
          Creates a new instance of AbstractControllable.
 
Method Summary
 void addNotify()
          Makes this UIComponent displayable by adding it to an UIContainer.
 void doCommand(String pCommand)
          Performs the command.
 void doDelete()
          Performs a delete on the current DataBook.
 void doDuplicate()
          Sends the duplicate action to all listeners.
 void doEdit()
          Starts editing.
 void doExport()
          Performs the CSV Export of the current DataBook.
 void doFirst()
          Performs an insert on the current DataBook.
 void doInsert()
          Performs an insert on the current DataBook.
 void doInsertSub()
          Performs an insert on the current DataBook.
 void doLast()
          Performs an insert on the current DataBook.
 void doNext()
          Performs an insert on the current DataBook.
 void doNotifyController()
          Notify the controller, that focus has changed.
 void doPrevious()
          Performs an insert on the current DataBook.
 void doRestore()
          Performs a delete on the current DataBook.
 void doSearch()
          Shows the search options.
 IController getController()
          Gets the IController for this IControllable.
 boolean isCommandEnabled(String pCommand)
          Gets true, if the command should be enabled.
 boolean isDeleteEnabled()
          True, if new should be enabled.
 boolean isDuplicateEnabled()
          Gets the duplicate button visibility.
 boolean isEditEnabled()
          Gets the edit button visibility.
 boolean isExportEnabled()
          Gets the duplicate button visibility.
 boolean isFirstEnabled()
          True, if first should be enabled.
 boolean isInsertEnabled()
          True, if new should be enabled.
 boolean isInsertSubEnabled()
          True, if new should be enabled.
 boolean isLastEnabled()
          True, if first should be enabled.
 boolean isNextEnabled()
          True, if first should be enabled.
 boolean isPreviousEnabled()
          True, if first should be enabled.
 boolean isRestoreEnabled()
          True, if new should be enabled.
 boolean isSearchEnabled()
          Gets the search button visibility.
 void removeNotify()
          Makes this UIComponent undisplayable by removing it to an UIContainer.
 void setController(IController pController)
          Sets the IController for this IControllable.
 
Methods inherited from class javax.rad.genui.UIComponent
beforeAddNotify, capture, createCellFormatter, createComponentName, createComponentNamePrefix, createNodeFormatter, debug, doEventKey, doTriggerPopMenu, error, eventComponentMoved, eventComponentResized, eventFocusGained, eventFocusLost, eventKey, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getComponentUIResource, getComponentUIResourceInsets, getCurrentTranslation, getCursor, getDefaultName, getEventSource, getExistingNames, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPopupMenu, getPreferredSize, getResource, getRootName, getSize, getStyle, getTabIndex, getToolTipText, getTranslation, incrementNameIfExists, info, invokeAndWait, invokeAndWait, invokeInThread, invokeInThread, invokeLater, invokeLater, isBackgroundSet, isBeforeNotified, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isNotified, isPreferredSizeSet, isTranslationChanged, isTranslationEnabled, isVisible, requestFocus, setBackground, setBounds, setBounds, setCursor, setDefaultName, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocation, setLocationRelativeTo, setMaximumSize, setMaximumSize, setMinimumSize, setMinimumSize, setName, setParent, setPopupMenu, setPreferredSize, setPreferredSize, setRootName, setSize, setSize, setStyle, setTabIndex, setToolTipText, setTranslation, setTranslationEnabled, setVisible, translate, updateTranslation
 
Methods inherited from class javax.rad.genui.UIResource
equals, getObject, getObjectNames, getUIResource, hashCode, putObject, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.model.ui.IControllable
getActiveDataBook
 

Constructor Detail

AbstractControllable

protected AbstractControllable(C pComponent)
Creates a new instance of AbstractControllable.

Parameters:
pComponent - the Component.
See Also:
IComponent
Method Detail

getController

public IController getController()
Gets the IController for this IControllable.

Specified by:
getController in interface IControllable
Returns:
the IController

setController

public void setController(IController pController)
Sets the IController for this IControllable.

Specified by:
setController in interface IControllable
Parameters:
pController - the IController

isCommandEnabled

public boolean isCommandEnabled(String pCommand)
Gets true, if the command should be enabled.

Specified by:
isCommandEnabled in interface IControllable
Parameters:
pCommand - the command
Returns:
true, if the command should be enabled.

doCommand

public void doCommand(String pCommand)
               throws Throwable
Performs the command.

Specified by:
doCommand in interface IControllable
Parameters:
pCommand - the command
Throws:
Throwable - if the command fails.

addNotify

public void addNotify()
Makes this UIComponent displayable by adding it to an UIContainer. This method is called internally by the genui and should not be called directly.

Overrides:
addNotify in class UIComponent<C extends IComponent>
See Also:
UIComponent.removeNotify(), UIComponent.isNotified()

removeNotify

public void removeNotify()
Makes this UIComponent undisplayable by removing it to an UIContainer.

This method is called by the genui internally and should not be called directly. Code overriding this method should call super.removeNotify as the first line of the overriding method.

Overrides:
removeNotify in class UIComponent<C extends IComponent>
See Also:
UIComponent.addNotify(), UIComponent.isNotified()

doNotifyController

public void doNotifyController()
Notify the controller, that focus has changed.


isFirstEnabled

public boolean isFirstEnabled()
True, if first should be enabled.

Returns:
True, if first should be enabled.

doFirst

public void doFirst()
             throws ModelException
Performs an insert on the current DataBook. (same level in hierarchy)

Throws:
ModelException - if an export error occurs

isLastEnabled

public boolean isLastEnabled()
True, if first should be enabled.

Returns:
True, if first should be enabled.

doLast

public void doLast()
            throws ModelException
Performs an insert on the current DataBook. (same level in hierarchy)

Throws:
ModelException - if an export error occurs

isPreviousEnabled

public boolean isPreviousEnabled()
True, if first should be enabled.

Returns:
True, if first should be enabled.

doPrevious

public void doPrevious()
                throws ModelException
Performs an insert on the current DataBook. (same level in hierarchy)

Throws:
ModelException - if an export error occurs

isNextEnabled

public boolean isNextEnabled()
True, if first should be enabled.

Returns:
True, if first should be enabled.

doNext

public void doNext()
            throws ModelException
Performs an insert on the current DataBook. (same level in hierarchy)

Throws:
ModelException - if an export error occurs

isInsertEnabled

public boolean isInsertEnabled()
True, if new should be enabled.

Returns:
True, if new should be enabled.

doInsert

public void doInsert()
              throws ModelException
Performs an insert on the current DataBook. (same level in hierarchy)

Throws:
ModelException - if an export error occurs

isInsertSubEnabled

public boolean isInsertSubEnabled()
True, if new should be enabled.

Returns:
True, if new should be enabled.

doInsertSub

public void doInsertSub()
                 throws ModelException
Performs an insert on the current DataBook. (same level in hierarchy)

Throws:
ModelException - if an export error occurs

isDeleteEnabled

public boolean isDeleteEnabled()
True, if new should be enabled.

Returns:
True, if new should be enabled.

doDelete

public void doDelete()
              throws ModelException
Performs a delete on the current DataBook.

Throws:
ModelException - if an export error occurs

isRestoreEnabled

public boolean isRestoreEnabled()
True, if new should be enabled.

Returns:
True, if new should be enabled.

doRestore

public void doRestore()
               throws ModelException
Performs a delete on the current DataBook.

Throws:
ModelException - if an export error occurs

isDuplicateEnabled

public boolean isDuplicateEnabled()
Gets the duplicate button visibility.

Returns:
true if visible, false otherwise

doDuplicate

public void doDuplicate()
                 throws ModelException
Sends the duplicate action to all listeners.

Throws:
ModelException - if an duplicate error occurs

isExportEnabled

public boolean isExportEnabled()
Gets the duplicate button visibility.

Returns:
true if visible, false otherwise

doExport

public void doExport()
              throws Throwable
Performs the CSV Export of the current DataBook.

Throws:
Throwable - if an export error occurs

isEditEnabled

public boolean isEditEnabled()
Gets the edit button visibility.

Returns:
true if visible, false otherwise

doEdit

public void doEdit()
            throws ModelException
Starts editing.

Throws:
ModelException - if an edit error occurs

isSearchEnabled

public boolean isSearchEnabled()
Gets the search button visibility.

Returns:
true if visible, false otherwise

doSearch

public void doSearch()
              throws ModelException
Shows the search options.

Throws:
ModelException - if an export error occurs


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.