Search in sources :

Example 6 with Element

use of org.eclipse.xtext.ui.tests.refactoring.refactoring.Element in project xtext-eclipse by eclipse.

the class RefactoringTestLanguageSemanticSequencer method sequence.

@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
    EPackage epackage = semanticObject.eClass().getEPackage();
    ParserRule rule = context.getParserRule();
    Action action = context.getAssignedAction();
    Set<Parameter> parameters = context.getEnabledBooleanParameters();
    if (epackage == RefactoringPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case RefactoringPackage.ELEMENT:
                sequence_Element(context, (Element) semanticObject);
                return;
            case RefactoringPackage.IMPORT:
                sequence_Import(context, (Import) semanticObject);
                return;
            case RefactoringPackage.MAIN:
                sequence_Main(context, (Main) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) Import(org.eclipse.xtext.ui.tests.refactoring.refactoring.Import) Element(org.eclipse.xtext.ui.tests.refactoring.refactoring.Element) Parameter(org.eclipse.xtext.Parameter) Main(org.eclipse.xtext.ui.tests.refactoring.refactoring.Main) EPackage(org.eclipse.emf.ecore.EPackage)

Aggregations

Element (org.eclipse.xtext.ui.tests.refactoring.refactoring.Element)6 XtextResource (org.eclipse.xtext.resource.XtextResource)5 Test (org.junit.Test)5 EObject (org.eclipse.emf.ecore.EObject)3 IFile (org.eclipse.core.resources.IFile)2 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)2 URI (org.eclipse.emf.common.util.URI)2 IRenameStrategy (org.eclipse.xtext.ui.refactoring.IRenameStrategy)2 Main (org.eclipse.xtext.ui.tests.refactoring.refactoring.Main)2 InputStream (java.io.InputStream)1 EAttribute (org.eclipse.emf.ecore.EAttribute)1 EPackage (org.eclipse.emf.ecore.EPackage)1 LinkedPosition (org.eclipse.jface.text.link.LinkedPosition)1 LinkedPositionGroup (org.eclipse.jface.text.link.LinkedPositionGroup)1 RefactoringStatus (org.eclipse.ltk.core.refactoring.RefactoringStatus)1 ReplaceEdit (org.eclipse.text.edits.ReplaceEdit)1 Action (org.eclipse.xtext.Action)1 CrossReference (org.eclipse.xtext.CrossReference)1 Parameter (org.eclipse.xtext.Parameter)1 ParserRule (org.eclipse.xtext.ParserRule)1