.getImage(ISharedImages.IMG_OBJ_ADD));
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
TraceBackend.getInstance().addTracedNode(new TracedNode());
nodesTableViewer.refresh();
}
});
// "Remove" button
button = new Button(container, SWT.PUSH | SWT.CENTER);
button.setText("Remove node");
button.setToolTipText("Remove selected node");
button.setImage(PlatformUI.getWorkbench().getSharedImages()
.getImage(ISharedImages.IMG_TOOL_DELETE));
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
final TracedNode tracedNode = (TracedNode) ((IStructuredSelection) nodesTableViewer
.getSelection()).getFirstElement();
if (tracedNode != null) {
TraceBackend.getInstance().removeTracedNode(tracedNode);
nodesTableViewer.refresh();
}
}
});
// "Add erlide nodes" button
button = new Button(container, SWT.PUSH | SWT.CENTER);
button.setText("Add existing nodes");
button.setToolTipText("Add all Erlang nodes started directly from eclipse");
button.setImage(PlatformUI.getWorkbench().getSharedImages()
.getImage(ISharedImages.IMG_OBJ_ADD));
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
for (final IBackend backend : NodeHelper.getBackends(true)) {
final TracedNode node = new TracedNode();
node.setNodeName(backend.getName());
TraceBackend.getInstance().addTracedNode(node);
}
nodesTableViewer.refresh();
}
});