-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unnecessary 'ApplyTaskEditAction' and update operation handlers
- Use 'EditTaskOperation' directly from the client - Minor checkstyle cleanup and refactoring for Paste handler - Make CutOperationHandler GModel-specific as it returns recording cmd - Let LayoutOperationHandler inherit from generic base class - Update some JavaDoc Relates to eclipse-glsp/glsp#864
- Loading branch information
1 parent
19c071f
commit d739b0f
Showing
12 changed files
with
78 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 0 additions & 43 deletions
43
....example.workflow/src/org/eclipse/glsp/example/workflow/taskedit/ApplyTaskEditAction.java
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
...e.workflow/src/org/eclipse/glsp/example/workflow/taskedit/ApplyTaskEditActionHandler.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...org.eclipse.glsp.server/src/org/eclipse/glsp/server/gmodel/GModelCutOperationHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2020-2023 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 | ||
* https://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the Eclipse | ||
* Public License v. 2.0 are satisfied: GNU General Public License, version 2 | ||
* with the GNU Classpath Exception which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
********************************************************************************/ | ||
package org.eclipse.glsp.server.gmodel; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
import org.eclipse.emf.common.command.Command; | ||
import org.eclipse.glsp.server.actions.ActionDispatcher; | ||
import org.eclipse.glsp.server.operations.CutOperation; | ||
import org.eclipse.glsp.server.operations.DeleteOperation; | ||
import org.eclipse.glsp.server.operations.GModelOperationHandler; | ||
|
||
import com.google.inject.Inject; | ||
|
||
/** | ||
* Performs the cut operation by dispatching a {@link DeleteOperation} for the elements to be cut. | ||
*/ | ||
public class GModelCutOperationHandler extends GModelOperationHandler<CutOperation> { | ||
|
||
@Inject | ||
protected ActionDispatcher actionDispatcher; | ||
|
||
protected List<String> getElementsToCut(final CutOperation cutAction) { | ||
return cutAction.getEditorContext().getSelectedElementIds(); | ||
} | ||
|
||
@Override | ||
public Optional<Command> createCommand(final CutOperation operation) { | ||
List<String> elementsToCut = getElementsToCut(operation); | ||
return elementsToCut.isEmpty() | ||
? doNothing() | ||
: commandOf(() -> actionDispatcher.dispatch(new DeleteOperation(elementsToCut))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters