Jump to: navigation, search

Difference between revisions of "FAQ How do I make my action set visible?"

 
Line 1: Line 1:
''
 
 
 
Simply defining an action set does not guarantee that it will appear in  
 
Simply defining an action set does not guarantee that it will appear in  
 
the UI. This characteristic is very important, as an Eclipse product  
 
the UI. This characteristic is very important, as an Eclipse product  
Line 8: Line 6:
 
of ways:
 
of ways:
  
* Set the <tt>visible</tt> attribute to <tt>true</tt> in the
 
action set declaration.  This will add your action set unconditionally
 
to all perspectives.  You should <i>almost never</i> do this in a
 
real application unless you are certain that your
 
actions are needed all the time in all perspectives.  Keep in mind the
 
scalability problems with using this approach.
 
</li>
 
  
* Define a perspective or perspective extension.  This will limit the
+
* Set the <tt>visible</tt> attribute to <tt>true</tt> in the action set declaration.  This will add your action set unconditionally to all perspectives.  You should <i>almost never</i> do this in a real application unless you are certain that your actions are needed all the time in all perspectives.  Keep in mind the scalability problems with using this approach.
appearance of your action set to a specified set of perspectives.
+
 
</li>
+
 
 +
* Define a perspective or perspective extension.  This will limit the appearance of your action set to a specified set of perspectives.
 +
 
  
* Define an action set part association, using the extension point
+
* Define an action set part association, using the extension point <tt>org.eclipse.ui.actionSetPartAssociations</tt>.  This extension links an action set to one or more views and editors.  The action set will appear only when one of those parts is visible.
<tt>org.eclipse.ui.actionSetPartAssociations</tt>.  This extension links
+
an action set to one or more views and editors.  The action set will
+
appear only when one of those parts is visible.
+
</li>
+
  
* Finally, the user can always have the last say by customizing
 
perspectives ('''Window &gt; Customize Perspective''').  From here,
 
the user can turn on or off any action sets for the current perspective.  This
 
will override all the other mechanisms for defining action set visibility.
 
</li>
 
  
 +
* Finally, the user can always have the last say by customizing perspectives ('''Window &gt; Customize Perspective''').  From here, the user can turn on or off any action sets for the current perspective.  This will override all the other mechanisms for defining action set visibility.
  
  
 
== See Also: ==
 
== See Also: ==
  
[[FAQ_How_can_I_add_my_views_and_actions_to_an_existing_perspective%3F]]
+
[[FAQ How can I add my views and actions to an existing perspective?]]
  
 
<hr><font size=-2>This FAQ was originally published in [http://www.eclipsefaq.org Official Eclipse 3.0 FAQs]. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the [http://www.eclipse.org/legal/epl-v10.html Eclipse Public License v1.0].</font>
 
<hr><font size=-2>This FAQ was originally published in [http://www.eclipsefaq.org Official Eclipse 3.0 FAQs]. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the [http://www.eclipse.org/legal/epl-v10.html Eclipse Public License v1.0].</font>

Revision as of 10:40, 10 February 2007

Simply defining an action set does not guarantee that it will appear in the UI. This characteristic is very important, as an Eclipse product with thousands of plug-ins would quickly become overwhelmed with actions if their appearance in the UI was not carefully controlled. An action set can be made visible in a number of ways:


  • Set the visible attribute to true in the action set declaration. This will add your action set unconditionally to all perspectives. You should almost never do this in a real application unless you are certain that your actions are needed all the time in all perspectives. Keep in mind the scalability problems with using this approach.


  • Define a perspective or perspective extension. This will limit the appearance of your action set to a specified set of perspectives.


  • Define an action set part association, using the extension point org.eclipse.ui.actionSetPartAssociations. This extension links an action set to one or more views and editors. The action set will appear only when one of those parts is visible.


  • Finally, the user can always have the last say by customizing perspectives (Window > Customize Perspective). From here, the user can turn on or off any action sets for the current perspective. This will override all the other mechanisms for defining action set visibility.


See Also:

FAQ How can I add my views and actions to an existing perspective?


This FAQ was originally published in Official Eclipse 3.0 FAQs. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the Eclipse Public License v1.0.