Nishant123
Nishant123

Reputation: 1966

Toolbar item not clickable in Eclipse RCP - Windows

I am new to Eclipse Rich Client Platform. I am learning to create Views by adding toolbar, menu, etc. As a part of an exercise, I added a toolbar to my view and also declared a handler for its command. But when I run my application the toolbar appears in disabled mode and I am not able to click it.

This is my plugin.xml

<extension
         point="org.eclipse.ui.commands">
      <category
            id="ch02.WebBrowser.commands.category"
            name="Web Category">
      </category>
      <command
            categoryId="ch02.WebBrowser.commands.category"
            id="ch02.WebBrowser.commands.newBrowser"
            name="New Browser">
      </command>
   </extension>
   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            allPopups="false"
            locationURI="toolbar:org.eclipse.ui.main.toolbar">
         <toolbar
               id="ch02.WebBrowser.toolbar.sampletoolbar">
            <command
                  commandId="ch02.WebBrowser.commands.newBrowser"
                  icon="icons/16-earth.png"
                  id="ch02.WebBrowser.toolbars.newBrowserCommand"
                  style="push"
                  tooltip="Open New Browser">
            </command>
         </toolbar>
      </menuContribution>
   </extension>
   <extension
         point="org.eclipse.ui.handlers">
      <handler
            class="ch02.webbrowser.handlers.NewBrowserHandler"
            commandId="ch02.WebBrowser.commands.newBrowser">
      </handler>
   </extension>

Output

This is my output

Upvotes: 0

Views: 283

Answers (1)

Keyur Mahajan
Keyur Mahajan

Reputation: 134

Please check your handler isEnable() and isHandled() status.

Upvotes: 0

Related Questions