-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add actions to disconnect and reconnect manually
Signed-off-by: Adam Wisniewski <[email protected]>
- Loading branch information
1 parent
81b9dbe
commit 6136b06
Showing
7 changed files
with
120 additions
and
3 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
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
24 changes: 24 additions & 0 deletions
24
...lipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyDebugDisconnectActionDelegate.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,24 @@ | ||
package io.openliberty.tools.eclipse.debug; | ||
|
||
import java.util.Arrays; | ||
|
||
import org.eclipse.debug.core.DebugException; | ||
import org.eclipse.debug.core.ILaunch; | ||
import org.eclipse.debug.core.model.IDebugTarget; | ||
import org.eclipse.debug.internal.ui.DebugUIPlugin; | ||
import org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate; | ||
|
||
public class LibertyDebugDisconnectActionDelegate extends AbstractDebugActionDelegate { | ||
|
||
@Override | ||
protected void doAction(Object object) throws DebugException { | ||
|
||
ILaunch launch = DebugUIPlugin.getLaunch(object); | ||
for (IDebugTarget target : Arrays.asList(launch.getDebugTargets())) { | ||
if (target instanceof LibertyDebugTarget) { | ||
((LibertyDebugTarget) target).setRelaunch(false); | ||
} | ||
target.disconnect(); | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...eclipse.ui/src/io/openliberty/tools/eclipse/debug/LibertyDebugRelaunchActionDelegate.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,37 @@ | ||
package io.openliberty.tools.eclipse.debug; | ||
|
||
import org.eclipse.core.runtime.CoreException; | ||
import org.eclipse.debug.core.ILaunch; | ||
import org.eclipse.debug.internal.ui.DebugUIPlugin; | ||
import org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate; | ||
|
||
import io.openliberty.tools.eclipse.DevModeOperations; | ||
import io.openliberty.tools.eclipse.Project; | ||
import io.openliberty.tools.eclipse.ui.launch.StartTab; | ||
|
||
public class LibertyDebugRelaunchActionDelegate extends AbstractDebugActionDelegate { | ||
|
||
@Override | ||
protected void doAction(Object object) { | ||
ILaunch launch = DebugUIPlugin.getLaunch(object); | ||
|
||
if (launch != null) { | ||
DevModeOperations devModeOps = DevModeOperations.getInstance(); | ||
|
||
String projectName = ""; | ||
try { | ||
projectName = launch.getLaunchConfiguration().getAttribute(StartTab.PROJECT_NAME, ""); | ||
} catch (CoreException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
|
||
Project project = devModeOps.getProjectModel().getProject(projectName); | ||
|
||
if (!devModeOps.isProjectTerminalTabMarkedClosed(projectName)) { | ||
devModeOps.debugModeHandler.startDebugAttacher(project, launch, null, true); | ||
} | ||
|
||
} | ||
} | ||
} |
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