use of org.eclipse.che.ide.debug.Debugger in project che by eclipse.
the class DebugConfigurationsManagerImpl method apply.
@Override
public void apply(final DebugConfiguration debugConfiguration) {
if (debugConfiguration == null) {
return;
}
if (debuggerManager.getActiveDebugger() != null) {
dialogFactory.createMessageDialog(localizationConstants.connectToRemote(), localizationConstants.debuggerAlreadyConnected(), null).show();
return;
}
final Debugger debugger = debuggerManager.getDebugger(debugConfiguration.getType().getId());
if (debugger != null) {
debuggerManager.setActiveDebugger(debugger);
currentProjectPathMacro.expand().then(new Operation<String>() {
@Override
public void apply(String arg) throws OperationException {
Map<String, String> connectionProperties = prepareConnectionProperties(debugConfiguration, arg);
debugger.connect(connectionProperties).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError arg) throws OperationException {
debuggerManager.setActiveDebugger(null);
}
});
}
});
}
}
use of org.eclipse.che.ide.debug.Debugger in project che by eclipse.
the class ChangeValuePresenter method onChangeClicked.
/** {@inheritDoc} */
@Override
public void onChangeClicked() {
Debugger debugger = debuggerManager.getActiveDebugger();
if (debugger != null) {
Variable newVariable = new VariableImpl(view.getValue(), variable.getVariablePath());
debugger.setValue(newVariable);
}
view.close();
}
use of org.eclipse.che.ide.debug.Debugger in project che by eclipse.
the class EvaluateExpressionPresenter method onEvaluateClicked.
/** {@inheritDoc} */
@Override
public void onEvaluateClicked() {
Debugger debugger = debuggerManager.getActiveDebugger();
if (debugger != null) {
view.setEnableEvaluateButton(false);
debugger.evaluate(view.getExpression()).then(new Operation<String>() {
@Override
public void apply(String result) throws OperationException {
view.setResult(result);
view.setEnableEvaluateButton(true);
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError error) throws OperationException {
view.setResult(constant.evaluateExpressionFailed(error.getMessage()));
view.setEnableEvaluateButton(true);
}
});
}
}
use of org.eclipse.che.ide.debug.Debugger in project che by eclipse.
the class StepOverAction method updateInPerspective.
@Override
public void updateInPerspective(ActionEvent event) {
Debugger debugger = debuggerManager.getActiveDebugger();
event.getPresentation().setEnabled(debugger != null && debugger.isSuspended());
}
use of org.eclipse.che.ide.debug.Debugger in project che by eclipse.
the class EvaluateExpressionAction method updateInPerspective.
@Override
public void updateInPerspective(ActionEvent event) {
Debugger debugger = debuggerManager.getActiveDebugger();
event.getPresentation().setEnabled(debugger != null && debugger.isSuspended());
}
Aggregations