/** Getter for the node that produced the action. * The node can be used to obtain additional information like cookies, etc. * @return the node */ public Node getNode() { return (Node) getSource(); }
/** Returns the root class of all objects. * Supposed to be overriden in subclasses. * * @return Object.class * @exception IOException an I/O error occured * @exception ClassNotFoundException the class has not been found */ public Class instanceClass () throws java.io.IOException, ClassNotFoundException { return cookie.instanceClass (); }
/** Full name of the data folder's primary file separated by dots. * @return the name */ public String instanceName () { return cookie.instanceName (); }
private boolean openByCookie(Node.Cookie cookie, Class cookieClass) { if ((cookieClass == EditorCookie.class) || (cookieClass == EditorCookie.Observable.class)) { ((EditorCookie) cookie).open(); } else if (cookieClass == OpenCookie.class) { ((OpenCookie) cookie).open(); } else if (cookieClass == EditCookie.class) { ((EditCookie) cookie).edit(); } else if (cookieClass == ViewCookie.class) { ((ViewCookie) cookie).view(); } else { throw new IllegalArgumentException("Reopen #58766: " + cookieClass); // NOI18N } return true; } }
@Override public void run() { // open component oc.open(); } }, 0, Thread.MAX_PRIORITY);
private static StyledDocument getDocument (EditorCookie ec) { return ec == null ? null : ec.getDocument(); }
public void run () { if (ec.getOpenedPanes () != null && ec.getOpenedPanes ().length > 0 ) setCurrentEditor (ec.getOpenedPanes () [0]); else setCurrentEditor (null); } });
public Object instanceCreate () throws java.io.IOException, ClassNotFoundException { return ic.instanceCreate (); }
public boolean save() throws IOException { if (editorCookie == null) { return false; } if (editorCookie.isModified()) { editorCookie.saveDocument(); return true; } return false; }
EditorCookie.Observable cookie = dataObject.getLookup().lookup(EditorCookie.Observable.class); cookie.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { // Do your stuff } });
FileObject f = ... DataObject data = DataObject.find(f); EditorCookie cookie = data.getLookup().lookup(EditorCookie.class); cookie.saveDocument();
private boolean isModified(int row) { EditorCookie editorCookie = editorCookies[row]; return (editorCookie != null) ? editorCookie.isModified() : false; } }
private boolean openByCookie(Node.Cookie cookie, Class cookieClass) { if ((cookieClass == EditorCookie.class) || (cookieClass == EditorCookie.Observable.class)) { ((EditorCookie) cookie).open(); } else if (cookieClass == OpenCookie.class) { ((OpenCookie) cookie).open(); } else if (cookieClass == EditCookie.class) { ((EditCookie) cookie).edit(); } else if (cookieClass == ViewCookie.class) { ((ViewCookie) cookie).view(); } else { throw new IllegalArgumentException("Reopen #58766: " + cookieClass); // NOI18N } return true; } }
/** Method that is called when a the folder instance really wants to * create an object from provided cookie. * It allows subclasses to overwrite the default behaviour (which is * to call {@link InstanceCookie#instanceCreate}). * * @param obj the data object that is the source of the cookie * @param cookie the instance cookie to read the instance from * @exception IOException when there I/O error * @exception ClassNotFoundException if the class cannot be found */ protected Object instanceForCookie (DataObject obj, InstanceCookie cookie) throws IOException, ClassNotFoundException { return cookie.instanceCreate (); }
public Class instanceClass () throws java.io.IOException, ClassNotFoundException { return ic.instanceClass (); }
/** Getter for the node that produced the action. * The node can be used to obtain additional information like cookies, etc. * @return the node */ public Node getNode () { return (Node)getSource (); }
public Object getValue () { return ic.instanceName (); } });
/** Getter for the node that produced the action. * The node can be used to obtain additional information like cookies, etc. * @return the node */ public Node getNode () { return (Node)getSource (); }
public String instanceName () { return ic.instanceName (); }