Eclipse command framework core expression : Multiple handlers
Eclipse platform command framework supports core expression to control commands behavior runtime. In this series of posts I have explained different ways of using core expressions . This post explains having multiple handler for same command but activate only one of it at runtime based on some of the condition. Eclipse command framework is based on MVC framework. Command declaration, handler declaration and contributing command to workbench helps to keep declaration separate from presentation. You can have multiple handlers for same command, but only one will be active at one moment. Core expression provides “activeWhen” declarative clause to activate specific handler for given command based on specific condition. Here is how we use it . I have created a new eclipse plug-in project. I have extended “org.eclipse.ui.editors” extension point to define two simple text editors. Here I am going to define two different handlers for same commands but only one will be active based on edito