Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2013-07-08 06:17:09 +0000
committerHenrik Rentz-Reichert2013-07-08 16:26:53 +0000
commit6b6821c20592373e7c8bf2d1b251325f4b996201 (patch)
tree6edb2b0e666dd91990a55b31cd669fee2d84a6c5 /plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core
parent015004ced90703e2b22d4b8b86ecd4ea9580334f (diff)
downloadorg.eclipse.etrice-6b6821c20592373e7c8bf2d1b251325f4b996201.tar.gz
org.eclipse.etrice-6b6821c20592373e7c8bf2d1b251325f4b996201.tar.xz
org.eclipse.etrice-6b6821c20592373e7c8bf2d1b251325f4b996201.zip
[core.room] bug 412084: [core.room] Introduce DynamicsType in grammar
https://bugs.eclipse.org/bugs/show_bug.cgi?id=412084
Diffstat (limited to 'plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core')
-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