Skip to content

Commit

Permalink
eclipse-glsp#153: Improve external navigation support through dedicat…
Browse files Browse the repository at this point in the history
…ed action (eclipse-glsp#92)

- Introduce dedicated 'NavigateToExternalTarget' action
- Fix issue with wrong field name in 'NavigateToTarget' action

Part of eclipse-glsp/glsp/issues/153

Signed-off-by: Martin Fleck <mfleck@eclipsesource.com>
  • Loading branch information
martin-fleck-at authored Dec 1, 2020
1 parent 72c1c59 commit 94f7658
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/********************************************************************************
* Copyright (c) 2020 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.features.navigation;

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

public class NavigateToExternalTargetAction extends Action {

public static final String ID = "navigateToExternalTarget";

private NavigationTarget target;

public NavigateToExternalTargetAction() {
super(ID);
}

public NavigateToExternalTargetAction(final NavigationTarget target) {
this();
this.target = target;
}

public NavigationTarget getTarget() { return target; }

public void setTarget(final NavigationTarget navigationTarget) { this.target = navigationTarget; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ public class NavigateToTargetAction extends Action {

public static final String ID = "navigateToTarget";

private NavigationTarget navigationTarget;
private NavigationTarget target;

public NavigateToTargetAction() {
super(ID);
}

public NavigateToTargetAction(final NavigationTarget navigationTarget) {
public NavigateToTargetAction(final NavigationTarget target) {
this();
this.navigationTarget = navigationTarget;
this.target = target;
}

public NavigationTarget getNavigationTarget() { return navigationTarget; }
public NavigationTarget getTarget() { return target; }

public void setNavigationTarget(final NavigationTarget navigationTarget) {
this.navigationTarget = navigationTarget;
public void setTarget(final NavigationTarget navigationTarget) {
this.target = navigationTarget;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
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.navigation.NavigateToExternalTargetAction;
import org.eclipse.glsp.server.features.navigation.NavigateToTargetAction;
import org.eclipse.glsp.server.features.navigation.RequestNavigationTargetsActionHandler;
import org.eclipse.glsp.server.features.navigation.ResolveNavigationTargetActionHandler;
Expand Down Expand Up @@ -108,6 +109,7 @@ private MultiBindingDefaults() {}
GLSPServerStatusAction.class,
ModelSourceChangedAction.class,
NavigateToTargetAction.class,
NavigateToExternalTargetAction.class,
RequestBoundsAction.class,
SelectAction.class,
SelectAllAction.class,
Expand Down

0 comments on commit 94f7658

Please sign in to comment.