Eclipse Default Handler Ihandler interface "The chosen operation is not enabled"

Source: Internet
Author: User
Tags stub

Note:these methods:

Tip:subclass Abstracthandler rather than implementing Ihandler. But you can use it to the below sections you need to set:

Ihandler The chosen operation is not enabled

Not use Popupmenus instead of Menus

Isenabled:should is set to True

Ishandled:should is set to True

ImportOrg.eclipse.core.commands.AbstractHandler;Importorg.eclipse.core.commands.ExecutionEvent;Importorg.eclipse.core.commands.ExecutionException;ImportOrg.eclipse.core.commands.IHandler;ImportOrg.eclipse.core.commands.IHandlerListener;ImportOrg.eclipse.jface.dialogs.MessageDialog;ImportOrg.eclipse.swt.widgets.MessageBox;ImportOrg.eclipse.ui.IWorkbenchWindow;ImportOrg.eclipse.ui.handlers.HandlerUtil; Public classMyHandlerImplementsIhandler {PrivateFontchanger font=fontchanger.getinstance (); @Override PublicObject Execute (executionevent event)throwsexecutionexception {//TODO auto-generated Method StubIworkbenchwindow window=handlerutil.getactiveworkbenchwindowchecked (event); Messagedialog.openinformation (Window.getshell (),"Demo",                "Hello, Eclipse World");        Font.decreasesize (); return NULL; } @Override Public voidAddhandlerlistener (Ihandlerlistener handlerlistener) {//TODO auto-generated Method Stub} @Override Public voidDispose () {//TODO auto-generated Method Stub} @Override Public Booleanisenabled () {//TODO auto-generated Method Stub        return true; } @Override Public Booleanishandled () {//TODO auto-generated Method Stub        return true; } @Override Public voidRemovehandlerlistener (Ihandlerlistener handlerlistener) {//TODO auto-generated Method Stub            }    }

Eclipse Default Handler Ihandler interface "The chosen operation is not enabled"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.