[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
WorkplaceFunctionTree : Feature request for dynamic menues -> New method "getItemById"  XML
Forum Index -> Development
Author Message
brandt

Power User
[Avatar]

Joined: 12/03/2008 16:37:34
Messages: 45
Location: Bern
Offline

Hi Björn,

we want to have a dynamic menu tree in our application.

We want change the image and the text of an end node of the menu tree.

So i have an WorkplaceFunctionTree object and now i have to find the corresponding FunctionNode element, which i want to update (change image and text).

Unfortunately there is only the method "getItemByText()" to find/get a FunctionNode object within the menu tree.

WorkplaceFunctionTree menuTree = ...
FunctionNode fNode = menuTree.getFtree().getItemByText("_WHATEVER_");

So i have to find a FunctionNode by its text property.

What i would prefer, would be a method [ for instance getItemById ] to find a FunctionNode by its id.

What do you think about this ?

Regards Joe

Side remark:
FunctionNode fNode = ...
fNode.setImage(null);
When i set image = null for an function node element, then there is an empty space in front of the text and the text is indented to the right.
I would have expected that the text would not have been indented.
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5520
Offline

Hi Joachim,

well, but I believe you do not need me! ;-) You alreday know 85% of the details...:

1. menuTree.getFTree().getRootNode().getChildNodes() gives you the first level of function nodes. Each FunctionNode then has the "getChildNodes()" to get its children.

2. functionNode has the .getId()

So this is some recursion on the tree nodes...

Regards, Björn

Björn Müller, CaptainCasa GmbH
brandt

Power User
[Avatar]

Joined: 12/03/2008 16:37:34
Messages: 45
Location: Bern
Offline

Hi Björn,

thanks for your answer.

So i changed my code and made a "type-cast" from TreeItem to FunctionNode.

Works perfectly.

Regards
Joe

Code snippet:

List<FIXGRIDTreeItem> listTreeItem = menuTree.getFtree().getRootNode().getChildNodes();

for (FIXGRIDTreeItem treeItem : listTreeItem) {

FunctionNode fNode = (FunctionNode) treeItem;

.....
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team