Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename ModelSourceChangedAction etc to SourceModelChangedAction #171

Merged
merged 1 commit into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- [gmodel] Move base diagram module and operation handlers that operate directly on GModels (as a model source) to the dedicated package `org.eclipse.glsp.server.gmodel` and add prefix `GModel` in the class name [#165](https://github.com/eclipse-glsp/glsp-server/pull/165)
- [logging] Update from log4j 1.x to log4j 2.17.1. [#163](https://github.com/eclipse-glsp/glsp-server/pull/163/)
- Affects logger creation across all classes
- [protocol] Rename `ModelSourceChangedAction` to `SourceModelChangedAction` including handlers [#171](https://github.com/eclipse-glsp/glsp-server/pull/171)

## [v0.9.0- 09/12/2021](https://github.com/eclipse-glsp/glsp/releases/tag/0.9.0)

Expand Down
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