<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<!--
    Copyright (c) 2015, 2016 CNRS, IRIT, IRT AESE (IRT Saint Exupéry).
    All rights reserved. This program and the accompanying materials
    are made available under the terms of the LGPL 3.0
    which accompanies this distribution, and is available at
    https://www.gnu.org/licenses/lgpl-3.0-standalone.html
   
    Contributors:
        Faiez Zalila - initial API and implementation and/or initial documentation
        Jorge Enrique Gutierrez Zuluaga
 -->

<plugin>

   <extension
         point="org.eclipse.ui.popupMenus">
      <objectContribution
            objectClass="org.eclipse.core.resources.IFile"
            id="com.irtsaintexupery.fiacre.simulator.contribution1">
         <menu
               label="FiacreSimulator"
               path="additions"
               id="com.irtsaintexupery.fiacre.simulator.menu1">
            <separator
                  name="group1">
            </separator>
         </menu>
         <action
               label="Simulate"
               class="com.irtsaintexupery.fiacre.simulator.popup.actions.FiacreSimulationAction"
               menubarPath="com.irtsaintexupery.fiacre.simulator.menu1/group1"
               enablesFor="1"
               id="com.irtsaintexupery.fiacre.simulator.newAction">
         </action>
      </objectContribution>
   </extension>
   <extension
         point="org.eclipse.ui.commands">
      <command
            defaultHandler="com.irtsaintexupery.fiacre.simulator.core.FireEvent"
            id="com.irtsaintexupery.fiacre.simulator.fireEvent"
            name="Fire">
      </command>
   </extension>
   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            allPopups="false"
            locationURI="popup:org.eclipse.ui.popup.any?after=additions">
         <command
               commandId="com.irtsaintexupery.fiacre.simulator.fireEvent"
               style="push">
            <visibleWhen
                  checkEnabled="false">
               <with
                     variable="activeMenuSelection">
                  <iterate
                        ifEmpty="false"
                        operator="and">
                     <adapt
                           type="com.irtsaintexupery.fiacre.instance.fiacreinstance.FireableStatementBlock">
                     </adapt>
                  </iterate>
               </with>
            </visibleWhen>
         </command>
      </menuContribution>
   </extension>
   <extension
         point="org.eclipse.ui.commands">
      <command
            defaultHandler="com.irtsaintexupery.fiacre.simulator.core.DelayEvent"
            id="com.irtsaintexupery.fiacre.simulator.delayEvent"
            name="Delay">
      </command>
   </extension>
   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            allPopups="false"
            locationURI="popup:org.eclipse.ui.popup.any?after=additions">
         <command
               commandId="com.irtsaintexupery.fiacre.simulator.delayEvent"
               style="push">
            <visibleWhen
                  checkEnabled="false">
               <with
                     variable="activeMenuSelection">
                  <iterate
                        ifEmpty="false"
                        operator="and">
                     <adapt
                           type="com.irtsaintexupery.fiacre.instance.fiacreinstance.InstanceModel">
                     </adapt>
                  </iterate>
               </with>
            </visibleWhen>
         </command>
      </menuContribution>
   </extension>
   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            allPopups="false"
            locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
         <toolbar
               id="com.irtsaintexupery.fiacre.simulator.toolbar">
            <command
                  commandId="com.irtsaintexupery.fiacre.simulator.quitSimulatorCommand"
                  icon="icons/stop.png"
                  id="com.irtsaintexupery.fiacre.simulator.simulatorToolbar"
                  style="push"
                  tooltip="Quit Fiacre Simulator">
            </command>
         </toolbar>
      </menuContribution>
   </extension>
   <extension
         point="org.eclipse.ui.commands">
      <command
            defaultHandler="com.irtsaintexupery.fiacre.simulator.core.QuitSimulator"
            id="com.irtsaintexupery.fiacre.simulator.quitSimulatorCommand"
            name="Quit Simulator">
      </command>
   </extension>
   
   <extension
         point="org.eclipse.ui.views">
      <view
            class="com.irtsaintexupery.fiacre.simulator.perspective.views.TransitionsView"
            icon="icons/lightning.png"
            id="com.irtsaintexupery.fiacre.simulator.perspective.transitionsView"
            name="Transitions"
            restorable="true">
      </view>
      <view
            class="com.irtsaintexupery.fiacre.simulator.perspective.views.ValuesView"
            icon="icons/database_table.png"
            id="com.irtsaintexupery.fiacre.simulator.perspective.valuesView"
            name="Values"
            restorable="true">
      </view>
      <view
            class="com.irtsaintexupery.fiacre.simulator.perspective.views.InstancesView"
            icon="icons/table_multiple.png"
            id="com.irtsaintexupery.fiacre.simulator.perspective.instancesView"
            name="Instances"
            restorable="true">
      </view>
      <view
            class="com.irtsaintexupery.fiacre.simulator.perspective.views.ExecutedActionView"
            icon="icons/tick.png"
            id="com.irtsaintexupery.fiacre.simulator.perspective.executedActionView"
            name="Executed actions"
            restorable="true">
      </view>
      <view
            class="com.irtsaintexupery.fiacre.simulator.perspective.views.SavedStatesView"
            icon="icons/brick.png"
            id="com.irtsaintexupery.fiacre.simulator.perspective.savedStatesView"
            name="Saved paths"
            restorable="true">
      </view>
   </extension>
   <extension
         point="org.eclipse.ui.perspectives">
      <perspective
            class="com.irtsaintexupery.fiacre.simulator.perspective.PerspectiveSimulatorFactory"
            icon="icons/bricks.png"
            id="com.irtsaintexupery.fiacre.simulator.perspective.fiacreSimulator"
            name="Fiacre Simulator">
      </perspective>
   </extension>
   
   <!-- Defines my own custom marker, use the marker view panel to see them when they are created-->
	<extension point="org.eclipse.core.resources.markers"
	      id="com.irtsaintexupery.fiacre.simulator.marking.marker"
	      name="FiacreMarker">
	      <super type="org.eclipse.core.resources.textmarker"/>
	      <super type="org.eclipse.core.resources.marker"/>
	      <persistent value="true"/>
	</extension> 
    
<!-- Popup menu to add a menu to right click of a java file in the text editor--> 
	
<!-- Popup menu to add a menu to right click of a java file in the package explorer--> 	

<!-- Annotation specification:- describes what the annotation will look like and its properties -->
   <extension point="org.eclipse.ui.editors.markerAnnotationSpecification"
	 id="com.irtsaintexupery.fiacre.simulator.marking.annotationspecification"
	 name="FiacreAnnotation">
	<!--  <specification
            annotationType="org.eclipse.viatra2.slicemarker"
            colorPreferenceKey="org.eclipse.viatra2.slice.color"
            colorPreferenceValue="192,255,192"
            contributesToHeader="false"
            highlightPreferenceKey="org.eclipse.viatra2.slice.highlight"
            highlightPreferenceValue="true"
            includeOnPreferencePage="true"
            label="MyAnnotation"
            overviewRulerPreferenceKey="org.eclipse.viatra2.slice.overview"
            overviewRulerPreferenceValue="true"
            presentationLayer="0"
            textPreferenceKey="org.eclipse.viatra2.slice.text"
            textPreferenceValue="true"
            textStylePreferenceValue="BOX"
            verticalRulerPreferenceKey="org.eclipse.viatra2.slice.ruler"
            verticalRulerPreferenceValue="true">
      </specification> -->
		 <specification
			  annotationType="com.irtsaintexupery.fiacre.simulator.marking.annotation"
			  label="FiacreAnnotation"
			  icon="icons/bullet_pink.png"
			  overviewRulerPreferenceKey="clruler"
			  overviewRulerPreferenceValue="true"
			  highlightPreferenceKey="org.eclipse.viatra2.slice.highlight"
            highlightPreferenceValue="true"
			  colorPreferenceKey="clcolor"
			  colorPreferenceValue="230,154,245"
			  textPreferenceKey="cltext"
			  textPreferenceValue="true"
			  verticalRulerPreferenceKey="clvertical"
			  verticalRulerPreferenceValue="true"
			  textStylePreferenceKey="clstyle"
			  textStylePreferenceValue="BOX">
		 </specification>
		 
   </extension>

<!-- Links the annotation spec to the marker -->
	<extension point="org.eclipse.ui.editors.annotationTypes">
      	<type
			markerSeverity="0"
			super="org.eclipse.ui.workbench.texteditor.info"
			name="com.irtsaintexupery.fiacre.simulator.marking.annotation"
			markerType="com.irtsaintexupery.fiacre.simulator.marking.marker"/>
	</extension>
   
  <!-- define the marker updater class-->
	<extension point="org.eclipse.ui.editors.markerUpdaters">
		<updater
			id="com.irtsaintexupery.fiacre.simulator.marking.MarkerUpdater"
			class="com.irtsaintexupery.fiacre.simulator.marking.MarkerUpdater"
			markerType="com.irtsaintexupery.fiacre.simulator.marking.marker">
		</updater>
	</extension>
  
 <!--define the decorator -->
	<extension point="org.eclipse.ui.decorators">
		<decorator
		    id="com.irtsaintexupery.fiacre.simulator.marking.filedecorator"
		    label="FiacreDecorator"
		    state="true"
		    class= "com.irtsaintexupery.fiacre.simulator.marking.FileDecorator"
		    adaptable="true"
			lightweight="true">
			<enablement>
				<objectClass name="org.eclipse.core.resources.IResource"/>      
			</enablement>
		</decorator>
	</extension>

</plugin>
