Commit 5e414196 authored by Daniel Endreß's avatar Daniel Endreß

Code cleanup. Final commit

parent 9985222f
......@@ -16,6 +16,8 @@ import static extension org.eclipse.xtext.EcoreUtil2.*
/**
* Provides labels for a EObjects.
*
* @author Daniel Endress
*
* see http://www.eclipse.org/Xtext/documentation.html#labelProvider
*/
class GDSLLabelProvider extends DefaultEObjectLabelProvider {
......
......@@ -11,6 +11,8 @@ import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode
/**
* Customization of the default outline structure.
*
* @author Daniel Endress
*
* see http://www.eclipse.org/Xtext/documentation.html#outline
*/
......@@ -23,10 +25,16 @@ class GDSLOutlineTreeProvider extends DefaultOutlineTreeProvider {
t.value != null
}
/**
* Skip the top level node
*/
def void _createChildren(DocumentRootNode outlineNode, Model model){
model.decl.forEach[decl | createNode(outlineNode, decl)]
}
/**
* Create constructors as the children nodes of type elements
*/
def void _createChildren(IOutlineNode parent, Type type){
type.conDecl.forEach[con | createNode(parent, con)]
}
......
......@@ -8,11 +8,16 @@ import org.eclipse.xtext.validation.Issue
/**
* Custom quickfixes.
*
* @author Daniel Endress
*
* see http://www.eclipse.org/Xtext/documentation.html#quickfixes
*/
class GDSLQuickfixProvider extends DefaultQuickfixProvider {
/**
* Capitalize a constructor
*/
@Fix(GDSLValidator::UPPERCASE_CONS)
def capitalizeCons(Issue issue, IssueResolutionAcceptor acceptor) {
acceptor.accept(issue,
......@@ -26,6 +31,9 @@ class GDSLQuickfixProvider extends DefaultQuickfixProvider {
])
}
/**
* Capitalize a constructor or remove the pattern
*/
@Fix(GDSLValidator::PATTERN_MISPLACEMENT)
def patternMisplacement(Issue issue, IssueResolutionAcceptor acceptor){
acceptor.accept(issue,
......
......@@ -22,6 +22,8 @@ import org.eclipse.xtext.xbase.lib.Conversions;
/**
* Provides labels for a EObjects.
*
* @author Daniel Endress
*
* see http://www.eclipse.org/Xtext/documentation.html#labelProvider
*/
@SuppressWarnings("all")
......
......@@ -18,6 +18,8 @@ import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
/**
* Customization of the default outline structure.
*
* @author Daniel Endress
*
* see http://www.eclipse.org/Xtext/documentation.html#outline
*/
@SuppressWarnings("all")
......@@ -39,6 +41,9 @@ public class GDSLOutlineTreeProvider extends DefaultOutlineTreeProvider {
return (!Objects.equal(_value, null));
}
/**
* Skip the top level node
*/
public void _createChildren(final DocumentRootNode outlineNode, final Model model) {
EList<Decl> _decl = model.getDecl();
final Procedure1<Decl> _function = new Procedure1<Decl>() {
......@@ -49,6 +54,9 @@ public class GDSLOutlineTreeProvider extends DefaultOutlineTreeProvider {
IterableExtensions.<Decl>forEach(_decl, _function);
}
/**
* Create constructors as the children nodes of type elements
*/
public void _createChildren(final IOutlineNode parent, final Type type) {
EList<ConDecl> _conDecl = type.getConDecl();
final Procedure1<ConDecl> _function = new Procedure1<ConDecl>() {
......
......@@ -12,10 +12,15 @@ import org.eclipse.xtext.validation.Issue;
/**
* Custom quickfixes.
*
* @author Daniel Endress
*
* see http://www.eclipse.org/Xtext/documentation.html#quickfixes
*/
@SuppressWarnings("all")
public class GDSLQuickfixProvider extends DefaultQuickfixProvider {
/**
* Capitalize a constructor
*/
@Fix(GDSLValidator.UPPERCASE_CONS)
public void capitalizeCons(final Issue issue, final IssueResolutionAcceptor acceptor) {
String[] _data = issue.getData();
......@@ -37,6 +42,9 @@ public class GDSLQuickfixProvider extends DefaultQuickfixProvider {
"", _function);
}
/**
* Capitalize a constructor or remove the pattern
*/
@Fix(GDSLValidator.PATTERN_MISPLACEMENT)
public void patternMisplacement(final Issue issue, final IssueResolutionAcceptor acceptor) {
String[] _data = issue.getData();
......
/**
* Grammar for the GDSL language
*
* @author Daniel Endress
*/
grammar gdsl.plugin.GDSL hidden(WS, ML_COMMENT, SL_COMMENT)
generate gDSL "http://www.plugin.gdsl/GDSL"
......
......@@ -5,6 +5,8 @@ import org.eclipse.core.runtime.preferences.InstanceScope;
/**
* Constant definitions for plug-in preferences
*
* @author Daniel Endress
*/
public class GDSLPluginPreferences {
public static final String PLUGIN_SCOPE = "gdsl.plugin";
......
......@@ -11,6 +11,8 @@ import org.eclipse.emf.ecore.resource.Resource;
/**
* Constant definitions for plug-in preferences
*
* @author Daniel Endress
*/
public class GDSLProjectProperties {
public static final String PLUGIN_SCOPE = "gdsl.plugin";
......
......@@ -17,6 +17,8 @@ import static extension java.lang.Character.*
/**
* Custom validation rules.
*
* @author Daniel Endress
*
* see http://www.eclipse.org/Xtext/documentation.html#validation
*/
......
......@@ -26,6 +26,8 @@ import org.eclipse.xtext.xbase.lib.Exceptions;
/**
* Custom validation rules.
*
* @author Daniel Endress
*
* see http://www.eclipse.org/Xtext/documentation.html#validation
*/
@SuppressWarnings("all")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment