From 9d678967c56d6356a18c4abbca1156cb62449181 Mon Sep 17 00:00:00 2001 From: Soeren Domroes Date: Wed, 13 Mar 2024 15:57:11 +0100 Subject: [PATCH] Renamed IActionHandler to ISprottyActionHandler. --- ...er => de.cau.cs.kieler.klighd.lsp.ISprottyActionHandler} | 0 .../de/cau/cs/kieler/klighd/lsp/AbstractActionHandler.xtend | 4 +--- .../{IActionHandler.xtend => ISprottyActionHandler.xtend} | 6 ++---- .../de/cau/cs/kieler/klighd/lsp/KGraphDiagramServer.xtend | 4 ++-- .../klighd/lsp/gson_utils/KGraphTypeAdapterUtil.xtend | 4 ++-- 5 files changed, 7 insertions(+), 11 deletions(-) rename plugins/de.cau.cs.kieler.klighd.lsp/META-INF/services/{de.cau.cs.kieler.klighd.lsp.IActionHandler => de.cau.cs.kieler.klighd.lsp.ISprottyActionHandler} (100%) rename plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/{IActionHandler.xtend => ISprottyActionHandler.xtend} (93%) diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/META-INF/services/de.cau.cs.kieler.klighd.lsp.IActionHandler b/plugins/de.cau.cs.kieler.klighd.lsp/META-INF/services/de.cau.cs.kieler.klighd.lsp.ISprottyActionHandler similarity index 100% rename from plugins/de.cau.cs.kieler.klighd.lsp/META-INF/services/de.cau.cs.kieler.klighd.lsp.IActionHandler rename to plugins/de.cau.cs.kieler.klighd.lsp/META-INF/services/de.cau.cs.kieler.klighd.lsp.ISprottyActionHandler diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/AbstractActionHandler.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/AbstractActionHandler.xtend index 738cadec9..eb5a81bce 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/AbstractActionHandler.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/AbstractActionHandler.xtend @@ -21,10 +21,8 @@ import org.eclipse.sprotty.Action /** * Abstract class to handle Sprotty actions. - * - * @author sdo */ -abstract class AbstractActionHandler implements IActionHandler { +abstract class AbstractActionHandler implements ISprottyActionHandler { Map> supportedMessages diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/IActionHandler.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/ISprottyActionHandler.xtend similarity index 93% rename from plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/IActionHandler.xtend rename to plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/ISprottyActionHandler.xtend index da17fabc2..875198c82 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/IActionHandler.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/ISprottyActionHandler.xtend @@ -20,11 +20,9 @@ import org.eclipse.sprotty.Action import java.util.Map /** - * Service Interface for ActionHandler. - * - * @author sdo + * Service interface for Sprotty action handlers. */ -interface IActionHandler { +interface ISprottyActionHandler { def Map> getSupportedMessages(); diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServer.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServer.xtend index 459b816a0..277c9f398 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServer.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServer.xtend @@ -94,7 +94,7 @@ class KGraphDiagramServer extends LanguageAwareDiagramServer { @Inject protected Injector injector - Map handlers = new HashMap + Map handlers = new HashMap @Inject protected KGraphDiagramState diagramState @@ -145,7 +145,7 @@ class KGraphDiagramServer extends LanguageAwareDiagramServer { currentRoot.setType("NONE"); currentRoot.setId("ROOT"); // Create map of registered action kinds and handlers. - ServiceLoader.load(IActionHandler, KlighdDataManager.getClassLoader()).forEach[handler | + ServiceLoader.load(ISprottyActionHandler, KlighdDataManager.getClassLoader()).forEach[handler | val Set kindsSupported = handler.supportedMessages.keySet for (kind : kindsSupported) { handlers.put(kind, handler); diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/gson_utils/KGraphTypeAdapterUtil.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/gson_utils/KGraphTypeAdapterUtil.xtend index c75a48d86..b0bdcc778 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/gson_utils/KGraphTypeAdapterUtil.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/gson_utils/KGraphTypeAdapterUtil.xtend @@ -20,7 +20,7 @@ import com.google.gson.GsonBuilder import com.google.inject.Injector import de.cau.cs.kieler.klighd.KlighdDataManager import de.cau.cs.kieler.klighd.SynthesisOption -import de.cau.cs.kieler.klighd.lsp.IActionHandler +import de.cau.cs.kieler.klighd.lsp.ISprottyActionHandler import de.cau.cs.kieler.klighd.lsp.model.CheckedImagesAction import de.cau.cs.kieler.klighd.lsp.model.PerformActionAction import de.cau.cs.kieler.klighd.lsp.model.RefreshDiagramAction @@ -50,7 +50,7 @@ class KGraphTypeAdapterUtil { addActionKind(RefreshLayoutAction.KIND, RefreshLayoutAction) // Load all registered action handlers and add their actions. - ServiceLoader.load(IActionHandler, KlighdDataManager.getClassLoader()).forEach[handler | + ServiceLoader.load(ISprottyActionHandler, KlighdDataManager.getClassLoader()).forEach[handler | val handlerInstance = injector.getInstance(handler.class) handlerInstance.supportedMessages.keySet.forEach[kind | addActionKind(kind, handlerInstance.supportedMessages.get(kind))