Skip to content

Commit

Permalink
[#1731] Fixing invalid links on the Xtext documentation website.
Browse files Browse the repository at this point in the history
Signed-off-by: Tamas Miklossy <miklossy@itemis.de>
  • Loading branch information
miklossy committed May 1, 2020
1 parent eb57627 commit 442d1e3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions xtext-website/documentation/302_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ The Xtext generator needs to know the structure of your project in order to gene
* `eclipsePluginTest` &ndash; Unit tests for `eclipsePlugin`
* `web` &ndash; Integration into web applications

These subprojects are of type [SubProjectConfig]({{site.src.xtext_core}}/org.eclipse.xtext.xtext.generator/src/org/eclipse/xtext/xtext/generator/model/project/SubProjectConfig.xtend) and offer important parameters:
These subprojects are of type [SubProjectConfig]({{site.src.xtext_core}}/org.eclipse.xtext.xtext.generator/src/org/eclipse/xtext/xtext/generator/model/project/SubProjectConfig.java) and offer important parameters:

* `enabled` &ndash; whether the subproject is present or not
* `name` &ndash; the name of the subproject
Expand Down Expand Up @@ -205,7 +205,7 @@ The configuration block of our generator workflow example above contains a [Code
* `fileHeader` &ndash; The file header comment to insert at the beginning of each file
* `preferXtendStubs` &ndash; Whether to prefer Xtend over Java for stub files to be implemented manually; this option applies only to files in `src` folders, while for `src-gen` folders Java files are always generated.

The container for the [StandardProjectConfig]({{site.src.xtext_core}}/org.eclipse.xtext.xtext.generator/src/org/eclipse/xtext/xtext/generator/model/project/StandardProjectConfig.xtend) and [CodeConfig]({{site.src.xtext_core}}/org.eclipse.xtext.xtext.generator/src/org/eclipse/xtext/xtext/generator/CodeConfig.xtend) is of type [DefaultGeneratorModule]({{site.src.xtext_core}}/org.eclipse.xtext.xtext.generator/src/org/eclipse/xtext/xtext/generator/DefaultGeneratorModule.xtend) and is assigned to the property `configuration` of the [XtextGenerator]({{site.src.xtext_core}}/org.eclipse.xtext.xtext.generator/src/org/eclipse/xtext/xtext/generator/XtextGenerator.xtend). The DefaultGeneratorModule is actually a [Guice](https://github.com/google/guice) module, which can be subclassed in a similar way as explained in [Dependency Injection](#dependency-injection) for overriding default configurations. This allows to alter the configuration in places that are not accessible through MWE2. For instance, you could bind your own subclass of [XtextGeneratorNaming]({{site.src.xtext_core}}/org.eclipse.xtext.xtext.generator/src/org/eclipse/xtext/xtext/generator/XtextGeneratorNaming.xtend) in order to influence the names of generated classes.
The container for the [StandardProjectConfig]({{site.src.xtext_core}}/org.eclipse.xtext.xtext.generator/src/org/eclipse/xtext/xtext/generator/model/project/StandardProjectConfig.java) and [CodeConfig]({{site.src.xtext_core}}/org.eclipse.xtext.xtext.generator/src/org/eclipse/xtext/xtext/generator/CodeConfig.xtend) is of type [DefaultGeneratorModule]({{site.src.xtext_core}}/org.eclipse.xtext.xtext.generator/src/org/eclipse/xtext/xtext/generator/DefaultGeneratorModule.java) and is assigned to the property `configuration` of the [XtextGenerator]({{site.src.xtext_core}}/org.eclipse.xtext.xtext.generator/src/org/eclipse/xtext/xtext/generator/XtextGenerator.xtend). The DefaultGeneratorModule is actually a [Guice](https://github.com/google/guice) module, which can be subclassed in a similar way as explained in [Dependency Injection](#dependency-injection) for overriding default configurations. This allows to alter the configuration in places that are not accessible through MWE2. For instance, you could bind your own subclass of [XtextGeneratorNaming]({{site.src.xtext_core}}/org.eclipse.xtext.xtext.generator/src/org/eclipse/xtext/xtext/generator/XtextGeneratorNaming.java) in order to influence the names of generated classes.

### Language Configuration {#language-configuration}

Expand All @@ -216,7 +216,7 @@ The base class for describing a language configuration is [XtextGeneratorLanguag
* `fileExtensions` &ndash; A comma-separated list of file extensions for the language
* `referencedResources` &ndash; Additional resources to load (see [Importing Existing Metamodels](#importing-metamodels))

The actual code generation is performed by [generator fragments]({{site.src.xtext_core}}/org.eclipse.xtext.xtext.generator/src/org/eclipse/xtext/xtext/generator/IXtextGeneratorFragment.xtend), which can be added to a language configuration using the `fragment` property. The Xtext project wizard creates a workflow that employs the [StandardLanguage]({{site.src.xtext_core}}/org.eclipse.xtext.xtext.generator/src/org/eclipse/xtext/xtext/generator/StandardLanguage.xtend), which specializes XtextGeneratorLanguage in a similar way as StandardProjectConfig specializes XtextProjectConfig (see [Project Configuration](#project-configuration)). The main contribution of StandardLanguage is a default list of generator fragments that includes all features of Xtext. These fragments automatically adapt their generated code to your language and project configuration. Some fragments offer their own configuration parameters, hence each fragment can be accessed via a dedicated property in StandardLanguage. For instance, in the language configuration
The actual code generation is performed by [generator fragments]({{site.src.xtext_core}}/org.eclipse.xtext.xtext.generator/src/org/eclipse/xtext/xtext/generator/IXtextGeneratorFragment.java), which can be added to a language configuration using the `fragment` property. The Xtext project wizard creates a workflow that employs the [StandardLanguage]({{site.src.xtext_core}}/org.eclipse.xtext.xtext.generator/src/org/eclipse/xtext/xtext/generator/StandardLanguage.xtend), which specializes XtextGeneratorLanguage in a similar way as StandardProjectConfig specializes XtextProjectConfig (see [Project Configuration](#project-configuration)). The main contribution of StandardLanguage is a default list of generator fragments that includes all features of Xtext. These fragments automatically adapt their generated code to your language and project configuration. Some fragments offer their own configuration parameters, hence each fragment can be accessed via a dedicated property in StandardLanguage. For instance, in the language configuration

```mwe2
language = StandardLanguage {
Expand Down
10 changes: 5 additions & 5 deletions xtext-website/documentation/310_eclipse_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ The templates define two things. On the one hand they define how the template is
The templates are contributed to the wizard by the extension point `org.eclipse.xtext.ui.projectTemplate`. An implementor of [IProjectTemplateProvider]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/wizard/template/IProjectTemplateProvider.java) is registered for the language it provides templates to. The method of this interface returns instances of [AbstractProjectTemplate]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/wizard/template/AbstractProjectTemplate.java). Each of these instances defines one template.
To create a subclass of `AbstractProjectTemplate` it is advisable to annotate a class with the active annotation [ProjectTemplate]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/wizard/template/ProjectTemplate.xtend). With this annotation the name and description can be defined and will be made available to the user interface. Also the extension of `AbstractProjectTemplate` will be done for you.
To create a subclass of `AbstractProjectTemplate` it is advisable to annotate a class with the active annotation [ProjectTemplate]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/wizard/template/ProjectTemplate.java). With this annotation the name and description can be defined and will be made available to the user interface. Also the extension of `AbstractProjectTemplate` will be done for you.
In a project template the method `generateProjects(IProjectGenerator)` needs to be overridden. The parameter instance offers a single `generate` method that takes an instance of [ProjectFactory]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/util/ProjectFactory.java). Using this class, or available subclasses, all kind of projects can be generated by the template. The following illustrates a simple example to generate a plugin project with a template:
Expand Down Expand Up @@ -814,7 +814,7 @@ fileWizard = {
}
```
The API for the file wizard is very similar to the one of the project wizard. The templates are defined with the same widgets/parameters but instead of generating whole projects one or many files are generated. To add new template providers there is the extension point `org.eclipse.xtext.ui.fileTemplate` to register a [IFileTemplateProvider]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/wizard/template/IFileTemplateProvider.java). To create instances of [AbstractFileTemplate]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/wizard/template/AbstractFileTemplate.java) one should use the active annotation [FileTemplate]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/wizard/template/FileTemplate.xtend).
The API for the file wizard is very similar to the one of the project wizard. The templates are defined with the same widgets/parameters but instead of generating whole projects one or many files are generated. To add new template providers there is the extension point `org.eclipse.xtext.ui.fileTemplate` to register a [IFileTemplateProvider]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/wizard/template/IFileTemplateProvider.java). To create instances of [AbstractFileTemplate]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/wizard/template/AbstractFileTemplate.java) one should use the active annotation [FileTemplate]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/wizard/template/FileTemplate.java).
An simple example template might look like this:
Expand Down Expand Up @@ -878,11 +878,11 @@ Automated UI tests are crucial for the maintainability and the quality of a soft
* [AbstractAutoEditTest]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui.testing/src/org/eclipse/xtext/ui/testing/AbstractAutoEditTest.java): base class for testing the auto editing functionality
* [AbstractContentAssistTest]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui.testing/src/org/eclipse/xtext/ui/testing/AbstractContentAssistTest.java): base class for testing the content assistant and template proposals
* [AbstractFoldingTest]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui.testing/src/org/eclipse/xtext/ui/testing/AbstractFoldingTest.java): base class for testing the folding capabilities
* [AbstractHighlightingTest]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui.testing/src/org/eclipse/xtext/ui/testing/AbstractHighlightingTest.xtend): base class for testing the syntactical and semantic coloring
* [AbstractHighlightingTest]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui.testing/src/org/eclipse/xtext/ui/testing/AbstractHighlightingTest.java): base class for testing the syntactical and semantic coloring
* [AbstractHoverTest]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui.testing/src/org/eclipse/xtext/ui/testing/AbstractHoverTest.java): base class for testing the hovering functionality
* [AbstractHyperlinkingTest]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui.testing/src/org/eclipse/xtext/ui/testing/AbstractHyperlinkingTest.xtend): base class for testing the hyperlinking functionality
* [AbstractHyperlinkingTest]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui.testing/src/org/eclipse/xtext/ui/testing/AbstractHyperlinkingTest.java): base class for testing the hyperlinking functionality
* [AbstractOutlineTest]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui.testing/src/org/eclipse/xtext/ui/testing/AbstractOutlineTest.java): base class for testing the structure of the outline view
* [AbstractQuickfixTest]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui.testing/src/org/eclipse/xtext/ui/testing/AbstractQuickfixTest.xtend): base class for testing the quick fixes
* [AbstractQuickfixTest]({{site.src.xtext_eclipse}}/org.eclipse.xtext.ui.testing/src/org/eclipse/xtext/ui/testing/AbstractQuickfixTest.java): base class for testing the quick fixes
* ...

The Xtext example projects (*File &rarr; New &rarr; Example &rarr; Xtext Examples*) contain UI test cases that make use of these framework classes. Feel free to study the corresponding `org.eclipse.xtext.example.<language>.ui.tests` projects to get some inspirations on how to implement automated UI test cases for your Xtext-based language editor.
Expand Down
Loading

0 comments on commit 442d1e3

Please sign in to comment.