use of si.ijs.acs.objectexplorer.engine.Introspectable in project ACS by ACS-Community.
the class ObjectExplorer method oETree1_MouseClicked.
/**
* Comment
*/
public void oETree1_MouseClicked(java.awt.event.MouseEvent mouseEvent) {
//TODO ?!?!?!?!?!?!?
if (SwingUtilities.isRightMouseButton(mouseEvent)) {
TreePath clickedPath = getOETree1().getPathForLocation(mouseEvent.getX(), mouseEvent.getY());
Object clicked = null;
if (clickedPath != null)
clicked = clickedPath.getLastPathComponent();
if (clicked instanceof Introspectable) {
Introspectable node = (Introspectable) clicked;
getconnectMenuItem().setEnabled(!node.isConnected());
getdisconnectMenuItem().setEnabled(node.isConnected() && !node.isNonSticky());
getJLabel1().setText(node.toString());
getTreeHandlerBean1().setClicked(node);
// disable/enable converters
Converter currentConverter = ObjectExplorer.getConverter(node);
int len = getconverterMenu().getItemCount();
for (int i = 0; i < len; i++) {
JMenuItem item = getconverterMenu().getItem(i);
if (item != null && item.getActionListeners() != null && item.getActionListeners().length == 1 && item.getActionListeners()[0] instanceof SetConverterActionListener) {
SetConverterActionListener scal = (SetConverterActionListener) item.getActionListeners()[0];
if (scal.getConverter() == currentConverter)
item.setEnabled(false);
else
item.setEnabled(true);
}
}
getoeTreePopup().show(getOETree1(), mouseEvent.getX(), mouseEvent.getY());
}
}
return;
}
use of si.ijs.acs.objectexplorer.engine.Introspectable in project ACS by ACS-Community.
the class ObjectExplorer method oeTreeByName_MouseClicked.
// ----- * by rbertoncelj
// ----- Additional methods needed for new tree hierarchy -----
public void oeTreeByName_MouseClicked(java.awt.event.MouseEvent mouseEvent) {
if (SwingUtilities.isRightMouseButton(mouseEvent)) {
TreePath clickedPath = getOETreeByName().getPathForLocation(mouseEvent.getX(), mouseEvent.getY());
Object clicked = null;
if (clickedPath != null)
clicked = clickedPath.getLastPathComponent();
if (clicked instanceof Introspectable) {
Introspectable node = (Introspectable) clicked;
getconnectMenuItem().setEnabled(!node.isConnected());
getdisconnectMenuItem().setEnabled(node.isConnected());
getJLabel1().setText(node.toString());
//TODO is this ok?
getTreeHandlerBean1().setClicked(node);
// disable/enable converters
Converter currentConverter = ObjectExplorer.getConverter(node);
int len = getconverterMenu().getItemCount();
for (int i = 0; i < len; i++) {
JMenuItem item = getconverterMenu().getItem(i);
if (item != null && item.getActionListeners() != null && item.getActionListeners().length == 1 && item.getActionListeners()[0] instanceof SetConverterActionListener) {
SetConverterActionListener scal = (SetConverterActionListener) item.getActionListeners()[0];
if (scal.getConverter() == currentConverter)
item.setEnabled(false);
else
item.setEnabled(true);
}
}
getoeTreePopup().show(getOETreeByName(), mouseEvent.getX(), mouseEvent.getY());
}
}
return;
}
Aggregations