/** 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); } } }
/** 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; } }
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)); } } }
/** 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; } }
/** * 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)); }