Search in sources :

Example 6 with Debugger

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);
                    }
                });
            }
        });
    }
}
Also used : Debugger(org.eclipse.che.ide.debug.Debugger) PromiseError(org.eclipse.che.api.promises.client.PromiseError) Operation(org.eclipse.che.api.promises.client.Operation) HashMap(java.util.HashMap) Map(java.util.Map) OperationException(org.eclipse.che.api.promises.client.OperationException)

Example 7 with Debugger

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();
}
Also used : Debugger(org.eclipse.che.ide.debug.Debugger) VariableImpl(org.eclipse.che.api.debug.shared.model.impl.VariableImpl) Variable(org.eclipse.che.api.debug.shared.model.Variable)

Example 8 with Debugger

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);
            }
        });
    }
}
Also used : Debugger(org.eclipse.che.ide.debug.Debugger) PromiseError(org.eclipse.che.api.promises.client.PromiseError) Operation(org.eclipse.che.api.promises.client.Operation) OperationException(org.eclipse.che.api.promises.client.OperationException)

Example 9 with Debugger

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());
}
Also used : Debugger(org.eclipse.che.ide.debug.Debugger)

Example 10 with Debugger

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());
}
Also used : Debugger(org.eclipse.che.ide.debug.Debugger)

Aggregations

Debugger (org.eclipse.che.ide.debug.Debugger)12 Operation (org.eclipse.che.api.promises.client.Operation)4 OperationException (org.eclipse.che.api.promises.client.OperationException)4 PromiseError (org.eclipse.che.api.promises.client.PromiseError)4 HashMap (java.util.HashMap)1 Map (java.util.Map)1 SimpleValue (org.eclipse.che.api.debug.shared.model.SimpleValue)1 StackFrameDump (org.eclipse.che.api.debug.shared.model.StackFrameDump)1 Variable (org.eclipse.che.api.debug.shared.model.Variable)1 VariableImpl (org.eclipse.che.api.debug.shared.model.impl.VariableImpl)1 Presentation (org.eclipse.che.ide.api.action.Presentation)1