Sie zeigen eine alte Version dieser Seite an. Zeigen Sie die aktuelle Version an.

Unterschiede anzeigen Seitenhistorie anzeigen

« Vorherige Version anzeigen Version 2 Nächste Version anzeigen »


The builtin UI actions can be fired any time within your own code. The following example shows how to call the setVisible, collapse/expand and adTreeNode/removeTreeNode method within an own action implementation.

com.jaxfront.demo.api.ChangeState
public class ChangeState extends AbstractAction {
private boolean _visible = true;
private boolean _collapse = false;
private boolean _treeNode = false;
public void actionPerformed(ActionEvent event) {
Document dom = (Document)getValue(XUITypes.VALUE_DOM);
Type source = (Type)getValue(XUITypes.VALUE_SOURCE);
String actionName = event.getActionCommand();
Type target = source.getParent().getDirectChild("list");
Visualizer targetVisualizer = TypeVisualizerFactory.getInstance().getVisualizer(target);
if (actionName.equals("visibility")) {
_visible = !_visible;
targetVisualizer.setVisible(_visible);
}
else if (actionName.equals("collapse")) {
_collapse = !_collapse;
if (_collapse) ((AbstractView)targetVisualizer.getInplementation()).getBorderPanel().collapseInitially();
else ((AbstractView)targetVisualizer.getInplementation()).getBorderPanel().expandInitially();
}
else if (actionName.equals("treeNode")) {
_treeNode = !_treeNode;
if (_treeNode) ((AbstractView)targetVisualizer.getInplementation()).addTreeNode(true);
else ((AbstractView)targetVisualizer.getInplementation()).removeTreeNode(true);
}
}
}



  • Keine Stichwörter