use of com.microsoft.tooling.msservices.serviceexplorer.Node in project azure-tools-for-java by Microsoft.
the class ServiceExplorerView method hookMouseActions.
private void hookMouseActions() {
viewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
doubleClickAction.run();
}
});
Tree tree = (Tree) viewer.getControl();
tree.addMouseListener(new MouseAdapter() {
@Override
public void mouseUp(MouseEvent e) {
if (e.button == 1) {
// left button
TreeItem[] selection = ((Tree) e.widget).getSelection();
if (selection.length > 0) {
TreeItem item = ((Tree) e.widget).getSelection()[0];
Node node = ((TreeNode) item.getData()).node;
// we do not propagate the click event to it
if (!node.isLoading()) {
node.getClickAction().fireNodeActionEvent();
}
}
}
}
});
}
use of com.microsoft.tooling.msservices.serviceexplorer.Node in project azure-tools-for-java by Microsoft.
the class ServiceExplorerView method propertyChange.
@Override
public void propertyChange(final PropertyChangeEvent evt) {
// this event is fired whenever a property on a node in the
// model changes; we respond by triggering a node change
// event in the tree's model
final Node node = (Node) evt.getSource();
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
viewer.refresh((TreeNode) node.getViewData());
}
});
}
Aggregations