Skip Navigation

plugin.xml for Vertical and Horizontal Views

The sample plugin.xml file includes a vertical view, a horizontal view, and main menu and side bar contributions. When you complete Creating Sample Views, your XML will be similar, except that your file will not have a horizontal view or menu contributions.

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.6"?>
<plugin>
  <extension point="org.eclipse.ui.views">

<!-- The following lines represent the view extension for the vertical view. -->
    <view class="com.sabre.redapp.example.view.basic.BasicViewPart"
          id="com.sabre.redapp.example.view.basic.view"
          name="Basic View"
          restorable="true"
          allowMultiple="true" />

<!-- The following lines represent the view extension for the horizontal view. -->
    <view class="com.sabre.redapp.example.view.basic.BasicViewPart"
          id="com.sabre.redapp.example.view.basic.horizontal"
          name="Horizontal View"
          restorable="true"
          allowMultiple="true"
    </view>
  </extension>
  <extension point="org.eclipse.ui.perspectiveExtensions">

<!-- The following lines represent the perspective for the vertical view. -->
    <perspectiveExtension targetID="com.sabre.edge.app.ui.perspective">
      <view
          closeable="true"
          id="com.sabre.redapp.example.view.basic.view:*"
          minimized="false"
          moveable="false"
          ratio="0.7"
          relationship="right"
          relative="org.eclipse.ui.editorss"
          showTitle="true"
          standalone="true"
          visible="false" />
    </perspectiveExtension>

<!-- The following lines represent the perspective for the horizontal view. -->
    <perspectiveExtension  targetID="com.sabre.edge.app.ui.perspective">
      <view
          closeable="true"
          id="com.sabre.redapp.example.view.basic.horizontal:*"
          minimized="false"
          moveable="false"
          ratio="0.4"
          relationship="bottom"
          relative="org.eclipse.ui.editorss"
          showTitle="true"
          standalone="true"
          visible="false">
      </view>
    </perspectiveExtension>
  </extension>

  <extension point="org.eclipse.ui.commands">

<!-- The following lines represent the command for the vertical view. -->
      <command id="com.sabre.edge.command.example.view.basic"
          name="Example view"
          categoryId="com.sabre.edge.app">
            <commandParameter id="viewId"
              name="This is for the convenience of future developers. It can be any name." />
        </command>

<!-- The following lines represent the command for the horizontal view. -->
      <command id="com.sabre.edge.command.example.view.horizontal"
          name="Horizontal View">
            <commandParameter id="viewId"
              name="This is for the convenience of future developers. It can be any name.">
            </commandParameter>
      </command>
  </extension>
  <extension point="org.eclipse.ui.handlers">

<!-- The following lines represent the handler for the vertical view. -->
    <handler
      commandId="com.sabre.edge.command.example.view.basic"
      class="com.sabre.edge.platform.core.ui.handlers.OpenViewHandler" />

<!-- The following lines represent the handler for the horizontal view. -->
    <handler
      class="com.sabre.edge.platform.core.ui.handlers.OpenViewHandler"
      commandId="com.sabre.edge.command.example.view.horizontal">
    </handler>
  </extension>

<!-- The following lines add a contribution to the application side bar from a vertical view -->
    <extension point="org.eclipse.ui.menus">
        <menuContribution locationURI="toolbar:com.sabre.edge.toolbar.sidebar">
            <command
             commandId="com.sabre.edge.command.example.view.basic"
                icon="images/example.png"
                label="Example view"
                style="push"
                  <parameter name="viewId"
                  value="com.sabre.redapp.example.view.basic.view" />
                  </parameter>
                      <visibleWhen
                        checkEnabled="true">
                          <with
                            variable="edgeActiveEditorId">
                              <equals
                                value="com.sabre.redapp.example.editor.basic.SampleEditor">
                              </equals>
                          </with>
                      </visibleWhen>
            </command>
        </menuContribution>
    </extension>

<!-- The following lines add a contribution to the bottom of the Tools sub-men on the main menu from a horizontal view -->
  <extension  point="org.eclipse.ui.menus">
        <menuContribution
              locationURI="menu:tools?after=tools.bottom">
            <command
            commandId="com.sabre.edge.command.example.view.horizontal"
                icon="images/example.png"
                label="Horizontal View"
                style="push"
                    <parameter
                      name="viewId"
                      value="com.sabre.redapp.example.view.basic.horizontal">
                    </parameter>
            </command>
        </menuContribution>
...
  </extension>
</plugin>