public Node getNode() throws IOException { return new FilterNode(original.getNode()); }
@Override public Action[] getActions(boolean context) { return super.getActions(context); // List<Action> actions = new ArrayList(Arrays.asList(super.getActions(context))); // actions.add(new NewActivityFieldAction(field)); // return actions.toArray(new Action[actions.size()]); }
@Override public Image getIcon(int type) { return super.getIcon(type); }
/** Create new filter node for the original. * Subclasses do not have to override this, but if they do not, * the default implementation will filter the subclass filter, which is not * very efficient. * @return copy of this node */ public Node cloneNode() { if (isDefault()) { // this is realy filter node without changed behaviour // with the normal children => use normal constructor for the // original node return new FilterNode(original); } else { // create filter node for this node to reflect changed // behaviour return new FilterNode(this); } }
/** Getter for node listener. */ synchronized NodeListener getNodeListener() { if (nodeL == null) { nodeL = createNodeListener(); getOriginal().addNodeListener(nodeL); } return nodeL; }
/** Copied from PackageRootNode with modifications. */ private Image computeIcon(boolean opened, int type) { Icon icon = g.getIcon(opened); if (icon == null) { Image image = opened ? super.getOpenedIcon(type) : super.getIcon(type); return ImageUtilities.mergeImages(image, /*PackageRootNode.*/PACKAGE_BADGE, 7, 7); } else { return ImageUtilities.icon2Image(icon); } }
protected Node[] createNodes(Object key) { FileObject fObj = null; SourceGroup group = null; boolean isFile=false; if ( key instanceof SourceGroup ) { fObj = ((SourceGroup)key).getRootFolder(); group = (SourceGroup)key; } else if ( key instanceof Key ) { fObj = ((Key)key).folder; group = ((Key)key).group; if (!fObj.isFolder()) isFile=true; } try { DataObject dobj = DataObject.find( fObj ); FilterNode fn = (isFile?new FilterNode(dobj.getNodeDelegate(),Children.LEAF): new FilterNode(dobj.getNodeDelegate(), new SourceGroupsChildren( fObj, group ))); if ( key instanceof SourceGroup ) { fn.setDisplayName( group.getDisplayName() ); } return new Node[] { fn }; } catch ( DataObjectNotFoundException e ) { return null; } }
@Override public Image getOpenedIcon(int type) { Image icon; if( !activeState ) { icon = ImageUtilities.createDisabledImage(super.getOpenedIcon(type)); } else { icon = super.getOpenedIcon(type); } return icon; }
/** A method that replaces instance of original node * with a new one */ private <T> T replaceNodes(T orig, Class<T> clazz) { if (isNodeQuery(clazz) && (orig == node.getOriginal()) && clazz.isInstance(node)) { return clazz.cast(node); } else { return orig; } }
public @Override String getDisplayName() { if (displayName != null) { return displayName; } else { return super.getDisplayName(); } }
/** Copied from PackageRootNode with modifications. */ private Image computeIcon(boolean opened, int type) { Icon icon = g.getIcon(opened); if (icon == null) { Image image = opened ? super.getOpenedIcon(type) : super.getIcon(type); return ImageUtilities.mergeImages(image, /*PackageRootNode.*/PACKAGE_BADGE, 7, 7); } else { return ImageUtilities.icon2Image(icon); } }
/** Create new filter node for the original. * Subclasses do not have to override this, but if they do not, * the default implementation will filter the subclass filter, which is not * very efficient. * @return copy of this node */ public Node cloneNode () { if (isDefault ()) { // this is realy filter node without changed behaviour // with the normal children => use normal constructor for the // original node return new FilterNode (original); } else { // create filter node for this node to reflect changed // behaviour return new FilterNode (this); } }
@Override public Image getOpenedIcon(int type) { Image icon = super.getOpenedIcon(type); return ImageUtilities.createDisabledImage(icon); }
public void resultChanged(LookupEvent ev) { if (Node.this instanceof FilterNode) { FilterNode f = (FilterNode) Node.this; // See #40734 and NodeLookupTest and CookieActionIsTooSlowTest. if (f.getOriginal() == NodeLookup.NO_COOKIE_CHANGE.get()) { // this is not real cookie change, do not fire it // issue 40734 return; } } fireCookieChange(); } }
public @Override String getDisplayName() { if (displayName != null) { return displayName; } else { return super.getDisplayName(); } }
/** Getter for node listener. */ synchronized NodeListener getNodeListener () { if (nodeL == null) { nodeL = createNodeListener (); getOriginal().addNodeListener(nodeL); } return nodeL; }
/** Clone the node. If the object implements {@link Cloneable}, * that is used; otherwise a {@link FilterNode filter node} * is created. * * @return copy of this node */ public Node cloneNode() { try { if (this instanceof Cloneable) { return (Node) clone(); } } catch (CloneNotSupportedException ex) { } return new FilterNode(this); }
@Override public Action[] getActions(boolean context) { return super.getActions(context); } }
/** Copied from PackageRootNode with modifications. */ private Image computeIcon(boolean opened, int type) { Icon icon = g.getIcon(opened); if (icon == null) { Image image = opened ? super.getOpenedIcon(type) : super.getIcon(type); return ImageUtilities.mergeImages(image, ImageUtilities.loadImage(PackageRootNode.PACKAGE_BADGE), 7, 7); } else { return ImageUtilities.icon2Image(icon); } }
/** Create new filter node for the original. * Subclasses do not have to override this, but if they do not, * the default implementation will filter the subclass filter, which is not * very efficient. * @return copy of this node */ public Node cloneNode () { if (isDefault ()) { // this is realy filter node without changed behaviour // with the normal children => use normal constructor for the // original node return new FilterNode (original); } else { // create filter node for this node to reflect changed // behaviour return new FilterNode (this); } }