eclipse plugin: update to xtext 1.0.0 (phase 3)

This commit is contained in:
Timotei Dolean 2010-06-26 20:12:55 +00:00
parent 7b6c0c8479
commit b35271da2c
21 changed files with 658 additions and 0 deletions

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.wesnoth.wml.generator</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,16 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: org.wesnoth.wml.generator
Bundle-Vendor: My Company
Bundle-Version: 1.0.0
Bundle-SymbolicName: org.wesnoth.wml.generator; singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: org.wesnoth.wml;visibility:=reexport,
org.eclipse.xpand;visibility:=reexport,
org.eclipse.xtend;visibility:=reexport,
org.eclipse.xtext;visibility:=reexport,
org.eclipse.emf.mwe2.launch;resolution:=optional,
org.eclipse.emf.mwe.utils;visibility:=reexport,
org.eclipse.xtend.typesystem.emf;visibility:=reexport
Import-Package: org.apache.log4j
Bundle-RequiredExecutionEnvironment: J2SE-1.5

View file

@ -0,0 +1,5 @@
source.. = src/,\
src-gen/
bin.includes = META-INF/,\
.,\
plugin.xml

View file

@ -0,0 +1,3 @@
eclipse.preferences.version=1
metamodelContributor=org.eclipse.xtend.shared.ui.core.metamodel.jdt.javabean.JavaBeanMetamodelContributor
project.specific.metamodel=true

View file

@ -0,0 +1,6 @@
/*
* This is an example model
*/
Hello world!
Hello Xtext!
Hello Eclipse!

View file

@ -0,0 +1,4 @@
import org::wesnoth::wML;
sortedGreetings(Model this) :
this.greetings.sortBy(g|g.name.toLowerCase());

View file

@ -0,0 +1,14 @@
«IMPORT org::wesnoth::wML»
«EXTENSION templates::Extensions»
«DEFINE main FOR Greeting-»
«FILE name+".txt"-»
This is an example of a generated file.
The input element was "Hello «name»!"
All greetings in the same file:
«FOREACH ((Model)eContainer()).sortedGreetings() AS g SEPARATOR ', '»«g.name»«ENDFOREACH»
«ENDFILE-»
«ENDDEFINE»

View file

@ -0,0 +1,33 @@
module workflow.WMLGenerator
import org.eclipse.emf.mwe.utils.*
var targetDir = "src-gen"
var fileEncoding = "UTF-8"
var modelPath = "src/model"
Workflow {
component = org.eclipse.xtext.mwe.Reader {
// lookup all resources on the classpath
// useJavaClassPath = true
// or define search scope explicitly
path = modelPath
// this class will be generated by the xtext generator
register = org.wesnoth.WMLStandaloneSetup {}
load = {
slot = "greetings"
type = "Greeting"
}
}
component = org.eclipse.xpand2.Generator {
expand = "templates::Template::main FOREACH greetings"
outlet = {
path = targetDir
}
fileEncoding = fileEncoding
}
}

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.wesnoth.wml.ui</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,19 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: org.wesnoth.wml.ui
Bundle-Vendor: My Company
Bundle-Version: 1.0.0
Bundle-SymbolicName: org.wesnoth.wml.ui; singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: org.wesnoth.wml;visibility:=reexport,
org.eclipse.xtext.ui,
org.eclipse.ui.editors;bundle-version="3.5.0",
org.eclipse.ui.ide;bundle-version="3.5.0",
org.eclipse.xtext.ui.shared,
org.eclipse.ui,
org.eclipse.xtext.builder,
org.antlr.runtime
Import-Package: org.apache.log4j
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.wesnoth.ui.contentassist.antlr
Bundle-Activator: org.wesnoth.ui.internal.WMLActivator

View file

@ -0,0 +1,5 @@
source.. = src/,\
src-gen/
bin.includes = META-INF/,\
.,\
plugin.xml

View file

@ -0,0 +1,184 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
<extension
point="org.eclipse.ui.editors">
<editor
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.XtextEditor"
contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor"
default="true"
extensions="cfg"
id="org.wesnoth.WML"
name="WML Editor">
</editor>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.hyperlinking.OpenDeclarationHandler"
commandId="org.eclipse.xtext.ui.editor.hyperlinking.OpenDeclaration">
<activeWhen>
<reference
definitionId="org.wesnoth.WML.Editor.opened">
</reference>
</activeWhen>
</handler>
<handler
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.handler.ValidateActionHandler"
commandId="org.wesnoth.WML.validate">
<activeWhen>
<reference
definitionId="org.wesnoth.WML.Editor.opened">
</reference>
</activeWhen>
</handler>
</extension>
<extension point="org.eclipse.core.expressions.definitions">
<definition id="org.wesnoth.WML.Editor.opened">
<and>
<reference definitionId="isActiveEditorAnInstanceOfXtextEditor"/>
<with variable="activeEditor">
<test property="org.eclipse.xtext.ui.editor.XtextEditor.languageName"
value="org.wesnoth.WML"
forcePluginActivation="true"/>
</with>
</and>
</definition>
</extension>
<extension
point="org.eclipse.ui.preferencePages">
<page
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.preferences.LanguageRootPreferencePage"
id="org.wesnoth.WML"
name="WML">
<keywordReference id="org.wesnoth.ui.keyword_WML"/>
</page>
<page
category="org.wesnoth.WML"
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.syntaxcoloring.SyntaxColoringPreferencePage"
id="org.wesnoth.WML.coloring"
name="Syntax Coloring">
<keywordReference id="org.wesnoth.ui.keyword_WML"/>
</page>
<page
category="org.wesnoth.WML"
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.templates.XtextTemplatePreferencePage"
id="org.wesnoth.WML.templates"
name="Templates">
<keywordReference id="org.wesnoth.ui.keyword_WML"/>
</page>
</extension>
<extension
point="org.eclipse.ui.keywords">
<keyword
id="org.wesnoth.ui.keyword_WML"
label="WML"/>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
description="Trigger expensive validation"
id="org.wesnoth.WML.validate"
name="Validate">
</command>
</extension>
<extension point="org.eclipse.ui.menus">
<menuContribution
locationURI="popup:#TextEditorContext?after=group.edit">
<command
commandId="org.wesnoth.WML.validate"
style="push"
tooltip="Trigger expensive validation">
<visibleWhen checkEnabled="false">
<reference
definitionId="org.wesnoth.WML.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="org.wesnoth.WML.Editor.opened">
</reference>
</visibleWhen>
</command>
</menuContribution>
</extension>
<extension point="org.eclipse.ui.handlers">
<handler
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.findrefs.FindReferencesHandler"
commandId="org.eclipse.xtext.ui.editor.FindReferences">
<activeWhen>
<reference
definitionId="org.wesnoth.WML.Editor.opened">
</reference>
</activeWhen>
</handler>
</extension>
<!-- adding resource factories -->
<extension
point="org.eclipse.emf.ecore.extension_parser">
<parser
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.resource.IResourceFactory"
type="cfg">
</parser>
</extension>
<extension point="org.eclipse.xtext.extension_resourceServiceProvider">
<resourceServiceProvider
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.resource.IResourceUIServiceProvider"
uriExtension="cfg">
</resourceServiceProvider>
</extension>
<!-- Quick Outline -->
<extension
point="org.eclipse.ui.handlers">
<handler
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.outline.quickoutline.ShowQuickOutlineActionHandler"
commandId="org.eclipse.xtext.ui.editor.outline.QuickOutline">
<activeWhen>
<reference
definitionId="org.wesnoth.WML.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="org.wesnoth.WML.Editor.opened"/>
</visibleWhen>
</command>
</menuContribution>
</extension>
<!-- quickfix marker resolution generator -->
<extension
point="org.eclipse.ui.ide.markerResolution">
<markerResolutionGenerator
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.quickfix.MarkerResolutionGenerator">
</markerResolutionGenerator>
</extension>
</plugin>

View file

@ -0,0 +1,184 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
<extension
point="org.eclipse.ui.editors">
<editor
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.XtextEditor"
contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor"
default="true"
extensions="cfg"
id="org.wesnoth.WML"
name="WML Editor">
</editor>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.hyperlinking.OpenDeclarationHandler"
commandId="org.eclipse.xtext.ui.editor.hyperlinking.OpenDeclaration">
<activeWhen>
<reference
definitionId="org.wesnoth.WML.Editor.opened">
</reference>
</activeWhen>
</handler>
<handler
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.handler.ValidateActionHandler"
commandId="org.wesnoth.WML.validate">
<activeWhen>
<reference
definitionId="org.wesnoth.WML.Editor.opened">
</reference>
</activeWhen>
</handler>
</extension>
<extension point="org.eclipse.core.expressions.definitions">
<definition id="org.wesnoth.WML.Editor.opened">
<and>
<reference definitionId="isActiveEditorAnInstanceOfXtextEditor"/>
<with variable="activeEditor">
<test property="org.eclipse.xtext.ui.editor.XtextEditor.languageName"
value="org.wesnoth.WML"
forcePluginActivation="true"/>
</with>
</and>
</definition>
</extension>
<extension
point="org.eclipse.ui.preferencePages">
<page
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.preferences.LanguageRootPreferencePage"
id="org.wesnoth.WML"
name="WML">
<keywordReference id="org.wesnoth.ui.keyword_WML"/>
</page>
<page
category="org.wesnoth.WML"
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.syntaxcoloring.SyntaxColoringPreferencePage"
id="org.wesnoth.WML.coloring"
name="Syntax Coloring">
<keywordReference id="org.wesnoth.ui.keyword_WML"/>
</page>
<page
category="org.wesnoth.WML"
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.templates.XtextTemplatePreferencePage"
id="org.wesnoth.WML.templates"
name="Templates">
<keywordReference id="org.wesnoth.ui.keyword_WML"/>
</page>
</extension>
<extension
point="org.eclipse.ui.keywords">
<keyword
id="org.wesnoth.ui.keyword_WML"
label="WML"/>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
description="Trigger expensive validation"
id="org.wesnoth.WML.validate"
name="Validate">
</command>
</extension>
<extension point="org.eclipse.ui.menus">
<menuContribution
locationURI="popup:#TextEditorContext?after=group.edit">
<command
commandId="org.wesnoth.WML.validate"
style="push"
tooltip="Trigger expensive validation">
<visibleWhen checkEnabled="false">
<reference
definitionId="org.wesnoth.WML.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="org.wesnoth.WML.Editor.opened">
</reference>
</visibleWhen>
</command>
</menuContribution>
</extension>
<extension point="org.eclipse.ui.handlers">
<handler
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.findrefs.FindReferencesHandler"
commandId="org.eclipse.xtext.ui.editor.FindReferences">
<activeWhen>
<reference
definitionId="org.wesnoth.WML.Editor.opened">
</reference>
</activeWhen>
</handler>
</extension>
<!-- adding resource factories -->
<extension
point="org.eclipse.emf.ecore.extension_parser">
<parser
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.resource.IResourceFactory"
type="cfg">
</parser>
</extension>
<extension point="org.eclipse.xtext.extension_resourceServiceProvider">
<resourceServiceProvider
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.resource.IResourceUIServiceProvider"
uriExtension="cfg">
</resourceServiceProvider>
</extension>
<!-- Quick Outline -->
<extension
point="org.eclipse.ui.handlers">
<handler
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.outline.quickoutline.ShowQuickOutlineActionHandler"
commandId="org.eclipse.xtext.ui.editor.outline.QuickOutline">
<activeWhen>
<reference
definitionId="org.wesnoth.WML.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="org.wesnoth.WML.Editor.opened"/>
</visibleWhen>
</command>
</menuContribution>
</extension>
<!-- quickfix marker resolution generator -->
<extension
point="org.eclipse.ui.ide.markerResolution">
<markerResolutionGenerator
class="org.wesnoth.ui.WMLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.quickfix.MarkerResolutionGenerator">
</markerResolutionGenerator>
</extension>
</plugin>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.wesnoth.wml</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,30 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: org.wesnoth.wml
Bundle-Vendor: Wesnoth.org
Bundle-Version: 1.0.0
Bundle-SymbolicName: org.wesnoth.wml; singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.xtext,
org.eclipse.xtext.generator;resolution:=optional,
org.apache.commons.logging;resolution:=optional,
org.eclipse.emf.codegen.ecore;resolution:=optional,
org.eclipse.emf.mwe.utils;resolution:=optional,
org.eclipse.emf.mwe2.launch;resolution:=optional,
com.ibm.icu;resolution:=optional,
org.eclipse.xtext.xtend;resolution:=optional,
org.eclipse.xtext.util,
org.eclipse.emf.ecore,
org.eclipse.emf.common,
org.antlr.runtime
Import-Package: org.apache.log4j
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.wesnoth,
org.wesnoth.services,
org.wesnoth.wML,
org.wesnoth.wML.impl,
org.wesnoth.wML.util,
org.wesnoth.parseTreeConstruction,
org.wesnoth.parser.antlr,
org.wesnoth.parser.antlr.internal,
org.wesnoth.validation

View file

@ -0,0 +1,5 @@
source.. = src/,\
src-gen/
bin.includes = META-INF/,\
.,\
plugin.xml

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
<extension point="org.eclipse.emf.ecore.generated_package">
<package
uri = "http://www.wesnoth.org/WML"
class = "org.wesnoth.wML.WMLPackage"
genModel = "org/wesnoth/WML.genmodel" />
</extension>
</plugin>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
<extension point="org.eclipse.emf.ecore.generated_package">
<package
uri = "http://www.wesnoth.org/WML"
class = "org.wesnoth.wML.WMLPackage"
genModel = "org/wesnoth/WML.genmodel" />
</extension>
</plugin>