0

I put a toolbar on the top of my TrimmedWindow in my application. I have a handler which has to check whether a check button is pressed on this menu bar or not.

I tried putting EMenuService in my execute() method of the handler but it has no useful methods. If I debug into my application I can see my menu in the EMenuService object however.

How can I get my menu from the Eclipse context?

0

1 Answer 1

0

Without code it's hard to help you.

But the basic idea for your handler is the following :

public class BrokerHandler {

    @Inject
    // the services you need

    @Execute 
    public void execute(IEclipseContext context, @Named(IServiceConstants.ACTIVE_SHELL) Shell shell)
            throws InvocationTargetException, InterruptedException {
        // do some stuff
    }
}

Then, in your application.e4xmi you need to create a Window>Trimmed Window>Trim Bars>Window Trim>Toolbar>Handled Tool Item wich points to your Commands>Command that is binded to your Handlers>Handler pointing to your java class with a method annotated @Execute as described above.

Then each execution of the @Execute method means the user has pressed the toolbar button.

You can pass messages to other parts of your app with the event broker service, or store some of your own stuff in the IEclipseContext.

You can have a look here: http://xseignard.github.com/demoCamp2012/prez/#1

Hope this helps, but your question is too blurry.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.