Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.etrice.core.room.ui/src/org')
-rw-r--r--plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/quickfix/RoomQuickfixProvider.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/quickfix/RoomQuickfixProvider.java b/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/quickfix/RoomQuickfixProvider.java
index 69ed6a43d..359f56515 100644
--- a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/quickfix/RoomQuickfixProvider.java
+++ b/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/quickfix/RoomQuickfixProvider.java
@@ -15,11 +15,15 @@ package org.eclipse.etrice.core.ui.quickfix;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.etrice.core.room.ActorRef;
+import org.eclipse.etrice.core.room.ReferenceType;
import org.eclipse.etrice.core.validation.RoomJavaValidator;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.xtext.ui.editor.model.IXtextDocument;
import org.eclipse.xtext.ui.editor.model.edit.IModification;
import org.eclipse.xtext.ui.editor.model.edit.IModificationContext;
+import org.eclipse.xtext.ui.editor.model.edit.ISemanticModification;
import org.eclipse.xtext.ui.editor.quickfix.DefaultQuickfixProvider;
import org.eclipse.xtext.ui.editor.quickfix.Fix;
import org.eclipse.xtext.ui.editor.quickfix.IssueResolution;
@@ -90,4 +94,26 @@ public class RoomQuickfixProvider extends DefaultQuickfixProvider {
}
});
}
+
+ @Fix(RoomJavaValidator.ACTOR_REF_CHANGE_REF_TYPE_TO_FIXED)
+ public void makeActorRefRefTypeFixed(final Issue issue, IssueResolutionAcceptor acceptor) {
+ acceptor.accept(issue, "Make actor reference fixed", "[fixed] ActorRef...", "add.gif", new ISemanticModification() {
+ @Override
+ public void apply(EObject element, IModificationContext context) throws Exception {
+ ActorRef ar = (ActorRef) element;
+ ar.setRefType(ReferenceType.FIXED);
+ }
+ });
+ }
+
+ @Fix(RoomJavaValidator.ACTOR_REF_CHANGE_REF_TYPE_TO_OPTIONAL)
+ public void makeActorRefRefTypeOptional(final Issue issue, IssueResolutionAcceptor acceptor) {
+ acceptor.accept(issue, "Make actor reference fixed", "optional ActorRef...", "add.gif", new ISemanticModification() {
+ @Override
+ public void apply(EObject element, IModificationContext context) throws Exception {
+ ActorRef ar = (ActorRef) element;
+ ar.setRefType(ReferenceType.OPTIONAL);
+ }
+ });
+ }
}

Back to the top