[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] Re: editorActions & Separate Toolbars

Have you considered commands, handlers, and menu contributions (org.eclipse.ui.menus)?

[xml]
      <menuContribution
            locationURI="toolbar:org.eclipse.ui.main.toolbar">
         <toolbar
               id="my.group.file">
            <command
                  commandId="my.file.save"
                  style="push">
               <visibleWhen
                     checkEnabled="false">
                  <with
                        variable="activeEditorId">
                     <equals
                           value="my.editor.id">
                     </equals>
                  </with>
               </visibleWhen>
            </command>
         </toolbar>
         <toolbar
               id="my.group.edit">
            <command
                  commandId="my.edit.refresh"
                  style="push">
               <visibleWhen
                     checkEnabled="false">
                  <with
                        variable="activeEditorId">
                     <equals
                           value="my.editor.id">
                     </equals>
                  </with>
               </visibleWhen>
            </command>
         </toolbar>
      </menuContribution>
[/xml]

This will create 2 toolbars which track the current active editor id.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/workbench.htm