Skip to main content

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

Hi Dani,

Thanks for your reply. But in my case the action button never gets enabled when editor area is active. It gets only activated when Package Explorer is active and a single ".test"
file is selected.

Thanks,
sumit


Daniel Megert wrote:



Your action delegate has a selectionChanged method which will be called
whenever the selection changes which is also the case when another editor
is activated.

Dani


Sumit Sarkar <sumits@xxxxxxxxx t> To Sent by: platform-ui-dev@xxxxxxxxxxx platform-ui-dev-a cc dmin@xxxxxxxxxxx sumits@xxxxxxxxxx Subject [platform-ui-dev] How can we 02.01.2004 23:40 control same action button from Package Explorer and an Editor? Please respond to platform-ui-dev@e clipse.org



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



_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-ui-dev


_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-ui-dev





Back to the top