protected final Image annotateIcon(final Image img, final int type) { Image annotatedImg = img; if (files != null && files.iterator().hasNext()) { try { FileObject fo = files.iterator().next(); annotatedImg = fo.getFileSystem().getStatus().annotateIcon(img, type, files); } catch (FileStateInvalidException e) { ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); } } return annotatedImg; }
public @Override Image getOpenedIcon(int type) { Image img = getMyOpenedIcon(type); if (files != null && files.iterator().hasNext()) { try { FileObject fo = files.iterator().next(); img = fo.getFileSystem().getStatus().annotateIcon(img, type, files); } catch (FileStateInvalidException e) { ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); } } return img; }
public @Override Image getIcon(int type) { Image img = super.getIcon(type); if (files != null && files.iterator().hasNext()) { try { FileObject fo = files.iterator().next(); img = fo.getFileSystem().getStatus().annotateIcon(img, type, files); } catch (FileStateInvalidException e) { ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); } } return img; }
/** Overrides folder icon to search for icon in UIManager table for * BeanInfo.ICON_COLOR_16x16 type, to allow for different icons * across Look and Feels. * Keeps possibility of icon annotations. */ public Image getOpenedIcon (int type) { Image img = null; if (type == BeanInfo.ICON_COLOR_16x16) { // search for proper folder icon installed by core/windows module img = (Image)UIManager.get("Nb.Explorer.Folder.openedIcon"); } if (img == null) { img = super.getOpenedIcon(type); } else { // give chance to annotate icon returned from UIManeger // copied from DataNode to keep the contract try { DataObject obj = getDataObject(); img = obj.getPrimaryFile().getFileSystem(). getStatus().annotateIcon(img, type, obj.files()); } catch (FileStateInvalidException e) { // no fs, do nothing } } return img; }
/** Overrides folder icon to search for icon in UIManager table for * BeanInfo.ICON_COLOR_16x16 type, to allow for different icons * across Look and Feels. * Keeps possibility of icon annotations. */ public Image getIcon (int type) { Image img = null; if (type == BeanInfo.ICON_COLOR_16x16) { // search for proper folder icon installed by core/windows module img = (Image)UIManager.get("Nb.Explorer.Folder.icon"); } if (img == null) { img = super.getIcon(type); } else { // give chance to annotate icon returned from UIManeger // copied from DataNode to keep the contract try { DataObject obj = getDataObject(); img = obj.getPrimaryFile().getFileSystem(). getStatus().annotateIcon(img, type, obj.files()); } catch (FileStateInvalidException e) { // no fs, do nothing } } return img; }
/** Find an icon for this node (in the closed state). * @param type constant from {@link java.beans.BeanInfo} * @return icon to use to represent the node */ public Image getIcon (int type) { if (noBeanInfo) return super.getIcon(type); Image img = null; try { DataObject dobj = getDataObject(); img = dobj.getPrimaryFile().getFileSystem().getStatus(). annotateIcon (img, type, dobj.files ()); } catch (FileStateInvalidException e) { // no fs, do nothing } if (img == null) img = initIcon(type); if (img == null) img = super.getIcon(type); return img; }
private Image annotateImpl(Image img, int param) { synchronized (privateLock) { if (files != null && files.size() > 0) { try { Iterator<FileObject> it = files.iterator(); assert it.hasNext(); FileObject fo = it.next(); assert fo != null; FileSystem fs = fo.getFileSystem(); assert fs != null; return fs.getStatus().annotateIcon(img, param, files); } catch (FileStateInvalidException e) { ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); } } } return img; } }
/** Get the displayed icon for this node. * A filesystem may {@link org.openide.filesystems.FileSystem#getStatus specially alter} this. * Subclassers overriding this method should consider the recommendations * in {@link DataObject#createNodeDelegate}. * @param type the icon type from {@link java.beans.BeanInfo} * @return the desired icon */ public java.awt.Image getOpenedIcon (int type) { java.awt.Image img = super.getOpenedIcon(type); try { img = obj.getPrimaryFile ().getFileSystem ().getStatus ().annotateIcon (img, type, new LazyFilesSet()); } catch (FileStateInvalidException e) { // no fs, do nothing } return img; }
private Image rootIcon(int type) { FileObject orig = obj.getOriginal().getPrimaryFile(); if (orig.isRoot()) { try { FileSystem fs = orig.getFileSystem(); try { Image i = Introspector.getBeanInfo(fs.getClass()).getIcon(type); return fs.getStatus().annotateIcon(i, type, obj.files()); } catch (IntrospectionException ie) { ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ie); // ignore } } catch (FileStateInvalidException fsie) { // ignore } } return null; }
/** Get the displayed icon for this node. * A filesystem may {@link org.openide.filesystems.FileSystem#getStatus specially alter} this. * Subclassers overriding this method should consider the recommendations * in {@link DataObject#createNodeDelegate}. * @param type the icon type from {@link java.beans.BeanInfo} * @return the desired icon */ public java.awt.Image getIcon (int type) { java.awt.Image img = super.getIcon (type); try { img = obj.getPrimaryFile ().getFileSystem ().getStatus ().annotateIcon (img, type, new LazyFilesSet()); } catch (FileStateInvalidException e) { // no fs, do nothing } return img; }
protected final Image annotateIcon(final Image img, final int type) { Image annotatedImg = img; if (files != null && !files.isEmpty()) { Iterator<FileObject> it = files.iterator(); try { FileObject fo = it.next(); if (fo.isValid()) { annotatedImg = fo.getFileSystem().getStatus().annotateIcon(img, type, files); } } catch (FileStateInvalidException e) { ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); } } return annotatedImg; }