<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>

<plugin>

    <extension
            point="org.eclipse.ui.editors">
        <editor
            class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.ui.editor.XtextEditor"
            contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor"
            default="true"
            extensions="ufo"
            id="net.sourceforge.ufoai.UFOScript"
            name="UFOScript Editor">
        </editor>
    </extension>
    <extension
        point="org.eclipse.ui.handlers">
        <handler
            class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.ui.editor.hyperlinking.OpenDeclarationHandler"
            commandId="org.eclipse.xtext.ui.editor.hyperlinking.OpenDeclaration">
            <activeWhen>
                <reference
                    definitionId="net.sourceforge.ufoai.UFOScript.Editor.opened">
                </reference>
            </activeWhen>
        </handler>
        <handler
            class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.ui.editor.handler.ValidateActionHandler"
            commandId="net.sourceforge.ufoai.UFOScript.validate">
         <activeWhen>
            <reference
                    definitionId="net.sourceforge.ufoai.UFOScript.Editor.opened">
            </reference>
         </activeWhen>
      </handler>
    </extension>
    <extension point="org.eclipse.core.expressions.definitions">
        <definition id="net.sourceforge.ufoai.UFOScript.Editor.opened">
            <and>
                <reference definitionId="isActiveEditorAnInstanceOfXtextEditor"/>
                <with variable="activeEditor">
                    <test property="org.eclipse.xtext.ui.editor.XtextEditor.languageName"
                        value="net.sourceforge.ufoai.UFOScript"
                        forcePluginActivation="true"/>
                </with>
            </and>
        </definition>
    </extension>
    <extension
            point="org.eclipse.ui.preferencePages">
        <page
            class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.ui.editor.preferences.LanguageRootPreferencePage"
            id="net.sourceforge.ufoai.UFOScript"
            name="UFOScript">
            <keywordReference id="net.sourceforge.ufoai.ui.keyword_UFOScript"/>
        </page>
        <page
            category="net.sourceforge.ufoai.UFOScript"
            class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.ui.editor.syntaxcoloring.SyntaxColoringPreferencePage"
            id="net.sourceforge.ufoai.UFOScript.coloring"
            name="Syntax Coloring">
            <keywordReference id="net.sourceforge.ufoai.ui.keyword_UFOScript"/>
        </page>
        <page
            category="net.sourceforge.ufoai.UFOScript"
            class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.ui.editor.templates.XtextTemplatePreferencePage"
            id="net.sourceforge.ufoai.UFOScript.templates"
            name="Templates">
            <keywordReference id="net.sourceforge.ufoai.ui.keyword_UFOScript"/>
        </page>
    </extension>
    <extension
            point="org.eclipse.ui.propertyPages">
        <page
            class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.ui.editor.preferences.LanguageRootPreferencePage"
            id="net.sourceforge.ufoai.UFOScript"
            name="UFOScript">
            <keywordReference id="net.sourceforge.ufoai.ui.keyword_UFOScript"/>
            <enabledWhen>
	            <adapt type="org.eclipse.core.resources.IProject"/>
			</enabledWhen>
	        <filter name="projectNature" value="org.eclipse.xtext.ui.shared.xtextNature"/>
        </page>
    </extension>
    <extension
        point="org.eclipse.ui.keywords">
        <keyword
            id="net.sourceforge.ufoai.ui.keyword_UFOScript"
            label="UFOScript"/>
    </extension>
    <extension
         point="org.eclipse.ui.commands">
      <command
            description="Trigger expensive validation"
            id="net.sourceforge.ufoai.UFOScript.validate"
            name="Validate">
      </command>
    </extension>
    <extension point="org.eclipse.ui.menus">
        <menuContribution
            locationURI="popup:#TextEditorContext?after=group.edit">
             <command
                 commandId="net.sourceforge.ufoai.UFOScript.validate"
                 style="push"
                 tooltip="Trigger expensive validation">
            <visibleWhen checkEnabled="false">
                <reference
                    definitionId="net.sourceforge.ufoai.UFOScript.Editor.opened">
                </reference>
            </visibleWhen>
         </command>
         </menuContribution>
    </extension>
    <extension point="org.eclipse.ui.menus">
		<menuContribution locationURI="popup:#TextEditorContext?endof=group.find">
			<command commandId="org.eclipse.xtext.ui.editor.FindReferences">
				<visibleWhen checkEnabled="false">
					<reference definitionId="net.sourceforge.ufoai.UFOScript.Editor.opened">
					</reference>
				</visibleWhen>
			</command>
		</menuContribution>
	</extension>
	<extension point="org.eclipse.ui.handlers">
	    <handler
            class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.ui.editor.findrefs.FindReferencesHandler"
            commandId="org.eclipse.xtext.ui.editor.FindReferences">
            <activeWhen>
                <reference
                    definitionId="net.sourceforge.ufoai.UFOScript.Editor.opened">
                </reference>
            </activeWhen>
        </handler>
    </extension>

<!-- adding resource factories -->

	<extension
		point="org.eclipse.emf.ecore.extension_parser">
		<parser
			class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.resource.IResourceFactory"
			type="ufo">
		</parser>
	</extension>
	<extension point="org.eclipse.xtext.extension_resourceServiceProvider">
        <resourceServiceProvider
            class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.ui.resource.IResourceUIServiceProvider"
            uriExtension="ufo">
        </resourceServiceProvider>
    </extension>



   <extension
         point="org.eclipse.xtext.builder.participant">
      <participant
            class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.builder.IXtextBuilderParticipant">
      </participant>
   </extension>
   <extension
            point="org.eclipse.ui.preferencePages">
        <page
            category="net.sourceforge.ufoai.UFOScript"
            class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.builder.preferences.BuilderPreferencePage"
            id="net.sourceforge.ufoai.UFOScript.compiler.preferencePage"
            name="Compiler">
            <keywordReference id="net.sourceforge.ufoai.ui.keyword_UFOScript"/>
        </page>
    </extension>
    <extension
            point="org.eclipse.ui.propertyPages">
        <page
            category="net.sourceforge.ufoai.UFOScript"
            class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.builder.preferences.BuilderPreferencePage"
            id="net.sourceforge.ufoai.UFOScript.compiler.propertyPage"
            name="Compiler">
            <keywordReference id="net.sourceforge.ufoai.ui.keyword_UFOScript"/>
            <enabledWhen>
	            <adapt type="org.eclipse.core.resources.IProject"/>
			</enabledWhen>
	        <filter name="projectNature" value="org.eclipse.xtext.ui.shared.xtextNature"/>
        </page>
    </extension>

	<!-- Quick Outline -->
	<extension
		point="org.eclipse.ui.handlers">
		<handler
			class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.ui.editor.outline.quickoutline.ShowQuickOutlineActionHandler"
			commandId="org.eclipse.xtext.ui.editor.outline.QuickOutline">
			<activeWhen>
				<reference
					definitionId="net.sourceforge.ufoai.UFOScript.Editor.opened">
				</reference>
			</activeWhen>
		</handler>
	</extension>
	<extension
		point="org.eclipse.ui.commands">
		<command
			description="Open the quick outline."
			id="org.eclipse.xtext.ui.editor.outline.QuickOutline"
			name="Quick Outline">
		</command>
	</extension>
	<extension point="org.eclipse.ui.menus">
		<menuContribution
			locationURI="popup:#TextEditorContext?after=group.open">
			<command commandId="org.eclipse.xtext.ui.editor.outline.QuickOutline"
				style="push"
				tooltip="Open Quick Outline">
				<visibleWhen checkEnabled="false">
					<reference definitionId="net.sourceforge.ufoai.UFOScript.Editor.opened"/>
				</visibleWhen>
			</command>
		</menuContribution>
	</extension>
   <!-- quickfix marker resolution generator -->
   <extension
         point="org.eclipse.ui.ide.markerResolution">
      <markerResolutionGenerator
            class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.ui.editor.quickfix.MarkerResolutionGenerator">
      </markerResolutionGenerator>
   </extension>
	<!-- Rename Refactoring -->
	<extension point="org.eclipse.ui.handlers">
		<handler
			class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.ui.refactoring.ui.IRenameElementHandler"
			commandId="org.eclipse.xtext.ui.refactoring.RenameElement">
			<activeWhen>
				<reference
					definitionId="net.sourceforge.ufoai.UFOScript.Editor.opened">
				</reference>
			</activeWhen>
		</handler>
	</extension>
    <extension point="org.eclipse.ui.menus">
         <menuContribution
            locationURI="popup:#TextEditorContext?after=group.edit">
         <command commandId="org.eclipse.xtext.ui.refactoring.RenameElement"
               style="push">
            <visibleWhen checkEnabled="false">
               <reference
                     definitionId="net.sourceforge.ufoai.UFOScript.Editor.opened">
               </reference>
            </visibleWhen>
         </command>
      </menuContribution>
   </extension>
   <extension point="org.eclipse.ui.preferencePages">
	    <page
	        category="net.sourceforge.ufoai.UFOScript"
	        class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.ui.refactoring.ui.RefactoringPreferencePage"
	        id="net.sourceforge.ufoai.UFOScript.refactoring"
	        name="Refactoring">
	        <keywordReference id="net.sourceforge.ufoai.ui.keyword_UFOScript"/>
	    </page>
	</extension>

  <extension point="org.eclipse.compare.contentViewers">
    <viewer id="net.sourceforge.ufoai.UFOScript.compare.contentViewers"
            class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.ui.compare.InjectableViewerCreator"
            extensions="ufo">
    </viewer>
  </extension>
  <extension point="org.eclipse.compare.contentMergeViewers">
    <viewer id="net.sourceforge.ufoai.UFOScript.compare.contentMergeViewers"
            class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.ui.compare.InjectableViewerCreator"
            extensions="ufo" label="UFOScript Compare">
     </viewer>
  </extension>
  <extension point="org.eclipse.ui.editors.documentProviders">
    <provider id="net.sourceforge.ufoai.UFOScript.editors.documentProviders"
            class="net.sourceforge.ufoai.ui.UFOScriptExecutableExtensionFactory:org.eclipse.xtext.ui.editor.model.XtextDocumentProvider"
            extensions="ufo">
    </provider>
  </extension>

   <extension
         id="Xtask"
         name="Xtext-Task"
         point="org.eclipse.core.resources.markers">
      <super
            type="org.eclipse.core.resources.taskmarker">
      </super>
   </extension>
   <extension
         point="org.eclipse.ui.editors.annotationTypes">
      <type
            markerType="de.itemis.red.ucdsl.ui.Xtask"
            name="de.itemis.red.ucdsl.ui.XtaskAnnotation"
            super="org.eclipse.ui.workbench.texteditor.task">
      </type>
   </extension>
</plugin>
