|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.efaps.ui.wicket.models.AbstractInstanceObject
org.efaps.ui.wicket.models.objects.AbstractUIObject
org.efaps.ui.wicket.models.objects.AbstractUIPageObject
org.efaps.ui.wicket.models.objects.UIStructurBrowser
public class UIStructurBrowser
This class is used to provide the Model for the StructurBrowser for eFpas.
It is used in tow different cases. In one case it is a TreeTable, where the
Table will be provided with additional information in columns. In the other
case a Tree only.
The concept of this class is to provide a Model which connects through the
eFaps-kernel to the eFaps-DataBase and turn it to a Standard TreeModel from
javax.swing.tree. which will be used from the Component to
render the Tree and the Table. This leads to a very similar behavior of the
WebApp GUI to a swing GUI.
This model works asyncron. That means only the actually in the GUI rendered
Nodes (and Columns) will be retrieved from the eFaps-DataBase. The next level
in a tree will be retrieved on the expand of a TreeNode. To achieve this and
to be able to render expand-links for every node it will only be checked if
it is a potential parent (if it has children). In the case of expanding this
Node the children will be retrieved and rendered.
To access the eFaps-Database a esjp is used, which will be used in five
different cases. To distinguish the use of the esjp some extra Parameters
will be passed to the esjp when calling it.
| Nested Class Summary | |
|---|---|
class |
UIStructurBrowser.BogusNode
This class is used to add a ChildNode under a ParentNode, if the ParentNode actually has some children. |
static class |
UIStructurBrowser.ExecutionStatus
Enum is used to set for this UIStructurBrowser which status of execution it is in. |
| Field Summary | |
|---|---|
static String |
USERSESSIONKEY
Static part of the key to get the Information stored in the session in relation to this StruturBrowser. |
| Constructor Summary | |
|---|---|
|
UIStructurBrowser(org.apache.wicket.PageParameters _parameters)
Constructor. |
|
UIStructurBrowser(UUID _commandUUID,
String _instanceKey)
Standard constructor, if called this StructurBrowserModel will be defined as root. |
protected |
UIStructurBrowser(UUID _commandUUID,
String _instanceKey,
boolean _root,
org.efaps.admin.ui.AbstractCommand.SortDirection _sortdirection)
Internal constructor, it is used to set that this StructurBrowserModel is not a root. |
| Method Summary | |
|---|---|
void |
addBogusNode(DefaultMutableTreeNode _parent)
Method to add a new BogusNode to the given Node. |
void |
addChildren(DefaultMutableTreeNode _parent)
This method should be called to add children to a Node in the Tree. e.g. |
protected boolean |
checkForAllowChilds(org.efaps.db.Instance _instance)
This method is used to check if a node has potential children. |
boolean |
checkForAllowItems(org.efaps.db.Instance _instance)
This method is used to check if a node has potential children. |
protected boolean |
checkForChildren(org.efaps.db.Instance _instance)
This method is used to check if a node has potential children. |
void |
checkHideColumn4Row()
Method is called from the StructurBrowser in edit mode before rendering the columns for row to be able to hide the columns for different rows by setting the cell model to hide. |
void |
execute()
This method should be called to actually execute this StructurBrowserModel, that means to retrieve the values from the eFaps-DataBase, create the TreeModel etc. |
void |
executeListener(UIStructurBrowser.ExecutionStatus _status,
Map<String,String> _uiID2Oid)
This method is used to execute a listener with a specific event. |
protected void |
executeTree(Map<org.efaps.db.Instance,Boolean> _map,
boolean _expand)
This method is called in case of a Tree from the execute()method
to fill this StructurBrowserModel with live. |
protected void |
executeTreeTable(Map<org.efaps.db.Instance,Boolean> _map,
boolean _expand)
This method is called in case of a TreeTable from the execute()
method to fill this StructurBrowserModel with live. |
protected void |
expand(boolean _expand)
Expand the tree with the information from the Session. |
int |
getBrowserFieldIndex()
Getter method for the instance variable browserFieldIndex. |
String |
getBrowserFieldName()
This is the getter method for the instance variable browserFieldName. |
String |
getCacheKey()
This method generates the Key for a UserAttribute by using the UUID of the Command and the given static part, so that for every StruturBrowser a unique key for expand etc, is created. |
List<UIStructurBrowser> |
getChilds()
Getter method for instance variable childs. |
UIStructurBrowser |
getClone4New()
|
List<UIStructurBrowserTableCell> |
getColumns()
This is the getter method for the instance variable columns. |
UIStructurBrowserTableCell |
getColumnValue(int _index)
Get the Value of a Column identified by the index of the Column. |
Boolean |
getDirection()
This is the getter method for the instance variable direction. |
UIStructurBrowser.ExecutionStatus |
getExecutionStatus()
Getter method for instance variable executionStatus. |
List<UITableHeader> |
getHeaders()
This is the getter method for the instance variable headers. |
String |
getImage()
This is the getter method for the instance variable image. |
protected String |
getJavaScript4Target(Map<String,String[]> _parameters)
Method is called from the StructurBrowser in edit mode from setValuesFromUI(Map, DefaultMutableTreeNode) to get
additional JavaScript to be appended to the AjaxTarget. |
String |
getLabel()
Getter method for instance variable label. |
protected UIStructurBrowser |
getNewStructurBrowser(org.efaps.db.Instance _instance,
UIStructurBrowser _strucBrwsr)
Internal method to call a constructor, it is used to set that this StructurBrowserModel is not a root. |
protected org.efaps.admin.AbstractAdminObject |
getObject4Event()
Get the Admin Object that contains the events that must be executed. |
org.efaps.admin.ui.AbstractCommand.SortDirection |
getSortDirection()
Getter method for instance variable sortDirection. |
org.efaps.admin.ui.Table |
getTable()
This is the getter method for the instance variable #table. |
TreeModel |
getTreeModel()
Get the TreeModel used in the Component to construct the actual tree. |
protected org.efaps.admin.datamodel.Type |
getTypeFromEvent()
Method used to evaluate the type for this table from the connected events. |
boolean |
hasChilds()
Has this StructurBrowserModel childs. |
protected void |
initialise()
Method used to initialize this StructurBrowserModel. |
boolean |
isAllowChilds()
Getter method for the instance variable allowChilds. |
boolean |
isAllowItems()
Getter method for the instance variable allowItems. |
boolean |
isEditable()
In create or edit mode this StructurBrowser is editable. |
boolean |
isExpanded()
Getter method for instance variable expanded. |
boolean |
isForceExpanded()
Getter method for the instance variable forceExpanded. |
boolean |
isRoot()
Getter method for the instance variable root. |
boolean |
isShowCheckBoxes()
|
void |
requeryLabel()
This method is updating the Label, by querying the eFaps-DataBase. |
void |
resetModel()
Method to reset the Model. |
void |
setAllowChilds(boolean _allowChilds)
Setter method for instance variable allowChilds. |
void |
setAllowItems(boolean _allowItems)
Setter method for instance variable allowItems. |
protected void |
setBrowserFieldIndex(int _browserFieldIndex)
Setter method for instance variable browserFieldIndex. |
protected void |
setBrowserFieldName(String _browserFieldName)
Setter method for instance variable browserFieldName. |
void |
setDirection(Boolean _direction)
This is the setter method for the instance variable direction. |
protected void |
setExecutionStatus(UIStructurBrowser.ExecutionStatus _executionStatus)
Setter method for instance variable executionStatus. |
void |
setExpanded(boolean _expanded)
Setter method for instance variable expanded. |
protected void |
setForceExpanded(boolean _forceExpanded)
Setter method for instance variable forceExpanded. |
void |
setParent(boolean _parent)
This is the setter method for the instance variable parent. |
protected void |
setShowCheckBoxes(boolean _showCheckBoxes)
Setter method for instance variable showCheckBoxes. |
void |
setSortDirection(org.efaps.admin.ui.AbstractCommand.SortDirection _sortDirection)
Setter method for instance variable sortDirection and for all
children also. |
protected void |
setTableuuid(UUID _tableuuid)
Setter method for instance variable tableuuid. |
String |
setValuesFromUI(Map<String,String[]> _parameters,
DefaultMutableTreeNode _node)
|
void |
sort()
Method to sort this model and all child models. |
protected void |
sortModel()
Method to sort the data of this model. |
String |
toString()
(non-Javadoc). |
| Methods inherited from class org.efaps.ui.wicket.models.objects.AbstractUIPageObject |
|---|
addHidden, checkAccessToInstances, getAccessMap, getHelpTarget, getHiddenCells, getNewRandom, getTargetCmd, getTargetCmdUUID, getUiID2Oid, getValue4Wizard, getWizard, hasTargetCmd, isPartOfWizardCall, isRenderRevise, isTargetCmdRevise, isTargetShowFile, setPartOfWizardCall, setRenderRevise, setTargetCmdRevise, setTargetCmdUUID, setWizard |
| Methods inherited from class org.efaps.ui.wicket.models.objects.AbstractUIObject |
|---|
addEventObject, executeEvents, getCallingCommand, getCallingCommandUUID, getCommand, getCommand, getCommandUUID, getInstanceFromManager, getMenuTreeKey, getMode, getOpenerId, getTarget, getTitle, hasInstanceManager, isCreateMode, isEditMode, isInitialized, isPicker, isPrintMode, isSearchMode, isSubmit, isViewMode, setCallingCommandUUID, setCommandUUID, setInitialized, setMode, setOpenerId, setSubmit, validate |
| Methods inherited from class org.efaps.ui.wicket.models.AbstractInstanceObject |
|---|
getInstance, getInstanceKey, setInstanceKey |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String USERSESSIONKEY
| Constructor Detail |
|---|
public UIStructurBrowser(org.apache.wicket.PageParameters _parameters)
throws org.efaps.util.EFapsException
_parameters - Page parameters
org.efaps.util.EFapsException - on error
public UIStructurBrowser(UUID _commandUUID,
String _instanceKey)
throws org.efaps.util.EFapsException
_commandUUID - UUID of the calling command_instanceKey - oid
org.efaps.util.EFapsException - on error
protected UIStructurBrowser(UUID _commandUUID,
String _instanceKey,
boolean _root,
org.efaps.admin.ui.AbstractCommand.SortDirection _sortdirection)
throws org.efaps.util.EFapsException
_commandUUID - UUID of the command_instanceKey - OID_root - is this STrtucturbrowser the root_sortdirection - sort direction
org.efaps.util.EFapsException - on error| Method Detail |
|---|
protected UIStructurBrowser getNewStructurBrowser(org.efaps.db.Instance _instance,
UIStructurBrowser _strucBrwsr)
throws org.efaps.util.EFapsException
_instance - Instance_strucBrwsr - StructurBrowser the values will be copied from
org.efaps.util.EFapsException - on error
protected void initialise()
throws org.efaps.util.EFapsException
org.efaps.util.EFapsException - on errorpublic void execute()
#executeTree(List) or #executeTreeTable(List)
execute in class AbstractUIObject#executeTree(List),
#executeTreeTable(List)
protected void executeTree(Map<org.efaps.db.Instance,Boolean> _map,
boolean _expand)
execute()method
to fill this StructurBrowserModel with live.
_map - List of Object_expand - inside an expand
protected void executeTreeTable(Map<org.efaps.db.Instance,Boolean> _map,
boolean _expand)
execute()
method to fill this StructurBrowserModel with live.
_map - List of Objects_expand - inside an expandprotected void expand(boolean _expand)
_expand - is this inside an expandprotected void sortModel()
public void sort()
public UIStructurBrowser getClone4New()
throws org.efaps.util.EFapsException
org.efaps.util.EFapsException - on errorpublic boolean isForceExpanded()
forceExpanded.
forceExpandedprotected void setForceExpanded(boolean _forceExpanded)
forceExpanded.
_forceExpanded - value for instance variable forceExpandedpublic boolean isAllowChilds()
allowChilds.
allowChildspublic void setAllowChilds(boolean _allowChilds)
allowChilds.
_allowChilds - value for instance variable allowChildspublic boolean isAllowItems()
allowItems.
allowItemspublic void setAllowItems(boolean _allowItems)
allowItems.
_allowItems - value for instance variable allowItems
protected org.efaps.admin.datamodel.Type getTypeFromEvent()
throws org.efaps.util.EFapsException
org.efaps.util.EFapsException - on errorpublic void checkHideColumn4Row()
public void addChildren(DefaultMutableTreeNode _parent)
_parent - the DefaultMutableTreeNode the new children should be
addedprotected boolean checkForAllowChilds(org.efaps.db.Instance _instance)
_instance - Instance of a Node to be checked
public void executeListener(UIStructurBrowser.ExecutionStatus _status,
Map<String,String> _uiID2Oid)
_status - status to be executed_uiID2Oid - UI Id 2 Oid mappingpublic boolean checkForAllowItems(org.efaps.db.Instance _instance)
_instance - Instance of a Node to be checked
protected boolean checkForChildren(org.efaps.db.Instance _instance)
_instance - Instance of a Node to be checked
protected String getJavaScript4Target(Map<String,String[]> _parameters)
setValuesFromUI(Map, DefaultMutableTreeNode) to get
additional JavaScript to be appended to the AjaxTarget.
_parameters - Parameter as send from the UserInterface
public void setParent(boolean _parent)
parent.
_parent - the parent to setpublic void resetModel()
resetModel in class AbstractUIObjectorg.efaps.ui.wicket.models.AbstractModel#resetModel()public org.efaps.admin.ui.Table getTable()
#table.
#table#tablepublic boolean hasChilds()
public TreeModel getTreeModel()
addNode(DefaultMutableTreeNode, List)
public String setValuesFromUI(Map<String,String[]> _parameters,
DefaultMutableTreeNode _node)
throws org.efaps.util.EFapsException
_parameters - Parameter as send from the UserInterface_node - Node the _parameters were send from
org.efaps.util.EFapsException - on errorpublic UIStructurBrowserTableCell getColumnValue(int _index)
_index - index of the Column
public List<UIStructurBrowserTableCell> getColumns()
columns.
columnsprotected void setBrowserFieldName(String _browserFieldName)
browserFieldName.
_browserFieldName - value for instance variable browserFieldNameprotected void setTableuuid(UUID _tableuuid)
tableuuid.
_tableuuid - value for instance variable tableuuidprotected void setBrowserFieldIndex(int _browserFieldIndex)
browserFieldIndex.
_browserFieldIndex - value for instance variable browserFieldIndexpublic int getBrowserFieldIndex()
browserFieldIndex.
browserFieldIndexpublic String getBrowserFieldName()
browserFieldName.
browserFieldNamepublic List<UITableHeader> getHeaders()
headers.
headerspublic String getImage()
image.
imagepublic Boolean getDirection()
direction.
directionpublic void setDirection(Boolean _direction)
direction.
_direction - the direction to setpublic UIStructurBrowser.ExecutionStatus getExecutionStatus()
executionStatus.
executionStatuspublic void requeryLabel()
public void addBogusNode(DefaultMutableTreeNode _parent)
_parent - Parent a BogusNode should be addedpublic List<UIStructurBrowser> getChilds()
childs.
childspublic String getLabel()
label.
labelpublic org.efaps.admin.ui.AbstractCommand.SortDirection getSortDirection()
sortDirection.
sortDirectionpublic void setSortDirection(org.efaps.admin.ui.AbstractCommand.SortDirection _sortDirection)
sortDirection and for all
children also.
_sortDirection - value for instance variable sortDirectionpublic boolean isExpanded()
expanded.
expandedpublic void setExpanded(boolean _expanded)
expanded.
_expanded - value for instance variable expandedpublic String getCacheKey()
protected void setExecutionStatus(UIStructurBrowser.ExecutionStatus _executionStatus)
executionStatus.
_executionStatus - value for instance variable executionStatusprotected org.efaps.admin.AbstractAdminObject getObject4Event()
public boolean isRoot()
root.
rootpublic boolean isShowCheckBoxes()
showCheckBoxesprotected void setShowCheckBoxes(boolean _showCheckBoxes)
showCheckBoxes.
_showCheckBoxes - value for instance variable showCheckBoxespublic boolean isEditable()
public String toString()
toString in class ObjectModel.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||