/** Get a cookie. * @param clazz representation class * @return the index implementation or children if these match the cookie class, * else using the superclass cookie lookup */ public <T extends Node.Cookie> T getCookie(Class<T> clazz) { if (clazz.isInstance(indexImpl)) { // ok, Index implementor is enough return clazz.cast(indexImpl); } Children ch = getChildren(); if (clazz.isInstance(ch)) { // ok, children are enough return clazz.cast(ch); } return super.getCookie(clazz); } }
public Node.Cookie getCookie(Class clazz) { if ( clazz == ProjectDataSourceNode.class ) { return this ; } else return super.getCookie(clazz) ; }
/** Get a cookie. Call super first, but if null, also check the * associated data object. */ public <T extends Node.Cookie> T getCookie(Class<T> cl) { T cookie = super.getCookie(cl); if (cookie != null) { return cookie; } // if (dobj != null) { // return dobj.getCookie(cl); // } return null; }
public org.openide.nodes.Node.Cookie getCookie(Class type) { if (ServerInstance.class.isAssignableFrom(type)) { return instance; } return super.getCookie(type); }
public Node.Cookie getCookie (Class type) { if (ManagerNode.class.isAssignableFrom(type)) { return this; } if (SunDeploymentManagerInterface.class.isAssignableFrom(type)) { return this; } return super.getCookie (type); }
/** * Provide cookies to actions. * If a node represents primary file of a DataObject * it has respective DataObject cookies. */ @SuppressWarnings("unchecked") // Adding getCookie(Class<Cookie> klass) results in name clash @Override public Cookie getCookie(Class klass) { if (dobj == null) { return super.getCookie(klass); } else { return dobj.getCookie(klass); } }
/** Get a cookie. * @param clazz representation class * @return the index implementation or children if these match the cookie class, * else using the superclass cookie lookup */ public Cookie getCookie (Class clazz) { if (clazz.isInstance(indexImpl)) { // ok, Index implementor is enough return (Cookie)indexImpl; } Children ch = getChildren (); if (clazz.isInstance(ch)) { // ok, children are enough return (Cookie)ch; } return super.getCookie (clazz); } }
/** Get a cookie. * First of all {@link DataObject#getCookie} is * called. If it produces non-<code>null</code> result, that is returned. * Otherwise the superclass is tried. * Subclassers overriding this method should consider the recommendations * in {@link DataObject#createNodeDelegate}. * * @return the cookie or <code>null</code> */ public Node.Cookie getCookie (Class cl) { Node.Cookie c = obj.getCookie (cl); if (c != null) { return c; } else { return super.getCookie (cl); } }
/** * Returns a cookie. Overridden to add support for the IndexCookie, which is needed to keep track of the position of this node. * * @param clazz The class for which the cookie should be returned * * @return The cookie object, or null if no cookie was found for the specified class. */ @Override @SuppressWarnings("unchecked") public Cookie getCookie(Class clazz) { Children ch = getChildren(); if (clazz.isInstance(ch)) { return (Cookie) ch; } return super.getCookie(clazz); } }
/** Get a cookie. * @param clazz representation class * @return the index implementation or children if these match the cookie class, * else using the superclass cookie lookup */ public Cookie getCookie (Class clazz) { if (clazz.isInstance(indexImpl)) { // ok, Index implementor is enough return (Cookie)indexImpl; } Children ch = getChildren (); if (clazz.isInstance(ch)) { // ok, children are enough return (Cookie)ch; } return super.getCookie (clazz); } }
/** * Get a cookie. Call super first, but if null, delegate to * the associated data object (if any). The delegated to data object * is generally the file representing the container for the bean. */ public Node.Cookie getCookie(Class cl) { Node.Cookie c = super.getCookie(cl); if (c != null) return c; // XXX Just a hack for the rare cases the dataObject was not available at the beginning. // Rather the (faces)model should fire changes about file changes (if there are any). if (dataObject == null) { setDataObject(retrieveJspDataObject(liveBean)); } if (dataObject != null) return dataObject.getCookie(cl); return null; }