With Scout 4.0 we introduced a method: execOwnerValueChanged(Object newOwnerValue)
which I think you can use.
The following code sets the context menu invisible if the selected node contains the text "Node 2". I hope this snippet helps.
public class MenuAMenu extends AbstractExtensibleMenu {
@Override
protected String getConfiguredText() {
return TEXTS.get("MenuA");
}
@Override
protected void execOwnerValueChanged(Object newOwnerValue) throws ProcessingException {
super.execOwnerValueChanged(newOwnerValue);
if (getTree().getSelectedNode().getCell().getText().contains("Node 2")) {
setVisible(false);
}
else {
setVisible(true);
}
}
}
Best regards,
Matthias
[Updated on: Mon, 22 September 2014 10:23] by Moderator