Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Command with parameters and DI ?
Command with parameters and DI ? [message #728308] Thu, 22 September 2011 19:26 Go to previous message
Cristiano Gaviao is currently offline Cristiano Gaviao
Messages: 245
Registered: July 2009
Senior Member
Hi guys,

I'm trying to learn how to deal with Commands and E4. I'm using the E4 Contacts as example.

I've created this command:

  <commands xmi:id="_VNE7QOVpEeCBqrdVElCRVQ" elementId="teste.c" commandName="Teste">
    <parameters xmi:id="_1ec7cOVqEeCBqrdVElCRVQ" elementId="meu.par.id" name="meu.par" optional="false"/>
  </commands>

 <children xsi:type="menu:HandledMenuItem" xmi:id="_9Yw44OVlEeCBqrdVElCRVQ" elementId="teste" label="Change to Black" command="_VNE7QOVpEeCBqrdVElCRVQ">
          <parameters xmi:id="_wFhu8OVqEeCBqrdVElCRVQ" elementId="x1" name="meu.par.id" value="example"/>
 </children>


And this handler:

@Execute
	public void execute(
			@Named("meu.par.id") String themeId) {
		logger.log(LogService.LOG_DEBUG, "starting myhandler..." + themeId);
	}


It works well...

But when I try to pass another parameter in the execute method (the same as in the Contacts example), it doesn't work. The execute method is not called:
@Execute
	public void execute(
			@Named("meu.par.id") String themeId,
			IThemeEngine engine) {
		logger.log(LogService.LOG_DEBUG, "starting myhandler..." + themeId);
	}


Am I missing something?

thanks for any help...

Cristiano
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:Add editors to an empty parts stack
Next Topic:Does a Lifecycle / Context creation diagram exist for e4?
Goto Forum:
  


Current Time: Sun May 19 21:36:11 EDT 2013

Powered by FUDForum. Page generated in 0.01887 seconds