javax.rad.genui.control
Class UITree

java.lang.Object
  extended by javax.rad.genui.UIResource<C>
      extended by javax.rad.genui.UIComponent<C>
          extended by javax.rad.genui.control.AbstractControllable<ITree>
              extended by javax.rad.genui.control.UITree
All Implemented Interfaces:
IControl, IControllable, ITranslatable, ITreeControl, ICellFormatable, ITree, IComponent, IResource, INamedObject, ITranslator

public class UITree
extends AbstractControllable<ITree>
implements ITree

Platform and technology independent Tree. It is designed for use with AWT, Swing, SWT, JSP, JSF, ... .


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
  UITree()
          Creates a new instance of UITree.
  UITree(IDataBook... pDataBooks)
          Creates a new instance of UITree.
protected UITree(ITree pTree)
          Creates a new instance of UITree with the given tree.
 
Method Summary
 void cancelEditing()
          Informs the GUI control, that the last edit should be canceled(restored) the correct value is in the DataBook.
protected  java.lang.String createComponentName()
          Creates a name for this UIComponent.
 IDataBook getActiveDataBook()
          Gets the active data book.
 ICellFormatter getCellFormatter()
          Gets the ICellFormatter.
 IDataBook[] getDataBooks()
          Returns the DataBooks displayed by this control.
 INodeFormatter getNodeFormatter()
          Gets the node formatter.
 boolean isDetectEndNode()
          Gets if a node should be detected to be an end node or not.
 boolean isEditable()
          Gets if editable or not.
 boolean isMouseEventOnSelectedCell()
          True, if the mouse event occured on current selected cell.
 void notifyRepaint()
          The control need to check if the part is visible and then repaint the part.
 void saveEditing()
          Informs the GUI control, that the last edit should be set into the IDataBook or IDataRow.
 void setCellFormatter(ICellFormatter pCellFormatter)
          Sets the ICellFormatter.
 void setCellFormatter(java.lang.Object pCellFormatter, java.lang.String pMethodName)
          Sets the cell formatter.
 void setDataBooks(IDataBook... pDataBooks)
          Sets the DataBooks displayed by this control.
 void setDetectEndNode(boolean pDetectEndNode)
          Sets if a node should be detected to be an end node or not.
 void setEditable(boolean pEditable)
          Sets if editable or not.
 void setNodeFormatter(INodeFormatter pNodeFormatter)
          Sets the node formatter.
 void setNodeFormatter(java.lang.Object pNodeFormatter, java.lang.String pMethodName)
          Sets the node formatter.
 void startEditing()
          Informs the GUI control, that the editor should be opened.
 void updateTranslation()
          Notification for updating the translation.
 
Methods inherited from class javax.rad.genui.control.AbstractControllable
addNotify, createCellFormatter, createNodeFormatter, doCommand, doDelete, doDuplicate, doEdit, doExport, doFirst, doInsert, doInsertSub, doLast, doNext, doNotifyController, doPrevious, doRestore, doSearch, getController, isCommandEnabled, isDeleteEnabled, isDuplicateEnabled, isEditEnabled, isExportEnabled, isFirstEnabled, isInsertEnabled, isInsertSubEnabled, isLastEnabled, isNextEnabled, isPreviousEnabled, isRestoreEnabled, isSearchEnabled, removeNotify, setController
 
Methods inherited from class javax.rad.genui.UIComponent
beforeAddNotify, 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.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.model.ui.ITranslatable
getTranslation, isTranslationEnabled, setTranslation, setTranslationEnabled
 
Methods inherited from interface javax.rad.util.ITranslator
translate
 

Constructor Detail

UITree

public UITree()
Creates a new instance of UITree.

See Also:
ITree

UITree

protected UITree(ITree pTree)
Creates a new instance of UITree with the given tree.

Parameters:
pTree - the tree
See Also:
ITree

UITree

public UITree(IDataBook... pDataBooks)
Creates a new instance of UITree.

Parameters:
pDataBooks - the data books.
See Also:
setDataBooks(IDataBook...)
Method Detail

getDataBooks

public IDataBook[] getDataBooks()
Returns the DataBooks displayed by this control.

Specified by:
getDataBooks in interface ITreeControl
Returns:
the DataBooks.
See Also:
ITreeControl.setDataBooks(javax.rad.model.IDataBook...)

setDataBooks

public void setDataBooks(IDataBook... pDataBooks)
Sets the DataBooks displayed by this control.

Specified by:
setDataBooks in interface ITreeControl
Parameters:
pDataBooks - the DataBooks
See Also:
ITreeControl.getDataBooks()

getActiveDataBook

public IDataBook getActiveDataBook()
Gets the active data book.

Specified by:
getActiveDataBook in interface IControllable
Specified by:
getActiveDataBook in interface ITreeControl
Returns:
the active data book.

isDetectEndNode

public boolean isDetectEndNode()
Gets if a node should be detected to be an end node or not. Depending on the used model, the detection can cause additional client server communication.

Specified by:
isDetectEndNode in interface ITree
Returns:
true, if end node detection is enabled.

setDetectEndNode

public void setDetectEndNode(boolean pDetectEndNode)
Sets if a node should be detected to be an end node or not. Depending on the used model, the detection can cause additional client server communication.

Specified by:
setDetectEndNode in interface ITree
Parameters:
pDetectEndNode - true, if end node detection is enabled.

isEditable

public boolean isEditable()
Gets if editable or not.

Specified by:
isEditable in interface ITree
Returns:
if editable or not.

setEditable

public void setEditable(boolean pEditable)
Sets if editable or not.

Specified by:
setEditable in interface ITree
Parameters:
pEditable - if editable or not.

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

startEditing

public void startEditing()
Informs the GUI control, that the editor should be opened.

Specified by:
startEditing in interface ITreeControl

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.

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

getCellFormatter

public ICellFormatter getCellFormatter()
Gets the ICellFormatter.

The ICellFormatter will be called for every cell and can return a style for that cell.

Specified by:
getCellFormatter in interface ICellFormatable
Returns:
the ICellFormatter.
See Also:
ICellFormatable.setCellFormatter(ICellFormatter)

setCellFormatter

public void setCellFormatter(ICellFormatter pCellFormatter)
Sets the ICellFormatter.

The ICellFormatter will be called for every cell and can return a style for that cell.

Specified by:
setCellFormatter in interface ICellFormatable
Parameters:
pCellFormatter - the ICellFormatter.
See Also:
ICellFormatable.getCellFormatter()

setCellFormatter

public void setCellFormatter(java.lang.Object pCellFormatter,
                             java.lang.String pMethodName)
Sets the cell formatter.

Parameters:
pCellFormatter - the cell formatter.
pMethodName - the method name.

getNodeFormatter

public INodeFormatter getNodeFormatter()
Gets the node formatter.

Specified by:
getNodeFormatter in interface ITree
Returns:
the node formatter.

setNodeFormatter

public void setNodeFormatter(INodeFormatter pNodeFormatter)
Sets the node formatter.

Specified by:
setNodeFormatter in interface ITree
Parameters:
pNodeFormatter - the node formatter.

setNodeFormatter

public void setNodeFormatter(java.lang.Object pNodeFormatter,
                             java.lang.String pMethodName)
Sets the node formatter.

Parameters:
pNodeFormatter - the node formatter.
pMethodName - the method name.

isMouseEventOnSelectedCell

public boolean isMouseEventOnSelectedCell()
True, if the mouse event occured on current selected cell.

Specified by:
isMouseEventOnSelectedCell in interface ITree
Returns:
True, if the mouse event occured on current selected cell.

updateTranslation

public void updateTranslation()
Notification for updating the translation. This method will be called when the UIComponent will be added to a displayable containment hierarchy, when its containment hierarchy is made displayable or the translation table will be changed.

Overrides:
updateTranslation in class UIComponent<ITree>
See Also:
UIComponent.setTranslation(TranslationMap), UIComponent.addNotify()

createComponentName

protected java.lang.String createComponentName()
Creates a name for this UIComponent. The returned name needs to be unique in the current root/workscreen and is ideally, but not necessarily, prefixed with the UIComponent.sRootName, if there is any. Overriding classes should be aware that this method will be called in UIComponent.addNotify() and the returned name will only be assigned to the UIComponent if there isn't already a name set. Also UIComponent.stExistingNames can be used to find out if a name has already been assigned, and UIComponent.sRootName to get the root name. In rare cases UIComponent.stExistingNames and/or UIComponent.sRootName might be null when this method is called.

Overrides:
createComponentName in class UIComponent<ITree>
Returns:
a unique name for this UIComponent.
See Also:
UIComponent.getExistingNames(), UIComponent.getRootName(), UIComponent.incrementNameIfExists(String, Set, boolean)


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.