Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Riena » how-to change default submodule within module?
how-to change default submodule within module? [message #902943] Tue, 21 August 2012 06:46 Go to next message
Christian Stellwag is currently offline Christian Stellwag
Messages: 48
Registered: July 2009
Location: Munich
Member
Hello Group Members,

I have modules with certain submodules within the navigation part on the left side of the Riena application.
Default-wise when i click on / open a module, the view backing the first submodule is opened.

But in one case i want to change this default behavior and have the second submodule selected on opening the module thus opening corresponding view for it.

Since I didn't find a solution anywhere, is it possible at all?
If yes, how can i accomplish it?

Thanks,
Chris

[Updated on: Tue, 21 August 2012 06:47]

Report message to a moderator

Re: how-to change default submodule within module? [message #902950 is a reply to message #902943] Tue, 21 August 2012 07:39 Go to previous messageGo to next message
Thorsten Schenkel is currently offline Thorsten Schenkel
Messages: 15
Registered: July 2009
Junior Member
Hello Chris,

you can write your own ModuleController that implements your wanted functionality.
Inside your ModuleController-implementation you can add a listener to the node of the module and after the module is activated you can activate another sub-module.

Here is a very simple example:
private class Second extends SWTModuleController {
	public Second(final IModuleNode navigationNode) {
	super(navigationNode);
		navigationNode.addListener(new ModuleNodeListener() {
		@Override
		public void afterActivated(final IModuleNode source) {
			super.afterActivated(source);
			final List<ISubModuleNode> children = source.getChildren();
			if (children.size() >= 1) {
				children.get(1).activate();
			}
		}
	});
}


(Note: Extend SWTModuleController and not ModuleController)

You must add your new ModuleController to the ModuleNode.

Example:
IModuleNode playgroundModule = new ModuleNode(new NavigationNodeId("playgroundModule"), "Playground");
playgroundModule.setNavigationNodeController(new Second(playgroundModule));


This will only works, if you uses NavigationAssembler. It isn't possible with the assemblies2 extension points (org.eclipse.riena.navigation.assemblies2).

I hope this explanation helps to solve your problem.

Greetings,
Thorsten
Re: how-to change default submodule within module? [message #902959 is a reply to message #902950] Tue, 21 August 2012 08:19 Go to previous messageGo to next message
Christian Stellwag is currently offline Christian Stellwag
Messages: 48
Registered: July 2009
Location: Munich
Member

Thank you very much for this solution and your quick answer, Thorsten.

Unfortunately we are using assembly2 since we have several modules representing business partners.
Is there an alternate solution for assembly2?
Is it possible to replace NavigationProcessor and would that lead to a solution?

Best regards,
Chris
Re: how-to change default submodule within module? [message #902967 is a reply to message #902959] Tue, 21 August 2012 08:51 Go to previous message
Christian Stellwag is currently offline Christian Stellwag
Messages: 48
Registered: July 2009
Location: Munich
Member
FYI,

unexpectedly I could use your solution since I had access to the ModuleNodes when they are constructed.

So thank you very much again,
Chris
Previous Topic:Riena + Declarative Services
Next Topic:Riena counterpart of ProgressMonitorDialog
Goto Forum:
  


Current Time: Wed Aug 27 23:17:21 EDT 2014

Powered by FUDForum. Page generated in 0.04841 seconds