<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
   <extension-point id="org.lamport.tla.toolbox.spec" name="Specification Life Cycle Participant" schema="schema/org.lamport.tla.toolbox.spec.exsd"/>
<!--                                   -->
<!-- Perspectives                      -->
<!--                                   -->
   <extension
         point="org.eclipse.ui.perspectives">
      <perspective
            class="org.lamport.tla.toolbox.ui.perspective.SpecLoadedPerspective"
            fixed="false"
            icon="icons/full/etool16/new_project_wiz.gif"
            id="org.lamport.tla.toolbox.ui.perspective.specLoaded"
            name="Specification">
      </perspective>
      <perspective
            class="org.lamport.tla.toolbox.ui.perspective.InitialPerspective"
            fixed="false"
            icon="icons/full/newmodule_wiz.gif"
            id="org.lamport.tla.toolbox.ui.perspective.initial"
            name="Welcome to Toolbox">
      </perspective>
   </extension>
   <extension
         point="org.eclipse.ui.perspectiveExtensions">
      <perspectiveExtension
            targetID="org.lamport.tla.toolbox.ui.perspective.specLoaded">
         <view
               closeable="true"
               id="toolbox.view.ProblemView"
               minimized="false"
               moveable="true"
               ratio="0.75"
               relationship="right"
               relative="org.eclipse.ui.editorss"
               showTitle="true"
               visible="false">
         </view>
         <view
               closeable="false"
               id="toolbox.view.ToolboxExplorer"
               minimized="false"
               moveable="false"
               ratio="0.25"
               relationship="left"
               relative="org.eclipse.ui.editorss"
               showTitle="true"
               visible="true">
         </view>
      </perspectiveExtension>
      <perspectiveExtension
            targetID="org.lamport.tla.toolbox.ui.perspective.initial">
         <!-- view  We are no longer showing the intro view
               closeable="false"
               id="org.eclipse.ui.internal.introview"
               minimized="false"
               moveable="false"
               ratio="1.0"
               relationship="left"
               relative="org.eclipse.ui.editorss"
               showTitle="true"
               standalone="true"
               visible="true">
         </view -->
         <view
               closeable="false"
               id="toolbox.view.ToolboxExplorer"
               minimized="false"
               moveable="false"
               ratio="0.25"
               relationship="left"
               relative="org.eclipse.ui.editorss"
               showTitle="true"
               visible="true">
         </view>
         <view
               closeable="false"
               id="toolbox.view.ToolboxWelcomeView"
               minimized="false"
               moveable="false"
               ratio="0.75"
               relationship="right"
               relative="org.eclipse.ui.editorss"
               showTitle="true"
               visible="true">
         </view>
      </perspectiveExtension>
   </extension>
   
<!--                                   -->
<!-- Views to be displayed to the user -->
<!--                                   -->
   <extension
         point="org.eclipse.ui.views">
      <view
            allowMultiple="false"
            category="org.lamport.tla.toolbox.category"
            class="org.lamport.tla.toolbox.ui.view.ProblemView"
            icon="icons/full/obj16/error_tsk.gif"
            id="toolbox.view.ProblemView"
            name="Parsing Errors"
            restorable="true">
      </view>
      <view
            allowMultiple="false"
            category="org.lamport.tla.toolbox.category"
            class="org.lamport.tla.toolbox.ui.navigator.ToolboxExplorer"
            fastViewWidthRatio="0.75"
            icon="icons/full/etool16/new_project_wiz.gif"
            id="toolbox.view.ToolboxExplorer"
            name="Spec Explorer"
            restorable="true">
      </view>
      <category
            id="org.lamport.tla.toolbox.category"
            name="TLA+ Toolbox">
      </category>
      <view
            class="org.lamport.tla.toolbox.ui.view.ToolboxWelcomeView"
            id="toolbox.view.ToolboxWelcomeView"
            name="Welcome View"
            restorable="true">
      </view>
      <view
            allowMultiple="true"
            class="org.lamport.tla.toolbox.ui.view.PDFBrowser"
            icon="icons/document-pdf.png"
            id="org.lamport.tla.toolbox.PDFBrowser"
            name="PDFBrowser"
            restorable="false">
      </view>
   </extension>
   <extension
         point="org.eclipse.ui.editors">
      <editor
            class="org.lamport.tla.toolbox.ui.view.PDFBrowserEditor"
            extensions="pdf"
            icon="icons/document-pdf.png"
            id="org.lamport.tla.toolbox.PDFBrowserEditor"
            name="PDF Editor">
      </editor>
   </extension>
      
<!--                                   -->
<!-- Wizards : New Spec                -->
<!--                                   -->
   <extension
         point="org.eclipse.ui.newWizards">
      <category
            name="TLA+"
            id="toolbox.wizard"/>
      <wizard
            category="toolbox.wizard"
            class="org.lamport.tla.toolbox.ui.wizard.NewSpecWizard"
            icon="icons/full/newmodule_wiz.gif"
            id="toolbox.wizard.NewSpecWizard"
            name="TLA+ Specification"
            project="true">
         <description/>
      </wizard>
   </extension>
   
   <extension
         point="org.eclipse.ui.preferencePages">
      <page
            class="org.lamport.tla.toolbox.ui.preference.GeneralPreferencePage"
            id="toolbox.ui.preferences.GeneralPreferencePage"
            name="TLA+ Preferences">
      </page>
      <page
            class="org.lamport.tla.toolbox.ui.preference.ParserPreferencePage"
            id="toolbox.ui.preferences.ParserPreferencePage"
            name="TLA+ Parser"
            category="toolbox.ui.preferences.GeneralPreferencePage">
            <keywordReference id="toolbox.keywords.Parser"/>
      </page>
      <page
            category="toolbox.ui.preferences.GeneralPreferencePage"
            class="org.lamport.tla.toolbox.ui.preference.EditorPreferencePage"
            id="org.lamport.tla.toolbox.EditorPreferencePage"
            name="Module Editor">
      </page>
      <!--Currently, the fields on this page do nothing, ao it is removed. -->
      <!-- page
            category="toolbox.ui.preferences.GeneralPreferencePage"
            class="org.lamport.tla.toolbox.ui.preference.TranslatorPreferencePage"
            id="toolbox.ui.preferences.ParserPreferencePage"
            name="PlusCal Translator Preferences">
      </page -->
      
   </extension>
   
   <extension
         point="org.eclipse.ui.propertyPages">
      <page
            class="org.lamport.tla.toolbox.ui.property.SpecPropertyPage"
            icon="icons/full/prop_ps.gif"
            id="toolbox.ui.property.SpecPropertyPage"
            name="Specification Properties">
         <enabledWhen>
            <instanceof
                  value="org.lamport.tla.toolbox.spec.Spec">
            </instanceof>
         </enabledWhen>
      </page>
      <!-- Module preferences are disabled -->
      <!-- page
            class="org.lamport.tla.toolbox.ui.property.ModulePropertyPage"
            icon="icons/full/prop_ps.gif"
            id="toolbox.ui.property.ModulePropertyPage"
            name="Module Properties">
         <enabledWhen>
            <instanceof
                  value="org.eclipse.core.resources.IFile">
            </instanceof>
         </enabledWhen>
      </page -->
   </extension>
   
<!--                                   -->
<!-- Commands                          -->
<!--                                   -->
   <extension
         point="org.eclipse.ui.commands">
      <!-- spec commands -->
      <category
            description="Dummy Command"
            id="toolbox.command.category.dummy"
            name="Dummy Command">
      </category>
      <category
            description="Specification Commands"
            id="toolbox.command.category.spec"
            name="Specification Commands">
      </category>
      <command
            categoryId="toolbox.command.category.spec"
            description="Create a new specification"
            id="toolbox.command.spec.new"
            name="New Specification">
         <commandParameter
               id="toolbox.command.spec.new.param"
               name="specPath"
               optional="true">
         </commandParameter>
      </command>
      <command
            categoryId="toolbox.command.category.spec"
            description="Open the specification"
            id="toolbox.command.spec.open"
            name="Open Specification">
         <commandParameter
               id="toolbox.command.spec.open.param"
               name="specName"
               optional="false">
         </commandParameter>
      </command>
      <command
            categoryId="toolbox.command.category.ui"
            description="Open the element selected in explorer"
            id="toolbox.command.cnf.open.delegate"
            name="Open Element">
      </command>
      <command
            categoryId="toolbox.command.category.spec"
            description="Specification Properties"
            id="toolbox.command.spec.props"
            name="Specification Properties">
      </command>
      <command
            categoryId="toolbox.command.category.spec"
            description="Close the specification"
            id="toolbox.command.spec.close"
            name="Close Specification">
      </command>
      <command
            categoryId="toolbox.command.category.spec"
            description="Parse specification root module"
            id="toolbox.command.module.parse.root"
            name="Parse Root Module">
      </command>

      
      <!-- module commands -->
      <category
            description="Module Commands"
            id="toolbox.command.category.module"
            name="Module">
      </category>
      <command
            categoryId="toolbox.command.category.module"
            description="Add a new or existing TLA+ module"
            id="toolbox.command.module.add"
            name="Add Module">
      </command>
      <command
            categoryId="toolbox.command.category.module"
            description="Open a TLA+ Module"
            id="toolbox.command.module.open"
            name="Open a TLA+ module">
         <commandParameter
               id="toolbox.command.module.open.param"
               name="moduleName"
               optional="false">
         </commandParameter>
      </command>
      <command
            categoryId="toolbox.command.category.module"
            description="Parse module in the active editor"
            id="toolbox.command.module.parse.active"
            name="Parse Module">
      </command>
      <command
            categoryId="toolbox.command.category.module"
            description="Translates PCal in the active editor"
            id="toolbox.command.module.translate.active"
            name="Translate module">
      </command>
      <!-- Module preferences are disabled -->
      <!-- command
            categoryId="toolbox.command.category.module"
            description="Modules Properties"
            id="toolbox.command.module.props"
            name="Modules Properties">
      </command -->
      
      <category
            description="UI Commands"
            id="toolbox.command.category.ui"
            name="UI">
      </category>
      <command
            categoryId="toolbox.command.category.ui"
            description="Opens the view"
            id="toolbox.command.openview"
            name="Open View">
         <commandParameter
               id="toolbox.openview.name"
               name="name"
               optional="false">
         </commandParameter>
      </command>
      <command
            categoryId="toolbox.command.category.ui"
            description="Calls the Help window"
            id="toolbox.command.help"
            name="Help">
      </command>
      <command
            categoryId="toolbox.command.category.ui"
            description="Switches to the perspective"
            id="toolbox.command.switchperspective"
            name="Switches to the perspective">
         <commandParameter
               id="toolbox.switchperspective.id"
               name="name"
               optional="false">
         </commandParameter>
      </command>
      <command
            id="toolbox.command.openParseErrorView"
            name="Open Parsing Errors view">
      </command>
      <command
            description="Removes spec from list of specs known to Toolbox."
            helpContextId="Remove from list of specs known to the Toolbox."
            id="org.lamport.tla.toolbox.forget"
            name="Forget Specification">
      </command>
      <command
            description="Refresh selected specification."
            id="org.lamport.tla.toolbox.refresh"
            name="Refresh Specification">
      </command>
      <command
            id="org.lamport.tla.toolbox.history"
            name="Module History">
      </command>
   </extension>
<!-- 
 Key bindings
-->   
   <extension
         point="org.eclipse.ui.bindings">
      <key
            commandId="org.eclipse.ui.file.exit"
            contextId="org.eclipse.ui.contexts.window"
            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
            sequence="M3+X">
      </key>
      <key
            commandId="toolbox.command.cnf.open.delegate"
            contextId="org.eclipse.ui.contexts.window"
            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
            sequence="F3">
      </key>
      
      <!-- key
            commandId="toolbox.command.help"
            contextId="org.eclipse.ui.contexts.window"
            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
            sequence="F1">
      </key -->
      <key
            commandId="toolbox.command.module.parse.root"
            contextId="org.eclipse.ui.contexts.window"
            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
            sequence="M1+M3+R">
      </key>
      <key
            commandId="toolbox.command.module.parse.active"
            contextId="org.eclipse.ui.contexts.window"
            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
            sequence="M1+R">
      </key>
      <key
            commandId="toolbox.command.module.translate.active"
            contextId="toolbox.contexts.cleaneditor"
            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
            sequence="M1+T">
      </key>
   </extension>
      
<!--                                   -->
<!-- Menus                             -->
<!--                                   -->   
   <extension
         point="org.eclipse.ui.menus">
      <!-- file menu spec part -->
      <menuContribution
            locationURI="menu:toolbox.file.menu?after=toolbox.file.spec.separator">
         <menu
               icon="icons/full/obj16/spec_obj.gif"
               id="toolbox.menu.spec.open"
               label="Open Spec"
               mnemonic="O"
               tooltip="Opens existing specification">
            <dynamic
                  class="org.lamport.tla.toolbox.ui.contribution.SpecListContributionItem"
                  id="toolbox.menu.spec.open.dynamic">
            </dynamic>
         </menu>
         <command
               commandId="toolbox.command.module.parse.root"
               id="toolbox.menu.spec.parse"
               label="Parse Spec"
               mnemonic="P">
            <visibleWhen
                  checkEnabled="true">
               <with
                     variable="activeWorkbenchWindow.activePerspective">
                  <not>
                     <equals
                           value="org.lamport.tla.toolbox.ui.perspective.initial">
                     </equals>
                  </not>
               </with>
            </visibleWhen>
         </command>
         <command
               commandId="toolbox.command.spec.close"
               id="toolbox.menu.spec.close"
               label="Close Spec"
               mnemonic="C"
               style="push"
               tooltip="Close current specification">
            <visibleWhen
                  checkEnabled="true">
               <with
                     variable="activeWorkbenchWindow.activePerspective">
                  <not>
                     <equals
                           value="org.lamport.tla.toolbox.ui.perspective.initial">
                     </equals>
                  </not>
               </with>
            </visibleWhen>
         </command>
         <command
               commandId="toolbox.command.spec.props"
               id="toolbox.menu.spec.props"
               label="Spec Properties"
               mnemonic="I"
               style="push"
               tooltip="Shows properties of current specification">
            <visibleWhen
                  checkEnabled="true">
               <with
                     variable="activeWorkbenchWindow.activePerspective">
                  <not>
                     <equals
                           value="org.lamport.tla.toolbox.ui.perspective.initial">
                     </equals>
                  </not>
               </with>
            </visibleWhen>
         </command>
         <command
               commandId="toolbox.command.openview"
               icon="icons/full/etool16/new_project_wiz.gif"
               id="toolbox.menu.open.explorer"
               label="Spec Explorer"
               mnemonic="E"
               mode="FORCE_TEXT"
               style="push"
               tooltip="Opens the Spec Explorer">
            <parameter
                  name="toolbox.openview.name"
                  value="toolbox.view.ToolboxExplorer">
            </parameter>
         </command>
      </menuContribution>
      
      <menuContribution
            locationURI="menu:toolbox.file.menu?after=toolbox.file.module.separator">
         <menu
               id="toolbox.menu.module.open"
               label="Open Module"
               mnemonic="o"
               tooltip="Open a TLA+ Module">
            <visibleWhen
                  checkEnabled="true">
               <with
                     variable="activeWorkbenchWindow.activePerspective">
                  <not>
                     <equals
                           value="org.lamport.tla.toolbox.ui.perspective.initial">
                     </equals>
                  </not>
               </with>
            </visibleWhen>
            <dynamic
                  class="org.lamport.tla.toolbox.ui.contribution.ModuleListContributionItem"
                  id="toolbox.menu.module.open.dynamic">
            </dynamic>
         </menu>
         <command
               commandId="toolbox.command.module.parse.active"
               icon="icons/full/obj16/complete_task.gif"
               id="toolbox.menu.module.parse"
               label="Parse Module"
               mnemonic="p">
            <visibleWhen
                  checkEnabled="true">
               <with
                     variable="activeWorkbenchWindow.activePerspective">
                  <not>
                     <equals
                           value="org.lamport.tla.toolbox.ui.perspective.initial">
                     </equals>
                  </not>
               </with>
            </visibleWhen>
         </command>
         <!-- disable module properties -->
         <!-- command
               commandId="toolbox.command.module.props"
               id="toolbox.menu.module.props"
               label="Module Properties"
               mnemonic="i"
               style="push"
               tooltip="Shows properties of current module">
            <visibleWhen
                  checkEnabled="true">
               <with
                     variable="activeWorkbenchWindow.activePerspective">
                  <not>
                     <equals
                           value="org.lamport.tla.toolbox.ui.perspective.initial">
                     </equals>
                  </not>
               </with>
            </visibleWhen>
         </command-->
      </menuContribution>


      
      <!-- edit menu -->
      <menuContribution
            locationURI="menu:org.eclipse.ui.main.menu?after=toolbox.file.menu">
         <menu
               id="toolbox.edit.menu"
               label="Edit"
               mnemonic="E">
            <visibleWhen
                  checkEnabled="true">
               <with
                     variable="activeWorkbenchWindow.activePerspective">
                  <not>
                     <equals
                           value="org.lamport.tla.toolbox.ui.perspective.initial">
                     </equals>
                  </not>
               </with>
            </visibleWhen>
            <command
                  commandId="org.eclipse.ui.edit.undo">
            </command>
            <command
                  commandId="org.eclipse.ui.edit.redo">
            </command>
            <separator
                  name="toolbox.edit.separator1"
                  visible="true">
            </separator>
            <command
                  commandId="org.eclipse.ui.edit.cut">
            </command>
            <command
                  commandId="org.eclipse.ui.edit.copy"
                  >
            </command>
            <command
                  commandId="org.eclipse.ui.edit.paste">
            </command>
            <separator
                  name="toolbox.edit.separator2"
                  visible="true">
            </separator>
            <command
                  commandId="org.eclipse.ui.edit.delete">
            </command>
            <command
                  commandId="org.eclipse.ui.edit.selectAll"
                  >
            </command>
            <separator
                  name="toolbox.edit.separator3"
                  visible="true">
            </separator>
            <command
                  commandId="org.eclipse.ui.edit.findReplace">
            </command>
         </menu>
      </menuContribution>
      <menuContribution
            locationURI="menu:org.eclipse.ui.main.menu?after=additions">
         <menu
               id="toolbox.menu.help"
               label="Help"
               mnemonic="H"
               tooltip="Opens the help menu">
            <command
                  commandId="toolbox.command.help"
                  id="toolbox.menuItem.dynamicHelp"
                  label="Dynamic Help"
                  mnemonic="D"
                  mode="FORCE_TEXT"
                  style="push"
                  tooltip="Opens dynamic help">
            </command>
            <separator
                  name="toolbox.command.help.tlaplus"
                  visible="true">
            </separator>
            <separator
                  name="toolbox.command.about"
                  visible="true">
            </separator>
            <command
                  commandId="org.eclipse.ui.help.aboutAction"
                  id="toolbox.menuItem.about"
                  label="About"
                  mnemonic="A"
                  style="push"
                  tooltip="Opens the about dialog">
            </command>
         </menu>
      </menuContribution>
      <menuContribution
            locationURI="menu:toolbox.window.menu?after=toolbox.window.open.separator">
         <command
               commandId="org.eclipse.ui.window.newEditor"
               id="toolbox.menu.new.editor"
               label="New Editor..."
               mnemonic="E"
               mode="FORCE_TEXT"
               style="push"
               tooltip="Opens a new editor">
         </command>
         <command
               commandId="org.eclipse.ui.window.resetPerspective"
               id="toolbox.menu.reset.perspective"
               label="Reset Window Layout"
               mnemonic="R"
               mode="FORCE_TEXT"
               style="push"
               tooltip="Reset the window to the default layout">
         </command>
      </menuContribution>
      <menuContribution
            locationURI="menu:toolbox.window.menu?after=toolbox.window.view.separator">
         <command
               commandId="toolbox.command.openview"
               icon="icons/full/etool16/new_project_wiz.gif"
               id="toolbox.menu.open.explorer"
               label="Spec Explorer"
               mnemonic="E"
               mode="FORCE_TEXT"
               style="push"
               tooltip="Opens the Spec Explorer">
            <parameter
                  name="toolbox.openview.name"
                  value="toolbox.view.ToolboxExplorer">
            </parameter>
         </command>
         <command
               commandId="toolbox.command.openParseErrorView"
               icon="icons/full/obj16/error_tsk.gif"
               id="toolbox.menu.open-problems"
               label="Parsing Errors"
               mnemonic="P"
               mode="FORCE_TEXT"
               style="push"
               tooltip="Opens the view showing problems">
            <visibleWhen
                  checkEnabled="false">
               <with
                     variable="activeWorkbenchWindow.activePerspective">
                  <not>
                     <equals
                           value="org.lamport.tla.toolbox.ui.perspective.initial">
                     </equals>
                  </not>
               </with>
            </visibleWhen>
         </command>
      </menuContribution>
      
      <menuContribution
            locationURI="popup:toolbox.explorer.popup?after=group.new">
         <command
               commandId="toolbox.command.spec.new"
               icon="icons/full/newspec_wiz.gif"
               id="toolbox.popupmenu.spec.new"
               label="New Specification"
               mnemonic="N"
               style="push">
         </command>
      </menuContribution>
      
      <menuContribution
            locationURI="popup:toolbox.explorer.popup?after=group.open">
         <command
               commandId="toolbox.command.cnf.open.delegate"
               icon="icons/full/obj16/spec_obj.gif"
               id="toolbox.popupmenu.open.delegate"
               label="Open"
               mnemonic="O"
               style="push"
               >
         </command>
         <command
               commandId="toolbox.command.spec.close"
               id="toolbox.popupmenu.close"
               label="Close"
               mnemonic="C"
               style="push"
               >
         </command>
      </menuContribution>

      <menuContribution
            locationURI="popup:toolbox.explorer.popup?after=group.edit">
         <command
               commandId="org.eclipse.ui.edit.rename"
               id="toolbox.popupmenu.rename"
               label="Rename"
               mnemonic="R"
               style="push">
         </command>
         <command
               commandId="org.lamport.tla.toolbox.forget"
               id="toolbox.popupmenu.forget"
               label="Forget"
               style="push">
         </command>
         <command
               commandId="org.eclipse.ui.edit.delete"
               id="toolbox.popupmenu.delete"
               label="Delete"
               mnemonic="D"
               style="push">
         </command>
         <command
               commandId="org.lamport.tla.toolbox.refresh"
               id="toolbox.popupmenu.refresh"
               icon="icons/full/refresh.gif"
               label="Refresh"
               style="push">
         </command>
         <command
               commandId="org.lamport.tla.toolbox.history"
               label="Show in History"
               style="push">
         </command>
      </menuContribution>

      <menuContribution
            locationURI="popup:toolbox.explorer.popup?after=group.properties">
         <command
               commandId="org.eclipse.ui.file.properties"
               id="toolbox.popupmenu.props"
               label="Properties"
               mnemonic="I"
               style="push">
         </command>
      </menuContribution>
      
<!--                         -->
<!-- Status bar parse status -->
<!--                         -->
      <menuContribution
            locationURI="toolbar:org.eclipse.ui.trim.status">
         <toolbar
               id="toolbox.trim">
 			<!-- Dummy command needed to make the contributions height --> 
			<!-- be larger than too small. --> 
            <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=471313 -->
	        <command
	            id="org.lamport.tla.toolbox.ui.contribution.dummy"
	            commandId="toolbox.command.category.dummyj"
	            label="&#160;"> 
	            <!-- &#160; is the "No break space" unicode character. -->	
	            <!-- It is not printable and thus make the dummy invisible. -->
	        </command>
            <control
                  class="org.lamport.tla.toolbox.ui.contribution.SizeControlContribution"
                  id="toolbox.contributions.spec.size">
            </control>
            <control
                  class="org.lamport.tla.toolbox.ui.contribution.ParseStatusContributionItem"
                  id="toolbox.contributions.parse.status">
            </control>
         </toolbar>
      </menuContribution>
      <menuContribution
            locationURI="menu:toolbox.file.menu?after=toolbox.file.translation.separator">
         <command
               commandId="toolbox.command.module.translate.active"
               icon="icons/full/obj16/start_ccs_task.gif"
               id="toolbox.menu.run.translate"
               label="Translate PlusCal Algorithm"
               mnemonic="t">
            <visibleWhen
                  checkEnabled="true">
               <with
                     variable="activeWorkbenchWindow.activePerspective">
                  <not>
                     <equals
                           value="org.lamport.tla.toolbox.ui.perspective.initial">
                     </equals>
                  </not>
               </with>
            </visibleWhen>
         </command>
      </menuContribution>
   </extension>
   
<!--              -->
<!-- Handler      -->
<!--              -->
   <extension
         point="org.eclipse.ui.handlers">
      <handler
            class="org.lamport.tla.toolbox.ui.handler.SwitchPerspectiveHandler"
            commandId="toolbox.command.switchperspective">
         <activeWhen>
            <with
                  variable="activeWorkbenchWindow.activePerspective">
               <not>
                  <equals
                        value="org.lamport.tla.toolbox.ui.perspective.initial">
                  </equals>
               </not>
            </with>
         </activeWhen>
      </handler>
      <handler
            class="org.lamport.tla.toolbox.ui.handler.NewSpecHandler"
            commandId="toolbox.command.spec.new">
      </handler>
      <handler
            class="org.lamport.tla.toolbox.ui.handler.ParseSpecHandler"
            commandId="toolbox.command.module.parse.root">
      </handler>
      <handler
            class="org.lamport.tla.toolbox.ui.handler.CloseSpecHandler"
            commandId="toolbox.command.spec.close">
      </handler>
      <handler
            class="org.lamport.tla.toolbox.ui.handler.OpenSpecHandler"
            commandId="toolbox.command.spec.open">
      </handler>
      <handler
            class="org.lamport.tla.toolbox.ui.handler.PCalTranslateModuleHandler"
            commandId="toolbox.command.module.translate.active">
      </handler>
      <handler
            class="org.lamport.tla.toolbox.ui.handler.ParseModuleHandler"
            commandId="toolbox.command.module.parse.active">
      </handler>
      <handler
            class="org.lamport.tla.toolbox.ui.handler.AddModuleHandler"
            commandId="toolbox.command.module.add">
      </handler>
      <handler
            class="org.lamport.tla.toolbox.ui.handler.HelpHandler"
            commandId="toolbox.command.help">
      </handler>
      <handler
            class="org.lamport.tla.toolbox.ui.handler.OpenViewHandler"
            commandId="toolbox.command.openview">
      </handler>
      <handler
            class="org.lamport.tla.toolbox.ui.handler.OpenModuleHandler"
            commandId="toolbox.command.module.open">
      </handler>
      <handler
            class="org.lamport.tla.toolbox.ui.handler.OpenSpecHandlerDelegate"
            commandId="toolbox.command.cnf.open.delegate">
		    <enabledWhen>
		            <count value="1" />
		    </enabledWhen>
		    <activeWhen>
         <with
               variable="selection">
            <iterate
                  operator="or">
               <instanceof
                     value="org.lamport.tla.toolbox.spec.Spec">
               </instanceof>
            </iterate>
         </with>
		    </activeWhen>
      </handler>
      <handler
            class="org.lamport.tla.toolbox.ui.handler.CloseSpecHandler"
            commandId="toolbox.command.spec.close">
		    <enabledWhen>
		            <count value="1" />
		    </enabledWhen>
		    <activeWhen>
         <with
               variable="selection">
            <iterate
                  operator="or">
               <instanceof
                     value="org.lamport.tla.toolbox.spec.Spec">
               </instanceof>
            </iterate>
         </with>
		    </activeWhen>
      </handler>
     <handler
           class="org.lamport.tla.toolbox.ui.handler.RenameSpecHandler"
           commandId="org.eclipse.ui.edit.rename">
        <enabledWhen>
           <count
                 value="1">
           </count>
        </enabledWhen>
        <activeWhen>
           <with
                 variable="selection">
              <iterate
                    operator="or">
                 <instanceof
                       value="org.lamport.tla.toolbox.spec.Spec">
                 </instanceof>
              </iterate>
           </with>
        </activeWhen>
     </handler>
	<handler commandId="org.eclipse.ui.edit.delete"
	        class="org.lamport.tla.toolbox.ui.handler.DeleteSpecHandler">
	    <enabledWhen>
	        <not>
	            <count value="0" />
	        </not>
	    </enabledWhen>
	    <activeWhen>
        <with
              variable="selection">
           <iterate
                 operator="or">
              <instanceof
                    value="org.lamport.tla.toolbox.spec.Spec">
              </instanceof>
           </iterate>
        </with>
	    </activeWhen>
	</handler>
      <handler
            class="org.lamport.tla.toolbox.ui.handler.PropertiesHandler"
            commandId="toolbox.command.spec.props">
         <activeWhen>
            <with
                  variable="selection">
               <iterate
                     operator="or">
                  <instanceof
                        value="org.lamport.tla.toolbox.spec.Spec">
                  </instanceof>
               </iterate>
            </with>
         </activeWhen>
         <enabledWhen>
            <with
                  variable="selection">
               <iterate
                     operator="or">
                  <instanceof
                        value="org.lamport.tla.toolbox.spec.Spec">
                  </instanceof>
               </iterate>
            </with>
         </enabledWhen>
      </handler>
      <handler
            class="org.lamport.tla.toolbox.ui.handler.ForgetSpecHandler"
            commandId="org.lamport.tla.toolbox.forget">
         <enabledWhen>
            <not>
               <count
                     value="0">
               </count>
            </not>
         </enabledWhen>
         <activeWhen>
            <with
                  variable="selection">
               <iterate
                     ifEmpty="false"
                     operator="or">
                  <instanceof
                        value="org.lamport.tla.toolbox.spec.Spec">
                  </instanceof>
               </iterate>
            </with>
         </activeWhen>
      </handler>
      <handler
            class="org.lamport.tla.toolbox.ui.handler.RefreshSpecHandler"
            commandId="org.lamport.tla.toolbox.refresh">
         <enabledWhen>
            <not>
               <count
                     value="0">
               </count>
            </not>
         </enabledWhen>
         <activeWhen>
            <with
                  variable="selection">
               <iterate
                     ifEmpty="false"
                     operator="or">
                  <instanceof
                        value="org.lamport.tla.toolbox.spec.Spec">
                  </instanceof>
               </iterate>
            </with>
         </activeWhen>
      </handler>
      <handler
            class="org.lamport.tla.toolbox.ui.handler.OpenParseErrorViewHandler"
            commandId="toolbox.command.openParseErrorView">
         <enabledWhen>
            <test
                  property="toolbox.property.hasParseErrors">
            </test>
         </enabledWhen>
      </handler>
      <handler
            class="org.lamport.tla.toolbox.ui.handler.ShowHistoryHandler"
            commandId="org.lamport.tla.toolbox.history">
         <enabledWhen>
               <and>
                  <count
                        value="1">
                  </count>
                  <with
                        variable="selection">
                     <iterate
                           ifEmpty="false"
                           operator="or">
                        <instanceof
                              value="org.lamport.tla.toolbox.spec.Module">
                        </instanceof>
                     </iterate>
                  </with>
               </and>
         </enabledWhen>
      </handler>
   </extension>
   <extension
         point="org.eclipse.core.expressions.propertyTesters">
      <propertyTester
            class="org.lamport.tla.toolbox.ui.expression.PCalPropertyTester"
            id="toolbox.propertyTester.PCALTester"
            namespace="toolbox.property"
            properties="hasPCALAlgorithm"
            type="org.eclipse.jface.viewers.ISelection">
      </propertyTester>
      <propertyTester
            class="org.lamport.tla.toolbox.ui.expression.CurrentSpecTester"
            id="toolbox.propertyTester.isCurrentSpec"
            namespace="toolbox.property"
            properties="isCurrentSpec"
            type="org.lamport.tla.toolbox.spec.Spec">
      </propertyTester>
      <propertyTester
            class="org.lamport.tla.toolbox.ui.expression.ParseErrorTester"
            id="toolbox.propertyTester.hasParseErrors"
            namespace="toolbox.property"
            properties="hasParseErrors"
            type="java.lang.Object">
      </propertyTester>
   </extension>
   <extension
         point="org.eclipse.ui.navigator.viewer">
      <viewer
            viewerId="toolbox.view.ToolboxExplorer">
         <popupMenu
               allowsPlatformContributions="true"
               id="toolbox.explorer.popup">
            <insertionPoint
                  name="group.new"
                  separator="false">
            </insertionPoint>
            <insertionPoint
                  name="group.open"
                  separator="false">
            </insertionPoint>
            <insertionPoint
                  name="group.edit"
                  separator="true">
            </insertionPoint>
            <insertionPoint
                  name="additions"
                  separator="true">
            </insertionPoint>
            <insertionPoint
                  name="group.properties"
                  separator="true">
            </insertionPoint>
         </popupMenu>
      </viewer>
      <viewerContentBinding
            viewerId="toolbox.view.ToolboxExplorer">
         <includes>
            <contentExtension
                  isRoot="true"
                  pattern="toolbox.content.SpecContent">
            </contentExtension>
            
         </includes>
      </viewerContentBinding>
   </extension>
   
   <extension
         point="org.eclipse.ui.navigator.navigatorContent">
      <navigatorContent
            activeByDefault="true"
            contentProvider="org.lamport.tla.toolbox.ui.provider.SpecContentProvider"
            icon="icons/full/obj16/spec_obj.gif"
            id="toolbox.content.SpecContent"
            labelProvider="org.lamport.tla.toolbox.ui.provider.ToolboxLabelProvider"
            name="Specifications"
            priority="normal"
            providesSaveables="false">
         <triggerPoints>
            <instanceof
                  value="org.lamport.tla.toolbox.spec.manager.WorkspaceSpecManager">
            </instanceof>
         </triggerPoints>
         <possibleChildren>
            <or>
               <instanceof
                     value="org.lamport.tla.toolbox.spec.Spec">
               </instanceof>
               <instanceof
                     value="org.lamport.tla.toolbox.spec.Module">
               </instanceof>
            </or>
         </possibleChildren>
         
	      <commonWizard
	        		type="new"
					wizardId="toolbox.wizard.NewSpecWizard">
				<enablement>
					<or>
						<instanceof value="org.lamport.tla.toolbox.spec.Spec" />	
					</or>
		         </enablement>
			</commonWizard>          
      </navigatorContent>
   </extension>
   <extension
     point="org.eclipse.ui.keywords">
    <keyword
            label="TLA+ Syntax Analyser"
            id="toolbox.keywords.Parser"/>
   </extension>
   <extension
         point="org.eclipse.ui.contexts">
      <context
            description="The current active editor has no modifcation since last save."
            id="toolbox.contexts.cleaneditor"
            name="Clean Editor"
            parentId="org.eclipse.ui.contexts.window">
      </context>
   </extension>
   <extension
         point="org.eclipse.help.contexts">
      <contexts
            file="helpContexts.xml"
            plugin="org.lamport.tla.toolbox">
      </contexts>
   </extension>
   <extension
         point="org.eclipse.core.runtime.adapters">
      <factory
            adaptableType="org.lamport.tla.toolbox.spec.Spec"
            class="org.lamport.tla.toolbox.util.AdapterFactory">
         <adapter
               type="org.eclipse.ui.model.IWorkbenchAdapter">
         </adapter>
      </factory>
   </extension>
<!-- ================================================================================= -->
<!-- Builders                                                                          -->
<!-- ================================================================================= -->
   <extension
   		 id="toolbox.builder.TLAParserBuilder"
   		 name="TLA+ Syntax Parser"
         point="org.eclipse.core.resources.builders">
      <builder
            hasNature="true">
         <run
               class="org.lamport.tla.toolbox.spec.nature.TLAParsingBuilder">
         </run>
      </builder>
   </extension>
   <extension
         id="toolbox.builder.PCalAlgorithmSearchingBuilder"
         name="PCal Algorthim Definition Detecting Builder"
         point="org.eclipse.core.resources.builders">
      <builder
            hasNature="true">
         <run
               class="org.lamport.tla.toolbox.spec.nature.PCalDetectingBuilder">
         </run>
      </builder>
   </extension>
   
<!-- ================================================================================= -->
<!-- Natures                                                                           -->
<!-- ================================================================================= -->
   <extension
         id="toolbox.natures.TLANature"
         name="TLA+ Nature"
         point="org.eclipse.core.resources.natures">
      <runtime>
         <run
               class="org.lamport.tla.toolbox.spec.nature.TLANature">
         </run>
      </runtime>
      <builder
            id="toolbox.builder.TLAParserBuilder">
      </builder>
      <builder
            id="toolbox.builder.PCalAlgorithmSearchingBuilder">
      </builder>
   </extension>

<!--
 Problem marker definition 
-->
   <extension
         id="toolbox.markers.ToolboxProblemMarker"
         name="Toolbox Problem"
         point="org.eclipse.core.resources.markers">
      <super
            type="org.eclipse.core.resources.problemmarker">
      </super>
      <attribute
            name="toolbox.location.modulename">
      </attribute>
      <attribute
            name="toolbox.location.beginline">
      </attribute>
      <attribute
            name="toolbox.location.endline">
      </attribute>
      <attribute
            name="toolbox.location.begincolumn">
      </attribute>
      <attribute
            name="toolbox.location.endcolumn">
      </attribute>
   </extension>
   <extension
         id="toolbox.markers.PCalTranslatorProblemMarker"
         name="PCal Translation Problem"
         point="org.eclipse.core.resources.markers">
      <super
            type="toolbox.markers.ToolboxProblemMarker">
      </super>
   </extension>
   <extension
         id="toolbox.markers.TLAParserProblemMarker"
         name="TLA Parse Problem"
         point="org.eclipse.core.resources.markers">
      <super
            type="toolbox.markers.ToolboxProblemMarker">
      </super>
   </extension>
   <extension
         point="org.eclipse.core.runtime.preferences">
      <initializer
            class="org.lamport.tla.toolbox.util.pref.PreferenceInitializer">
      </initializer>
   </extension>
<!--
  Marker resolution
-->
   <extension
         point="org.eclipse.ui.ide.markerResolution">
         <markerResolutionGenerator
         	class="org.lamport.tla.toolbox.util.TLAMarkerResolutionGenerator"
         	markerType="toolbox.markers.TLAParserProblemMarker" />
   </extension>
   
<!--
  Marker Image Provider
-->   
   <extension
         point="org.eclipse.ui.ide.markerImageProviders">
		<imageprovider
        icon="icons/full/obj16/error_tsk.gif"
        id="toolbox.declarativeMarkerProvider"
        markertype="toolbox.markers.TLAParserProblemMarker">
		</imageprovider>
   </extension>
<!-- 
	Marker Content Generator
-->
   <extension
         point="org.eclipse.ui.ide.markerSupport">
      <markerContentGenerator
            id="toolbox.markers.contentGenerator"
            name="TLA+ Marker Generator">
		<markerTypeReference id="toolbox.markers.TLAParserProblemMarker" />
		<markerFieldReference id="org.eclipse.ui.ide.resourceField"/>
        <markerFieldReference id="org.eclipse.ui.ide.descriptionField"/>
		<markerFieldReference id="org.eclipse.ui.ide.locationField"/>
		<markerFieldReference id="org.eclipse.ui.ide.priorityField"/>
        <!-- markerFieldReference id="org.eclipse.ui.ide.markerType"/ -->
   		<!-- markerFieldReference id="org.eclipse.ui.ide.priorityField"/ -->
		<!-- markerFieldReference id="org.eclipse.ui.ide.descriptionField"/ -->		          
      </markerContentGenerator>
   </extension>
   <extension
         point="org.eclipse.core.expressions.definitions">
      <definition
            id="toolbox.isCurrentSpec">
         <test
               property="toolbox.property.isCurrentSpec">
         </test>
      </definition>
   </extension>
   <extension
         point="org.lamport.tla.toolbox.tool">
      <participant
            class="org.lamport.tla.toolbox.util.pref.UnwantedPreferenceManager">
      </participant>
   </extension>
   <extension
         point="org.lamport.tla.toolbox.tool">
      <participant
            class="org.lamport.tla.toolbox.ui.navigator.ToolboxExplorerResourceListener">
      </participant>
   </extension>
   <extension
         point="org.lamport.tla.toolbox.tool">
      <participant
            class="org.lamport.tla.toolbox.ui.view.ProblemViewResourceListener">
      </participant>
   </extension>
   
   <!--                       -->
   <!-- Specification content -->
   <!--                       -->
</plugin>
