Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Riena » Dynamic Module / SubModule After Program Start (createModel)?
Dynamic Module / SubModule After Program Start (createModel)? [message #692634] Mon, 04 July 2011 22:16 Go to next message
rrathsam is currently offline rrathsamFriend
Messages: 3
Registered: July 2011
Junior Member
Hi All,

First off wanted to say thanks for such a great framework, I've really enjoyed working with it so far. Had a question though. Is there a way to modify / add a Module / SubModule after the createModel() method has run?

An example would be something such as:

- User starts program
- User selects an action "Open Folder" (Could be a menu item, could be an ActionBar item)
- User selects a folder
- Process runs to parse contents of folder and build a module / subModule hierarchy.
- Process then adds the newly created hierarchy to the subApp.
- Screen is updated and the newly created module / submodule hierarchy is shown to the user.

Thanks so much in advance!

Ryan
Re: Dynamic Module / SubModule After Program Start (createModel)? [message #692741 is a reply to message #692634] Tue, 05 July 2011 06:53 Go to previous messageGo to next message
Sabine Achilles is currently offline Sabine AchillesFriend
Messages: 4
Registered: July 2009
Junior Member
Hi Ryan,

I don't know if this is what you're looking for, but every INavigationNode in Riena has a method addChild(..) which allows you to dynamically add Nodes to the model.

I'd suggest to have a look at the Riena Example Client:
wiki.eclipse.org/index.php?title=Riena/Examples#Run_the_Riena_Example_Client

For your example you will probably need to add a new Extension Point org.eclipse.riena.navigation.assemblies2 and add the Module as well as some SubModules. This assembly won't be added to the navigation model right away, but you can programmatically create an IModuleNode with the same nodeId you gave the one in the EP and add it as a child of some already existing ModuleGroup.
Another way would be to use the WorkareaManager to programmatically register new Nodes (no need for the assembly if you do it this way).
You should also have a look at our wiki site about the Riena navigation concept: wiki.eclipse.org/Riena/Navigation

Things that could propably help you:
- ApplicationNodeManager (static access to nodes in your model)
- INavigationNode#findNode(...)
- INavigationNode#getParentOfType(...)

Greetings
Sabine
Re: Dynamic Module / SubModule After Program Start (createModel)? [message #693476 is a reply to message #692741] Wed, 06 July 2011 14:31 Go to previous messageGo to next message
rrathsam is currently offline rrathsamFriend
Messages: 3
Registered: July 2011
Junior Member
Hi Sabine,

Thanks so much for getting back to me, I just checked out the example client and the email example application and the solution was right there staring me in the face. It was just as you described (Using the ApplicationNodeManager to retrieve the ApplicationNode -> .findNode() to get the ModuleGroupNode -> Perform dynamic adding of Modules / SubModules from there.). Something that I did notice was that I had to add a Module to the moduleGroup (In the createModel method) before any dynamically added modules would show up. You wouldn't happen to know if this is just because of the way I'm going about things? or by design?

Thanks so much again for your help!

Ryan
Re: Dynamic Module / SubModule After Program Start (createModel)? [message #694203 is a reply to message #692634] Fri, 08 July 2011 05:36 Go to previous message
Sabine Achilles is currently offline Sabine AchillesFriend
Messages: 4
Registered: July 2009
Junior Member
Hi Ryan,

don't worry, you always have to add a Module to a ModuleGroup by design. The Riena navigation tree hierarchy is always: Application->SubApplication->ModuleGroup->Module->SubModule. So it is not possible to add a Module directly to a SubApplication.
But you don't have to do it in the createModel method. You can do it in your ActionHandler where you also added the Module and SubModule.
If you used the method of declaring the nodes in the extension point (..assemblies2) you should just begin with the ModuleGroup there. E.g.

  • org.eclipse.riena.navigation.assemblies2

    • assembly2

      • myModuleGroup

        • myModule

          • mySubModule


Greetings
Sabine
Previous Topic:JavaMagazin 8.2011 with article mentioning Riena
Next Topic:Blocking/unclickable Subapplication tab
Goto Forum:
  


Current Time: Fri Apr 19 21:07:56 GMT 2024

Powered by FUDForum. Page generated in 0.03215 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top