loading table of contents...

7.12.2. Configure an Action to Open a Work Area Tab

In most cases you will use an action to open your own tab. In the example, a button is plugged into the Favorites toolbar. Clicking the button triggers an openTabAction to open the browse tab.

...
<editor:favoritesToolbar>
  <plugins>
    <ui:addItemsPlugin>
      <ui:items>
      ...
         <!-- Add a button that opens a browse tab -->
         <button itemId="browseTab">
           <baseAction>
             <editor:openTabAction text="...">
               <editor:tab>
                 <example:browseTab/>
               </editor:tab>
             </editor:openTabAction>
           </baseAction>
         </button>
      </ui:items>
      ...
    </ui:addItemsPlugin>
  </plugins>
</editor:favoritesToolbar>
...

Example 7.47. Adding a button to open a tab


The browseTab from above is configured as the tab configuration parameter of openTabAction. A new browse tab is then opened every time when clicking the button. In addition, all open browse tabs will be reopened in the work area after the reload of CoreMedia Studio. For that CoreMedia Studio stores the xtypes of the open tabs as user preference when opening, closing or selecting tabs. When loading the work area instances of the xtypes are generated and added to the work area. This is basically why you should configure each tab in a separate EXML. Nevertheless, you will see below in Section 7.12.4, “Storing the State of a Work Area Tab” how you can save other state of the tab than the xtype in the user preference.