use of org.eclipse.che.api.debug.shared.model.MutableVariable in project che by eclipse.
the class DebuggerViewImpl method setVariablesIntoSelectedVariable.
/** {@inheritDoc} */
@Override
public void setVariablesIntoSelectedVariable(@NotNull List<? extends Variable> variables) {
MutableVariable rootVariable = selectedVariable.getData();
rootVariable.setVariables(variables);
}
use of org.eclipse.che.api.debug.shared.model.MutableVariable in project che by eclipse.
the class DebuggerViewImpl method setVariables.
/** {@inheritDoc} */
@Override
public void setVariables(@NotNull List<? extends Variable> variables) {
MutableVariable root = this.variables.getModel().getRoot();
if (root == null) {
root = new MutableVariableImpl();
this.variables.getModel().setRoot(root);
}
root.setVariables(variables);
this.variables.renderTree(0);
}
use of org.eclipse.che.api.debug.shared.model.MutableVariable in project che by eclipse.
the class VariableNodeDataAdapter method getNodeByPath.
/** {@inheritDoc} */
@Override
@Nullable
public MutableVariable getNodeByPath(@NotNull MutableVariable root, @NotNull List<String> relativeNodePath) {
MutableVariable localRoot = root;
for (int i = 0; i < relativeNodePath.size(); i++) {
String path = relativeNodePath.get(i);
if (localRoot != null) {
List<MutableVariable> variables = new ArrayList<>(localRoot.getVariables());
localRoot = null;
for (int j = 0; j < variables.size(); j++) {
MutableVariable variable = variables.get(i);
if (variable.getName().equals(path)) {
localRoot = variable;
break;
}
}
if (i == (relativeNodePath.size() - 1)) {
return localRoot;
}
}
}
return null;
}
use of org.eclipse.che.api.debug.shared.model.MutableVariable in project che by eclipse.
the class DebuggerPresenterTest method testOnExpandVariablesTree.
@Test
public void testOnExpandVariablesTree() throws OperationException {
SimpleValueDto valueDto = mock(SimpleValueDto.class);
List<MutableVariable> rootVariables = mock(List.class);
doReturn(true).when(rootVariables).isEmpty();
doReturn(rootVariables).when(selectedVariable).getVariables();
doReturn(promiseValue).when(debugger).getValue(selectedVariable);
doReturn(promiseValue).when(promiseValue).then((Operation<SimpleValueDto>) any());
presenter.onExpandVariablesTree();
verify(promiseValue).then(operationValueCaptor.capture());
operationValueCaptor.getValue().apply(valueDto);
verify(view).setVariablesIntoSelectedVariable(any());
verify(view).updateSelectedVariable();
verify(promiseValue).catchError(operationPromiseErrorCaptor.capture());
operationPromiseErrorCaptor.getValue().apply(promiseError);
notificationManager.notify(any(), eq(ERROR_MESSAGE), eq(FAIL), eq(FLOAT_MODE));
verify(constant).failedToGetVariableValueTitle();
}
Aggregations