Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-ui-dev] How can we control same action button from Package Explorer and an Editor?

I have contributed some actions thru action sets. Like when one ".test" file gets selected in Package Explorer, the button in the Main Tool Bar will get enabled, otherwise it will get disabled.

  <extension
        point="org.eclipse.ui.actionSets">
     <actionSet
           label="Test1"
           id="test1">
        <action
              label="Test"
              icon="icons/some.gif"
              tooltip="Test"
              class="<class name>"
              menubarPath="Menu/Separator"
              toolbarPath="Group"
              id="testid"
              enablesFor="1">
<selection class="org.eclipse.core.resources.IFile" name="*.test">
              </selection>
        </action>
     </actionSet>
  </extension>

Now the button gets enabled when I choose a ".test" file, otherwise the button gets disabled,

I want the same button gets enabled when I am editing a ".test" file in the editor (editor area is active now)
and gets disabled when I am not editing a ".test" file.

How can I do that?

Thanks,
sumit





Back to the top