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

#153: Improve external navigation support through dedicated action #92

Merged
merged 1 commit into from
Dec 1, 2020
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
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