javax.rad.application.genui
Class ControllerContent

java.lang.Object
  extended by javax.rad.genui.UIResource<C>
      extended by javax.rad.genui.UIComponent<C>
          extended by javax.rad.genui.UIContainer<IPanel>
              extended by javax.rad.genui.container.UIPanel
                  extended by javax.rad.application.genui.Content
                      extended by javax.rad.application.genui.ControllerContent
All Implemented Interfaces:
IContent, IControl, IControllable, IController, ITranslatable, IPanel, IComponent, IContainer, IResource, INamedObject, ITranslator
Direct Known Subclasses:
Application, WorkScreen

public class ControllerContent
extends Content
implements IController, IControllable, IControl

The ControllerContent is the default IController implementation and extends an Content.


Field Summary
 
Fields inherited from class javax.rad.genui.container.UIPanel
imgBack
 
Fields inherited from class javax.rad.genui.UIContainer
allComponents, components
 
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.IController
PROPERTY_SEARCH_VISIBLE
 
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
ControllerContent()
          Creates a new instance of ControllerContent.
 
Method Summary
 void addNotify()
          Makes this UIComponent displayable by adding it to an UIContainer.
 void cancelEditing()
          Informs the GUI control, that the last edit should be canceled(restored) the correct value is in the DataBook.
 void doActiveControlChanged()
          This Method is invoked, if the active controllable control has changed.
 void doActiveControllableChanged()
          This Method is invoked, if the active controllable has changed.
 void doActiveDataBookChanged()
          This Method is invoked, if the active data book has changed.
 void doCommand(java.lang.String pCommand)
          Performs the command.
 void doConfigureCommandButtons()
          This Method is invoked, when the data book has been changed, and the buttons have to be configured.
 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()
          Selects the first row in the current DataBook.
 void doInsert()
          Performs an insert on the current DataBook.
 void doInsertSub()
          Performs an insert on the sub DataBook.
 void doLast()
          Selects the last row in the current DataBook.
 void doNext()
          Selects the next row in the current DataBook.
 void doNotifyController()
          Notify the controller, that focus has changed.
 void doPrevious()
          Selects the previous row in the current DataBook.
 void doRestore()
          Performs a restore on the current DataBook.
 void doSearch()
          Shows the search options.
 IControllable getActiveControl()
          Gets the real control that caused the focus event.
 IControllable getActiveControllable()
          Gets the active IControllable that should be controlled by this IController.
 IDataBook getActiveDataBook()
          Gets the controllable IDataBook for this IControllable.
 java.util.List<IActionComponent> getCommandButtons(java.lang.String pCommand)
          Gets the registered button for the given command, or null otherwise.
 IController getController()
          Gets the IController for this IControllable.
 java.lang.Object getControllerProperty(java.lang.String pName)
          Gets the current value for a controller property.
 java.lang.String[] getRegisteredCommands()
          Gets all registered commands.
 boolean isCommandEnabled(java.lang.String pCommand)
          Gets true, if the command should be enabled.
 boolean isDeleteEnabled()
          True, if delete should be enabled.
 boolean isDuplicateEnabled()
          Gets the duplicate button visibility.
 boolean isEditEnabled()
          Gets the edit button visibility.
 boolean isExportEnabled()
          Gets the export button visibility.
 boolean isFirstEnabled()
          True, if first should be enabled.
 boolean isInsertEnabled()
          True, if new should be enabled.
 boolean isInsertSubEnabled()
          True, if new sub should be enabled.
 boolean isLastEnabled()
          True, if last should be enabled.
 boolean isNextEnabled()
          True, if next should be enabled.
 boolean isPreviousEnabled()
          True, if previous should be enabled.
 boolean isRestoreEnabled()
          True, if restore should be enabled.
 boolean isSearchEnabled()
          Gets the search button visibility.
 void notifyRepaint()
          The control need to check if the part is visible and then repaint the part.
 void registerCommandButton(java.lang.String pCommand, IActionComponent pButton)
          Registers a command button.
 void removeNotify()
          Makes this UIComponent undisplayable by removing it to an UIContainer.
 void saveEditing()
          Informs the GUI control, that the last edit should be set into the IDataBook or IDataRow.
 void setActiveControllable(IControllable pActiveControllable)
          Sets the active IControllable that should be controlled by this IController.
 void setController(IController pController)
          Sets the IController for this IControllable.
 void setControllerProperty(java.lang.String pName, java.lang.Object pValue)
          Sets a property for the controller.
 void unregisterAllCommandButtons()
          Unregisters all command buttons.
 void unregisterCommandButton(java.lang.String pCommand)
          Unregisters a command button.
 void unregisterCommandButton(java.lang.String pCommand, IActionComponent pButton)
          Unregisters a command button.
 
Methods inherited from class javax.rad.application.genui.Content
createComponentName, getOpener, isDestroyed, notifyDestroy, notifyVisible, setOpener
 
Methods inherited from class javax.rad.genui.container.UIPanel
getBackgroundImage, setBackgroundImage
 
Methods inherited from class javax.rad.genui.UIContainer
add, add, add, add, addInternal, beforeAddNotify, checkAdd, contains, getComponent, getComponentCount, getComponents, getInsets, getLayout, getUIResourceContainer, indexOf, remove, remove, removeAll, removeInternal, setLayout, setUIResourceContainer, setZOrder, updateTranslation
 
Methods inherited from class javax.rad.genui.UIComponent
capture, createComponentNamePrefix, debug, doEventKey, doTriggerPopMenu, equals, error, eventComponentMoved, eventComponentResized, eventFocusGained, eventFocusLost, eventKey, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getComponentUIResource, getCurrentTranslation, getCursor, getDefaultName, getEventSource, getExistingNames, getFactory, getFont, getForeground, getLocation, getLocationOffset, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPopupMenu, getPreferredSize, getResource, getRootName, getSize, getStyle, getTabIndex, getToolTipText, getTranslation, getUIComponent, hashCode, 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, setUIComponent, setVisible, translate
 
Methods inherited from class javax.rad.genui.UIResource
eventResourceChanged, eventResourceChanged, fireResourceChanged, getObject, getObjectNames, getUIResource, hasResourceHandler, 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.ITranslatable
getTranslation, isTranslationEnabled, setTranslation, setTranslationEnabled
 
Methods inherited from interface javax.rad.util.ITranslator
translate
 
Methods inherited from interface javax.rad.ui.IComponent
capture, eventComponentMoved, eventComponentResized, eventFocusGained, eventFocusLost, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getStyle, getTabIndex, getToolTipText, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, requestFocus, setBackground, setBounds, setCursor, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setStyle, setTabIndex, setToolTipText, setVisible
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 
Methods inherited from interface javax.rad.ui.IContainer
add, add, add, add, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, setLayout
 

Constructor Detail

ControllerContent

public ControllerContent()
Creates a new instance of ControllerContent.

Method Detail

getActiveControllable

public IControllable getActiveControllable()
Gets the active IControllable that should be controlled by this IController.

Specified by:
getActiveControllable in interface IController
Returns:
the active IControllable

setActiveControllable

public void setActiveControllable(IControllable pActiveControllable)
Sets the active IControllable that should be controlled by this IController.

Specified by:
setActiveControllable in interface IController
Parameters:
pActiveControllable - the current IControllable

setControllerProperty

public void setControllerProperty(java.lang.String pName,
                                  java.lang.Object pValue)
Sets a property for the controller.

Specified by:
setControllerProperty in interface IController
Parameters:
pName - the property name
pValue - the value. If the value is null the property will be removed

getControllerProperty

public java.lang.Object getControllerProperty(java.lang.String pName)
Gets the current value for a controller property.

Specified by:
getControllerProperty in interface IController
Parameters:
pName - the property name
Returns:
the value or null if the property was not found

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

getActiveDataBook

public IDataBook getActiveDataBook()
Gets the controllable IDataBook for this IControllable. IEditorControl should return the set data row, if it is instanceof IDataBook or null otherwise. ITableControl should return the set data book. ITreeControl should return the data book of the current selected node. The controller has to be informed, If the databook changes on a focused IControllable. eg: ITreeControl node selection of a different databook. Editor or table has the focus, and a different databook is set on editor or table.

Specified by:
getActiveDataBook in interface IControllable
Returns:
the controllable IDataBook

isCommandEnabled

public boolean isCommandEnabled(java.lang.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(java.lang.String pCommand)
               throws java.lang.Throwable
Performs the command.

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

cancelEditing

public void cancelEditing()
Informs the GUI control, that the last edit should be canceled(restored) the correct value is in the DataBook.

Specified by:
cancelEditing in interface IControl

notifyRepaint

public void notifyRepaint()
The control need to check if the part is visible and then repaint the part. Notify repaint is called on every change. The IControl has to catch the change, and return immediate. The change analysis and display has to be done with invoke later by the control.

Specified by:
notifyRepaint in interface IControl

saveEditing

public void saveEditing()
                 throws ModelException
Informs the GUI control, that the last edit should be set into the IDataBook or IDataRow.

Specified by:
saveEditing in interface IControl
Throws:
ModelException - if the value can not be stored.

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 Content
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 UIContainer<IPanel>
See Also:
UIComponent.addNotify(), UIComponent.isNotified()

registerCommandButton

public void registerCommandButton(java.lang.String pCommand,
                                  IActionComponent pButton)
Registers a command button. The registered command buttons are default enabled or disabled in doConfigureCommandButtons.

Parameters:
pCommand - the command
pButton - the button

unregisterCommandButton

public void unregisterCommandButton(java.lang.String pCommand,
                                    IActionComponent pButton)
Unregisters a command button. The registered command buttons are default enabled or disabled in doConfigureCommandButtons.

Parameters:
pCommand - the command
pButton - the button

unregisterCommandButton

public void unregisterCommandButton(java.lang.String pCommand)
Unregisters a command button. The registered command buttons are default enabled or disabled in doConfigureCommandButtons.

Parameters:
pCommand - the command

unregisterAllCommandButtons

public void unregisterAllCommandButtons()
Unregisters all command buttons. The registered command buttons are default enabled or disabled in doConfigureCommandButtons.


getRegisteredCommands

public java.lang.String[] getRegisteredCommands()
Gets all registered commands. The registered command buttons are default enabled or disabled in doConfigureCommandButtons.

Returns:
all registered commands.

getCommandButtons

public java.util.List<IActionComponent> getCommandButtons(java.lang.String pCommand)
Gets the registered button for the given command, or null otherwise. The registered command buttons are default enabled or disabled in doConfigureCommandButtons.

Parameters:
pCommand - the command
Returns:
the button

getActiveControl

public IControllable getActiveControl()
Gets the real control that caused the focus event.

Returns:
the real control that caused the focus event.

doNotifyController

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


doActiveControllableChanged

public void doActiveControllableChanged()
                                 throws java.lang.Throwable
This Method is invoked, if the active controllable has changed.

Throws:
java.lang.Throwable - if it fails

doActiveControlChanged

public void doActiveControlChanged()
                            throws java.lang.Throwable
This Method is invoked, if the active controllable control has changed.

Throws:
java.lang.Throwable - if it fails

doActiveDataBookChanged

public void doActiveDataBookChanged()
                             throws java.lang.Throwable
This Method is invoked, if the active data book has changed.

Throws:
java.lang.Throwable - if it fails

doConfigureCommandButtons

public void doConfigureCommandButtons()
                               throws java.lang.Throwable
This Method is invoked, when the data book has been changed, and the buttons have to be configured.

Throws:
java.lang.Throwable - if it fails

isFirstEnabled

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

Returns:
True, if first should be enabled.

doFirst

public void doFirst()
             throws java.lang.Throwable
Selects the first row in the current DataBook. (same level in hierarchy)

Throws:
java.lang.Throwable - if the row cannot be selected

isLastEnabled

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

Returns:
True, if last should be enabled.

doLast

public void doLast()
            throws java.lang.Throwable
Selects the last row in the current DataBook. (same level in hierarchy)

Throws:
java.lang.Throwable - if the last row cannot be selected

isPreviousEnabled

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

Returns:
True, if first should be enabled.

doPrevious

public void doPrevious()
                throws java.lang.Throwable
Selects the previous row in the current DataBook. (same level in hierarchy)

Throws:
java.lang.Throwable - if the previous row cannot be selected

isNextEnabled

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

Returns:
True, if next should be enabled.

doNext

public void doNext()
            throws java.lang.Throwable
Selects the next row in the current DataBook. (same level in hierarchy)

Throws:
java.lang.Throwable - if the next row cannot be selected

isInsertEnabled

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

Returns:
True, if new should be enabled.

doInsert

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

Throws:
java.lang.Throwable - if insert is not possible

isInsertSubEnabled

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

Returns:
True, if new sub should be enabled.

doInsertSub

public void doInsertSub()
                 throws java.lang.Throwable
Performs an insert on the sub DataBook. (next level in hierarchy)

Throws:
java.lang.Throwable - if insert in the sub is not possible

isDeleteEnabled

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

Returns:
True, if delete should be enabled.

doDelete

public void doDelete()
              throws java.lang.Throwable
Performs a delete on the current DataBook.

Throws:
java.lang.Throwable - if delete is not possible

isRestoreEnabled

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

Returns:
True, if restore should be enabled.

doRestore

public void doRestore()
               throws java.lang.Throwable
Performs a restore on the current DataBook.

Throws:
java.lang.Throwable - if restore is not possible

isDuplicateEnabled

public boolean isDuplicateEnabled()
Gets the duplicate button visibility.

Returns:
true if visible, false otherwise

doDuplicate

public void doDuplicate()
                 throws java.lang.Throwable
Sends the duplicate action to all listeners.

Throws:
java.lang.Throwable - if an export error occurs

isExportEnabled

public boolean isExportEnabled()
Gets the export button visibility.

Returns:
true if visible, false otherwise

doExport

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

Throws:
java.lang.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 java.lang.Throwable
Starts editing.

Throws:
java.lang.Throwable - if an export error occurs

isSearchEnabled

public boolean isSearchEnabled()
Gets the search button visibility.

Returns:
true if visible, false otherwise

doSearch

public void doSearch()
              throws java.lang.Throwable
Shows the search options.

Throws:
java.lang.Throwable - if an export error occurs


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.