use of org.erlide.tracing.core.mvc.model.TracedProcess in project erlide_eclipse by erlang.
the class ProcessHelper method getProcsOnTracedNodes.
/**
* Returns list of processes on all traced nodes.
*
* @return list of processes
*/
public static TracedProcess[] getProcsOnTracedNodes() {
try {
final IOtpRpc backend = TraceBackend.getInstance().getBackend(true).getOtpRpc();
final List<OtpErlangAtom> nodeAtoms = new ArrayList<>();
for (final Object o : TraceBackend.getInstance().getTracedNodesArray()) {
final TracedNode tracedNode = (TracedNode) o;
if (tracedNode.isEnabled()) {
nodeAtoms.add(new OtpErlangAtom(tracedNode.getNodeName()));
}
}
final OtpErlangList nodesList = new OtpErlangList(nodeAtoms.toArray(new OtpErlangAtom[nodeAtoms.size()]));
final OtpErlangList procList = (OtpErlangList) backend.call(ProcessHelper.MODULE_NAME, ProcessHelper.FUNCTION_NAME, "x", nodesList);
final TracedProcess[] processes = new TracedProcess[procList.arity()];
for (int i = 0; i < procList.arity(); i++) {
final OtpErlangTuple tuple = (OtpErlangTuple) procList.elementAt(i);
processes[i] = new TracedProcess(tuple);
}
return processes;
} catch (final RpcException e) {
ErlLogger.error(e);
}
return null;
}
use of org.erlide.tracing.core.mvc.model.TracedProcess in project erlide_eclipse by erlang.
the class ProcessLabelProvider method getColumnImage.
@Override
public Image getColumnImage(final Object element, final int columnIndex) {
final TracedProcess process = (TracedProcess) element;
if (ProcessColumn.SELECTED.ordinal() == columnIndex) {
// process columns
if (process.isSelected()) {
return Activator.getDefault().getImageRegistry().get(Images.CHECKED.toString());
}
return Activator.getDefault().getImageRegistry().get(Images.UNCHECKED.toString());
}
// flag columns
final ProcessFlag flag = ProcessFlag.getByIndex(columnIndex - ProcessColumn.values().length);
if (flag != null) {
if (process.hasFlag(flag)) {
return Activator.getDefault().getImageRegistry().get(Images.CHECKED.toString());
}
return Activator.getDefault().getImageRegistry().get(Images.UNCHECKED.toString());
}
return null;
}
use of org.erlide.tracing.core.mvc.model.TracedProcess in project erlide_eclipse by erlang.
the class ProcessCellModifier method modify.
@Override
public void modify(final Object element, final String property, final Object value) {
final TracedProcess process = (TracedProcess) ((TableItem) element).getData();
// processes column
try {
if (ProcessColumn.SELECTED.equals(ProcessColumn.valueOf(property))) {
process.setSelected((Boolean) value);
tableViewer.update(process, null);
}
return;
} catch (final Exception e) {
}
// flag column
final ProcessFlag flag = ProcessFlag.valueOf(property);
if ((Boolean) value) {
process.setFlag(flag);
} else {
process.unSetFlag(flag);
}
tableViewer.update(process, null);
}
Aggregations