Esempio n. 1
0
 /** Removes save cookie from the DO. */
 final void removeSaveCookie() {
   DataObject dataObj = getDataObject();
   // add Save cookie to the data object
   if (dataObj instanceof MultiDataObject) {
     if (dataObj.getCookie(SaveCookie.class) == this) {
       getCookieSet((MultiDataObject) dataObj).remove(this);
     }
   }
 }
Esempio n. 2
0
 /** Overrides superclass method. Initializes editor component. */
 protected void initializeCloneableEditor(CloneableEditor editor) {
   DataObject obj = getDataObject();
   if (obj.isValid()) {
     org.openide.nodes.Node ourNode = obj.getNodeDelegate();
     editor.setActivatedNodes(new org.openide.nodes.Node[] {ourNode});
     editor.setIcon(ourNode.getIcon(java.beans.BeanInfo.ICON_COLOR_16x16));
     NodeListener nl = new DataNodeListener(editor);
     ourNode.addNodeListener(WeakListener.node(nl, ourNode));
     nodeL = nl;
   }
 }
Esempio n. 3
0
 public void propertyChange(java.beans.PropertyChangeEvent ev) {
   if (Node.PROP_DISPLAY_NAME.equals(ev.getPropertyName())) {
     updateTitles();
   }
   if (Node.PROP_ICON.equals(ev.getPropertyName())) {
     DataObject obj = getDataObject();
     if (obj.isValid()) {
       editor.setIcon(obj.getNodeDelegate().getIcon(java.beans.BeanInfo.ICON_COLOR_16x16));
     }
   }
 }
Esempio n. 4
0
 /** If no instance cookie, tries to create execution action on the data object. */
 protected org.openide.cookies.InstanceCookie acceptDataObject(DataObject dob) {
   InstanceCookie ic = super.acceptDataObject(dob);
   if (ic == null
       && !(dob instanceof DataFolder)
       && dob.getCookie(InstanceCookie.class) == null) {
     return new InstanceSupport.Instance(ExecBridge.createButton(dob));
   } else {
     return ic;
   }
 }
Esempio n. 5
0
 /**
  * Constructor
  *
  * @param obj data object we belong to. The appropriate editor support is acquired as the
  *     DataObject's EditorSupport.class cookie.
  */
 public Editor(DataObject obj) {
   this(obj, (EditorSupport) obj.getCookie(EditorSupport.class));
 }