Search in sources :

Example 1 with Debugger

use of org.eclipse.che.ide.debug.Debugger in project che by eclipse.

the class DebuggerPresenter method onExpandVariablesTree.

@Override
public void onExpandVariablesTree() {
    List<? extends Variable> rootVariables = selectedVariable.getVariables();
    if (rootVariables.isEmpty()) {
        Debugger debugger = debuggerManager.getActiveDebugger();
        if (debugger != null) {
            Promise<SimpleValue> promise = debugger.getValue(selectedVariable);
            promise.then(new Operation<SimpleValue>() {

                @Override
                public void apply(SimpleValue arg) throws OperationException {
                    selectedVariable.setValue(arg.getValue());
                    view.setVariablesIntoSelectedVariable(arg.getVariables());
                    view.updateSelectedVariable();
                }
            }).catchError(new Operation<PromiseError>() {

                @Override
                public void apply(PromiseError arg) throws OperationException {
                    notificationManager.notify(constant.failedToGetVariableValueTitle(), arg.getMessage(), FAIL, FLOAT_MODE);
                }
            });
        }
    }
}
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) SimpleValue(org.eclipse.che.api.debug.shared.model.SimpleValue)

Example 2 with Debugger

use of org.eclipse.che.ide.debug.Debugger in project che by eclipse.

the class DisconnectDebuggerAction method updateInPerspective.

@Override
public void updateInPerspective(ActionEvent event) {
    Debugger debugger = debuggerManager.getActiveDebugger();
    event.getPresentation().setEnabled(debugger != null && debugger.isConnected());
}
Also used : Debugger(org.eclipse.che.ide.debug.Debugger)

Example 3 with Debugger

use of org.eclipse.che.ide.debug.Debugger in project che by eclipse.

the class ResumeExecutionAction 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 4 with Debugger

use of org.eclipse.che.ide.debug.Debugger in project che by eclipse.

the class StepOutAction 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 5 with Debugger

use of org.eclipse.che.ide.debug.Debugger in project che by eclipse.

the class SuspendAction method updateInPerspective.

@Override
public void updateInPerspective(ActionEvent event) {
    final Presentation presentation = event.getPresentation();
    final Debugger debugger = debuggerManager.getActiveDebugger();
    if (debugger == null) {
        presentation.setEnabledAndVisible(false);
        return;
    }
    //Workaround: we don't support this action for another types of debugger
    presentation.setVisible("gdb".equals(debugger.getDebuggerType()));
    presentation.setEnabled(debugger.isConnected() && !debugger.isSuspended());
}
Also used : Debugger(org.eclipse.che.ide.debug.Debugger) Presentation(org.eclipse.che.ide.api.action.Presentation)

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