SSE4E GPError GPSystem ByteString ByteBuffer TLV TLVList Card Atr Key Crypto Application GPApplication GPSecDomain ASN1 CardFile IsoSecureChannel ApplFactory GPXML JsScript CardSim X509 CRL KeyStore CMSSignedData CMSGenerator XMLSignature OCSPQuery LDAP SOAP URLConnection PKCS11Provider PKCS11Session PKCS11Object OutlineNode OpenSCDP |
OutlineNode - Reference Documentation
The OutlineNode class provides functions to create an outline tree in the Smart Card Shell. The Outline can be used to display hierarchical data. A tree consists of nodes represented by instances of the OutlineNode class. You can create nodes, add child nodes, remove nodes and control the behaviour of the tree using action listeners defined for user objects of nodes. The appearance of a node can be changed dynamically. You can change the label, the icon and set a tool-tip text, which is displayed when the user moves the mouse over the node. Using the setContextMenu method, you can add context menues to node, which are activated when the user clicks on the node with the right mouse button. Any actions on the outline performed by the user are delegated to action listener methods implemented by the user object. These methods (expandListener(), collapseListener(), selectedListener() and actionListener()) are activated on their own threads, so long running actions are possible. Index of Methods
Properties
ConstructorPrototypeOutlineNode(String name) OutlineNode(String name, boolean expandable) DescriptionCreate an OutlineNode object. The OutlineNode class is not automatically defined and only available in the Smart Card Shell. OutlineNode objects can receive expand(), collapse() selected() and action() events from the outline. If such methods are defined, they overwrite the expandListener(), collapseListener(), selectedListener() or actionListener() methods in a user object. Arguments
Exceptions
Examplecnt = 0; defineClass("de.cardcontact.scdp.scsh3.OutlineNode"); OutlineNode.prototype.expand = function() { print("expand called for " + this ); }; OutlineNode.prototype.selected = function() { print("selected called for " + this ); }; OutlineNode.prototype.collapse = function() { print("collapse called for " + this ); }; OutlineNode.prototype.action = function(name) { print("action(" + name + ") called for " + this ); if (name == "add") { var node = new OutlineNode("node" + cnt, true); cnt++; node.setContextMenu(["add", "remove", "---", "deselected", "selected", "passed", "failed", "---", "setToolTip", "removeToolTip", "---", "changeLabel"]); this.insert(node); } else if (name == "remove") { this.remove(); } else if (name == "setToolTip") { this.setToolTip("Tooltip#" + cnt); cnt++; } else if (name == "removeToolTip") { this.setToolTip(); } else if (name == "changeLabel") { this.setLabel("Label#" + cnt); cnt++; } else { this.setIcon(name); } }; var outline = new OutlineNode("root"); insert()Prototypeinsert() insert(Object child, Number index) insert(Object child) DescriptionAdd a child to the outline node. The child must be OutlineNode object or any scriptable object that implements a tree model (e.g. ASN1). show() will automatically make the node to the root node of the outline. Arguments
Return
Exceptions
Example// Insert other node var node = new OutlineNode("Testnode"); outline.insert(node); // Insert ASN1 structure var root = new X509("root.cer"); bs = root.getBytes(); var t = new ASN1(bs); assert(t instanceof ASN1); outline.insert(t); remove()Prototyperemove() remove(Object child) DescriptionRemove the child object from the node. If no child is specified, then the node for which this method is called is removed from the parent node. Arguments
Return
Exceptions
Example// Insert other node var node = new OutlineNode("Remove-Testnode"); outline.insert(node); // Insert ASN1 structure var root = new X509("root.cer"); bs = root.getBytes(); var t = new ASN1(bs); assert(t instanceof ASN1); outline.insert(t); outline.remove(node); outline.remove(t); show()Prototypeshow() show(String title) DescriptionMake tree of outline node visible and allow user interaction. Arguments
Return
Exceptions
Exampleoutline.show(); setContextMenu()PrototypesetContextMenu(String[] entries) DescriptionSet content of context menu. Selected actions trigger an action() method call. Arguments
Return
Exceptions
Exampleoutline.setContextMenu(["add"]); setToolTip()PrototypesetToolTip(String toolTipText) setToolTip() DescriptionSet a text to display as tool tip, which is displayed when the mouse is held over the node. If no text is defined, the tool tip is removed. Arguments
Return
Exceptions
Exampleoutline.setToolTip("Press the right mouse button to see context menu"); setIcon()PrototypesetIcon(String iconName) setIcon() DescriptionChange the icon of the node to the named icon or reset to the default. The name of the icon is mapped to the file name <iconName>.png and located in the icons directory directly underneath the installation directory. Arguments
Return
Exceptions
Exampleoutline.setIcon("selected"); setLabel()PrototypesetLabel(String label) DescriptionChange the label of the node to the given string. Arguments
Return
Exceptions
Exampleoutline.setLabel("Changed label"); setUserObject()PrototypesetUserObject(Object userObject) DescriptionRegister a user object for this node. Any events are delegated to this user object if a event method is provided. selectedListener(OutlineNode source) is called if the user is selecting the node. expandListener(OutlineNode source) is called if the user is expanding the node. collapseListener(OutlineNode source) is called if the user is collapsing the node. actionListener(OutlineNode source, String action) is called if the user is selecting from the context menu. Arguments
Return
Exceptions
Exampleoutline.setUserObject(this); © Copyright 2003 - 2010 CardContact Software & System Consulting, Minden, Germany |