mirror of
https://github.com/Minres/RDL-Editor.git
synced 2025-07-01 13:33:27 +02:00
Cleanup and fix of old settings
This commit is contained in:
@ -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;
|
||||
|
@ -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: ");
|
||||
|
@ -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: ");
|
||||
|
@ -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(')');
|
||||
|
@ -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(')');
|
||||
|
@ -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: ");
|
||||
|
@ -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: ");
|
||||
|
@ -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: ");
|
||||
|
@ -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: ");
|
||||
|
@ -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(')');
|
||||
|
@ -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(')');
|
||||
|
@ -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(')');
|
||||
|
@ -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(')');
|
||||
|
@ -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: ");
|
||||
|
@ -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(')');
|
||||
|
@ -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(')');
|
||||
|
@ -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: ");
|
||||
|
@ -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: ");
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user