Skip to content

Commit

Permalink
Renamed IActionHandler to ISprottyActionHandler.
Browse files Browse the repository at this point in the history
  • Loading branch information
soerendomroes committed Mar 13, 2024
1 parent 8628021 commit 9d67896
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Class<? extends Action>> supportedMessages

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Class<? extends Action>> getSupportedMessages();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class KGraphDiagramServer extends LanguageAwareDiagramServer {

@Inject protected Injector injector

Map<String, IActionHandler> handlers = new HashMap
Map<String, ISprottyActionHandler> handlers = new HashMap

@Inject
protected KGraphDiagramState diagramState
Expand Down Expand Up @@ -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<String> kindsSupported = handler.supportedMessages.keySet
for (kind : kindsSupported) {
handlers.put(kind, handler);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 9d67896

Please sign in to comment.