Skip to content

Commit

Permalink
Rename ModelSourceChangedAction etc to SourceModelChangedAction
Browse files Browse the repository at this point in the history
This is to be consistent with the term source model that we now use to
refer to the underlying model from which the GModel is created.

eclipse-glsp/glsp#655
  • Loading branch information
planger committed Jun 1, 2022
1 parent ffbd1b5 commit 4aac9ee
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@
import org.eclipse.glsp.server.features.core.model.SourceModelStorage;
import org.eclipse.glsp.server.features.directediting.ContextEditValidator;
import org.eclipse.glsp.server.features.directediting.LabelEditValidator;
import org.eclipse.glsp.server.features.modelsourcewatcher.FileWatcher;
import org.eclipse.glsp.server.features.modelsourcewatcher.SourceModelWatcher;
import org.eclipse.glsp.server.features.navigation.NavigationTargetProvider;
import org.eclipse.glsp.server.features.navigation.NavigationTargetResolver;
import org.eclipse.glsp.server.features.popup.PopupModelFactory;
import org.eclipse.glsp.server.features.sourcemodelwatcher.FileWatcher;
import org.eclipse.glsp.server.features.sourcemodelwatcher.SourceModelWatcher;
import org.eclipse.glsp.server.features.validation.ModelValidator;
import org.eclipse.glsp.server.gmodel.GModelDiagramModule;
import org.eclipse.glsp.server.gmodel.GModelStorage;
Expand Down
2 changes: 1 addition & 1 deletion plugins/org.eclipse.glsp.server/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Export-Package: org.eclipse.glsp.server.actions,
org.eclipse.glsp.server.features.contextmenu,
org.eclipse.glsp.server.features.core.model,
org.eclipse.glsp.server.features.directediting,
org.eclipse.glsp.server.features.modelsourcewatcher,
org.eclipse.glsp.server.features.navigation,
org.eclipse.glsp.server.features.popup,
org.eclipse.glsp.server.features.sourcemodelwatcher,
org.eclipse.glsp.server.features.toolpalette,
org.eclipse.glsp.server.features.undoredo,
org.eclipse.glsp.server.features.validation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.Optional;

import org.eclipse.glsp.server.features.core.model.SourceModelStorage;
import org.eclipse.glsp.server.features.modelsourcewatcher.SourceModelWatcher;
import org.eclipse.glsp.server.features.sourcemodelwatcher.SourceModelWatcher;
import org.eclipse.glsp.server.model.GModelState;

import com.google.inject.Inject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@
import org.eclipse.glsp.server.features.directediting.LabelEditValidator;
import org.eclipse.glsp.server.features.directediting.RequestEditValidationHandler;
import org.eclipse.glsp.server.features.directediting.SetEditValidationResultAction;
import org.eclipse.glsp.server.features.modelsourcewatcher.ModelSourceChangedAction;
import org.eclipse.glsp.server.features.modelsourcewatcher.SourceModelWatcher;
import org.eclipse.glsp.server.features.navigation.NavigateToExternalTargetAction;
import org.eclipse.glsp.server.features.navigation.NavigateToTargetAction;
import org.eclipse.glsp.server.features.navigation.NavigationTargetProvider;
Expand All @@ -77,6 +75,8 @@
import org.eclipse.glsp.server.features.popup.PopupModelFactory;
import org.eclipse.glsp.server.features.popup.RequestPopupModelActionHandler;
import org.eclipse.glsp.server.features.popup.SetPopupModelAction;
import org.eclipse.glsp.server.features.sourcemodelwatcher.SourceModelChangedAction;
import org.eclipse.glsp.server.features.sourcemodelwatcher.SourceModelWatcher;
import org.eclipse.glsp.server.features.toolpalette.ToolPaletteItemProvider;
import org.eclipse.glsp.server.features.undoredo.UndoRedoActionHandler;
import org.eclipse.glsp.server.features.validation.DeleteMarkersAction;
Expand Down Expand Up @@ -285,7 +285,7 @@ protected void configureClientActions(final MultiBinding<Action> binding) {
binding.add(ExportSVGAction.class);
binding.add(DeleteMarkersAction.class);
binding.add(FitToScreenAction.class);
binding.add(ModelSourceChangedAction.class);
binding.add(SourceModelChangedAction.class);
binding.add(NavigateToTargetAction.class);
binding.add(NavigateToExternalTargetAction.class);
binding.add(RequestBoundsAction.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.eclipse.glsp.server.actions.Action;
import org.eclipse.glsp.server.actions.ActionDispatcher;
import org.eclipse.glsp.server.di.DiagramModule;
import org.eclipse.glsp.server.features.modelsourcewatcher.SourceModelWatcher;
import org.eclipse.glsp.server.features.sourcemodelwatcher.SourceModelWatcher;
import org.eclipse.glsp.server.model.GModelState;
import org.eclipse.glsp.server.utils.ServerMessageUtil;
import org.eclipse.glsp.server.utils.ServerStatusUtil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
package org.eclipse.glsp.server.features.modelsourcewatcher;
package org.eclipse.glsp.server.features.sourcemodelwatcher;

import static java.nio.file.StandardWatchEventKinds.ENTRY_DELETE;
import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY;
Expand Down Expand Up @@ -141,7 +141,7 @@ protected void scheduleClientNotification(final String clientId, final Path file
}

protected void notifyClient(final ClientNotification clientNotification) {
actionDispatcher.dispatch(new ModelSourceChangedAction(clientNotification.modelSourceName));
actionDispatcher.dispatch(new SourceModelChangedAction(clientNotification.modelSourceName));
}

class FileWatchWorker extends Thread {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2020 EclipseSource and others.
* Copyright (c) 2020-2022 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand All @@ -13,23 +13,23 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
package org.eclipse.glsp.server.features.modelsourcewatcher;
package org.eclipse.glsp.server.features.sourcemodelwatcher;

import org.eclipse.glsp.server.actions.Action;

public class ModelSourceChangedAction extends Action {
public class SourceModelChangedAction extends Action {

private String modelSourceName = "";
private String sourceModelName = "";

public ModelSourceChangedAction() {
super("modelSourceChanged");
public SourceModelChangedAction() {
super("sourceModelChanged");
}

public ModelSourceChangedAction(final String modelSource) {
public SourceModelChangedAction(final String sourceModelName) {
this();
this.modelSourceName = modelSource;
this.sourceModelName = sourceModelName;
}

public String getModelSourceName() { return modelSourceName; }
public String getSourceModelName() { return sourceModelName; }

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
package org.eclipse.glsp.server.features.modelsourcewatcher;
package org.eclipse.glsp.server.features.sourcemodelwatcher;

/**
* A source model watcher observes the source model resource and notifies the client if the source model has changed.
Expand Down
2 changes: 1 addition & 1 deletion tests/org.eclipse.glsp.server.test/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Automatic-Module-Name: org.eclipse.glsp.graph.test
Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-Vendor: Eclipse GLSP
Export-Package:
org.eclipse.glsp.server.features.modelsourcewatcher
org.eclipse.glsp.server.features.sourcemodelwatcher
Import-Package: org.junit;version="4.12.0",
org.junit.jupiter.api;version="5.0.0"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2020-2021 EclipseSource and others.
* Copyright (c) 2020-2022 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand All @@ -13,7 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
package org.eclipse.glsp.server.features.modelsourcewatcher;
package org.eclipse.glsp.server.features.sourcemodelwatcher;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down Expand Up @@ -151,7 +151,7 @@ private void assertNoNotification() {
private void assertNotifications(final int size) throws InterruptedException {
assertEquals(actionDispatcher.dispatchedActions.size(), size);
for (int i = 0; i < size; i++) {
assertTrue(actionDispatcher.dispatchedActions.get(i) instanceof ModelSourceChangedAction);
assertTrue(actionDispatcher.dispatchedActions.get(i) instanceof SourceModelChangedAction);
}
}

Expand Down

0 comments on commit 4aac9ee

Please sign in to comment.