multivalent.std
public class ClipProvenance extends Behavior
Version: $Revision: 1.2 $ $Date: 2002/02/01 04:24:17 $
Field Summary | |
---|---|
static String | MENU_CATEGORY Menu category for pasting-related options ("AuxSelect"). |
static String | MSG_SET
Augment pasted text with provenance or not.
|
Method Summary | |
---|---|
boolean | clipboardAfter(StringBuffer sb, Node node)
The clipboard protocol builds up the text in a StringBuffer.
|
boolean | semanticEventAfter(SemanticEvent se, String msg)
Catch the "setProvenance" event sent in semanticEventBefore,
assuming it hasn't been short-circuited by some other behavior.
|
boolean | semanticEventBefore(SemanticEvent se, String msg)
When the Clipboard menu announces it is being built by sending a semantic event with
message MSG_CREATE_EDIT and the node of the menu root in the out field,
add an entry. |
"setProvenance": arg= bollean or null
to toggle.
This behavior has its effect (if it's active) during the clipboard protocol, but that protocol is based on a tree walk, so if it is to know of the tree walk, it has to hook into the tree. So catch the MSG_OPENED semantic event and hook onto its document field. It registers interest on the root of the document in order to pick up clipboard extractions everywhere in the tree. It's common for a behavior to register interest at the root as opposed to smaller subtrees.