Cleanup and fix of old settings

This commit is contained in:
2018-06-04 18:49:04 +02:00
parent acb5b95f5a
commit c7d8d6c417
44 changed files with 408 additions and 299 deletions

View File

@ -6,6 +6,7 @@ package com.minres.rdl;
import com.google.inject.Binder;
import com.google.inject.Provider;
import com.google.inject.name.Names;
import com.minres.rdl.formatting2.RDLFormatter;
import com.minres.rdl.generator.RDLGenerator;
import com.minres.rdl.parser.antlr.RDLAntlrTokenFileProvider;
import com.minres.rdl.parser.antlr.RDLParser;
@ -19,6 +20,9 @@ import com.minres.rdl.validation.RDLValidator;
import java.util.Properties;
import org.eclipse.xtext.Constants;
import org.eclipse.xtext.IGrammarAccess;
import org.eclipse.xtext.formatting2.FormatterPreferenceValuesProvider;
import org.eclipse.xtext.formatting2.FormatterPreferences;
import org.eclipse.xtext.formatting2.IFormatter2;
import org.eclipse.xtext.generator.IGenerator2;
import org.eclipse.xtext.naming.IQualifiedNameProvider;
import org.eclipse.xtext.naming.SimpleNameProvider;
@ -31,6 +35,7 @@ import org.eclipse.xtext.parser.antlr.ITokenDefProvider;
import org.eclipse.xtext.parser.antlr.Lexer;
import org.eclipse.xtext.parser.antlr.LexerBindings;
import org.eclipse.xtext.parser.antlr.LexerProvider;
import org.eclipse.xtext.preferences.IPreferenceValuesProvider;
import org.eclipse.xtext.resource.IContainer;
import org.eclipse.xtext.resource.IResourceDescriptions;
import org.eclipse.xtext.resource.containers.IAllContainersState;
@ -193,6 +198,16 @@ public abstract class AbstractRDLRuntimeModule extends DefaultRuntimeModule {
return RDLGenerator.class;
}
// contributed by org.eclipse.xtext.xtext.generator.formatting.Formatter2Fragment2
public Class<? extends IFormatter2> bindIFormatter2() {
return RDLFormatter.class;
}
// contributed by org.eclipse.xtext.xtext.generator.formatting.Formatter2Fragment2
public void configureFormatterPreferences(Binder binder) {
binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
// contributed by org.eclipse.xtext.xtext.generator.exporting.SimpleNamesFragment2
public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
return SimpleNameProvider.class;

View File

@ -402,7 +402,7 @@ public class ComponentDefinitionImpl extends MinimalEObjectImpl.Container implem
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
StringBuilder result = new StringBuilder(super.toString());
result.append(" (type: ");
result.append(type);
result.append(", name: ");

View File

@ -417,7 +417,7 @@ public class ComponentInstanceImpl extends EntityImpl implements ComponentInstan
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
StringBuilder result = new StringBuilder(super.toString());
result.append(" (reset: ");
result.append(reset);
result.append(", address: ");

View File

@ -256,7 +256,7 @@ public class ConcatElemImpl extends MinimalEObjectImpl.Container implements Conc
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
StringBuilder result = new StringBuilder(super.toString());
result.append(" (value: ");
result.append(value);
result.append(')');

View File

@ -168,7 +168,7 @@ public class EntityImpl extends MinimalEObjectImpl.Container implements Entity
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
StringBuilder result = new StringBuilder(super.toString());
result.append(" (name: ");
result.append(name);
result.append(')');

View File

@ -285,7 +285,7 @@ public class EnumEntryImpl extends MinimalEObjectImpl.Container implements EnumE
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
StringBuilder result = new StringBuilder(super.toString());
result.append(" (name: ");
result.append(name);
result.append(", index: ");

View File

@ -222,7 +222,7 @@ public class EnumInstanceTypeImpl extends MinimalEObjectImpl.Container implement
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
StringBuilder result = new StringBuilder(super.toString());
result.append(" (EXTERNAL: ");
result.append(external);
result.append(", INTERNAL: ");

View File

@ -222,7 +222,7 @@ public class EnumPropertyImpl extends MinimalEObjectImpl.Container implements En
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
StringBuilder result = new StringBuilder(super.toString());
result.append(" (name: ");
result.append(name);
result.append(", value: ");

View File

@ -311,7 +311,7 @@ public class ExplicitPropertyAssignmentImpl extends PropertyAssignmentImpl imple
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
StringBuilder result = new StringBuilder(super.toString());
result.append(" (modifier: ");
result.append(modifier);
result.append(", name: ");

View File

@ -168,7 +168,7 @@ public class IncludeImpl extends MinimalEObjectImpl.Container implements Include
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
StringBuilder result = new StringBuilder(super.toString());
result.append(" (importURI: ");
result.append(importURI);
result.append(')');

View File

@ -323,7 +323,7 @@ public class InstancePropertyRefImpl extends MinimalEObjectImpl.Container implem
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
StringBuilder result = new StringBuilder(super.toString());
result.append(" (propertyEnum: ");
result.append(propertyEnum);
result.append(')');

View File

@ -440,7 +440,7 @@ public class InstantiationImpl extends MinimalEObjectImpl.Container implements I
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
StringBuilder result = new StringBuilder(super.toString());
result.append(" (alias: ");
result.append(alias);
result.append(')');

View File

@ -394,7 +394,7 @@ public class PostPropertyAssignmentImpl extends PropertyAssignmentImpl implement
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
StringBuilder result = new StringBuilder(super.toString());
result.append(" (propertyEnum: ");
result.append(propertyEnum);
result.append(')');

View File

@ -222,7 +222,7 @@ public class PropertyDefaultImpl extends MinimalEObjectImpl.Container implements
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
StringBuilder result = new StringBuilder(super.toString());
result.append(" (string: ");
result.append(string);
result.append(", value: ");

View File

@ -328,7 +328,7 @@ public class PropertyDefinitionImpl extends EntityImpl implements PropertyDefini
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
StringBuilder result = new StringBuilder(super.toString());
result.append(" (type: ");
result.append(type);
result.append(')');

View File

@ -155,7 +155,7 @@ public class PropertyUsageImpl extends MinimalEObjectImpl.Container implements P
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
StringBuilder result = new StringBuilder(super.toString());
result.append(" (components: ");
result.append(components);
result.append(')');

View File

@ -277,7 +277,7 @@ public class RValueImpl extends MinimalEObjectImpl.Container implements RValue
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
StringBuilder result = new StringBuilder(super.toString());
result.append(" (val: ");
result.append(val);
result.append(", num: ");

View File

@ -276,7 +276,7 @@ public class RangeImpl extends MinimalEObjectImpl.Container implements Range
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
StringBuilder result = new StringBuilder(super.toString());
result.append(" (left: ");
result.append(left);
result.append(", right: ");

View File

@ -299,7 +299,7 @@ public class RdlPackageImpl extends EPackageImpl implements RdlPackage
/**
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
*
*
* <p>This method is used to initialize {@link RdlPackage#eINSTANCE} when that field is accessed.
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
* <!-- begin-user-doc -->
@ -314,7 +314,8 @@ public class RdlPackageImpl extends EPackageImpl implements RdlPackage
if (isInited) return (RdlPackage)EPackage.Registry.INSTANCE.getEPackage(RdlPackage.eNS_URI);
// Obtain or create and register package
RdlPackageImpl theRdlPackage = (RdlPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof RdlPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new RdlPackageImpl());
Object registeredRdlPackage = EPackage.Registry.INSTANCE.get(eNS_URI);
RdlPackageImpl theRdlPackage = registeredRdlPackage instanceof RdlPackageImpl ? (RdlPackageImpl)registeredRdlPackage : new RdlPackageImpl();
isInited = true;
@ -327,7 +328,6 @@ public class RdlPackageImpl extends EPackageImpl implements RdlPackage
// Mark meta-data to indicate it can't be changed
theRdlPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(RdlPackage.eNS_URI, theRdlPackage);
return theRdlPackage;

View File

@ -7,7 +7,10 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.xtext.validation.AbstractDeclarativeValidator;
import org.eclipse.xtext.validation.ComposedChecks;
import org.eclipse.xtext.validation.ImportUriValidator;
@ComposedChecks(validators = {ImportUriValidator.class})
public abstract class AbstractRDLValidator extends AbstractDeclarativeValidator {
@Override