/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override public boolean canCut() { return canCopy() && canDestroy(); }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override public boolean canDestroy() { try { find(object, Removable.class); return true; } catch (NotFoundException e) { return false; } }
/******************************************************************************************************************* * * Creates a {@code GenericNode} given the referred object. * * @param object the referring object * ******************************************************************************************************************/ public NodePresentationModel (final @Nonnull Object object) { this(object, createChildrenFromComposite(object), createObjectLookup(object)); }
/******************************************************************************************************************* * * ******************************************************************************************************************/ private void populateDisplays (final @Nonnull Finder<ProfiledDisplay> finder) { final Node presentationModel = new NodePresentationModel(new DefaultSimpleComposite<ProfiledDisplay>(finder)); presentation.populateDisplays(new LookupFilterDecoratorNode(presentationModel, displaysCapabilityInjectorLookupFilter)); }
@Override @Nonnull public Node decorate (final @Nonnull Node node) { return new LookupFilterDecoratorNode(node, LOOKUP_FILTER); } }
@Override @Nonnull protected Node createNodeForKey (final @Nonnull Object key) { return new NodePresentationModel(key); } }
@Override @Nonnull protected Node copyNode (final @Nonnull Node delegate) { return new FilteredNodePresentationModel(delegate, objectFilter, objectClass); }
/******************************************************************************************************************* * * ******************************************************************************************************************/ public GenericFilterNode (final @Nonnull Node original) { super(original); installIconChangeListener(); }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override @Nonnull public Image getOpenedIcon (final int sizeType) { return findIcon((sizeType == BeanInfo.ICON_COLOR_16x16) ? 16 : 32); }
/*************************************************************************** * * **************************************************************************/ protected void registerIcon (final Class nodeClass, final String iconName) { imageByNodeClass.put(nodeClass, findIcon(iconName)); }
public FilteredNodePresentationModel (final @Nonnull Node delegate, final @Nonnull ObjectFilter objectFilter, final @Nonnull Class<T> objectClass) { super(delegate, new ProxyChildren<T>(delegate, objectFilter, objectClass)); }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override @Nonnull public final <T> T as (final @Nonnull Class<T> type) { return as(type, As.Defaults.throwAsException(type)); }
/******************************************************************************************************************* * * ******************************************************************************************************************/ @Nonnull public final <T> T as (final @Nonnull Class<T> type) { return as(type, As.Defaults.throwAsException(type)); }
/******************************************************************************************************************* * * ******************************************************************************************************************/ @Nonnull public final <T> T as (final @Nonnull Class<T> type) { return as(type, As.Defaults.throwAsException(type)); }
/******************************************************************************************************************* * * ******************************************************************************************************************/ private void populateMeasurementsArchive (final @Nonnull Finder<UniformityMeasurements> finder) { final Node pm = new NodePresentationModel(new DefaultSimpleComposite<UniformityMeasurements>(finder.sort(BY_DATE_TIME, DESCENDING))); presentation.populateMeasurementsArchive(new LookupFilterDecoratorNode(pm, measurementsCapabilityInjectorLookupFilter)); }
@Override @Nonnull public Node decorate (final @Nonnull Node node) { return new LookupFilterDecoratorNode(node, LOOKUP_FILTER); } }
/******************************************************************************************************************* * * ******************************************************************************************************************/ public GenericFilterNode (final @Nonnull Node original, final @Nonnull org.openide.nodes.Children children) { super(original, children); installIconChangeListener(); }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override @Nonnull public Image getIcon (final int sizeType) { return findIcon((sizeType == BeanInfo.ICON_COLOR_16x16) ? 16 : 32); }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override public final boolean canRename() { try { find(object, MutableDisplayable); return true; } catch (NotFoundException e) { return false; } }
/******************************************************************************************************************* * * ******************************************************************************************************************/ public GenericFilterNode (final @Nonnull Node original, final @Nonnull org.openide.nodes.Children children, final @Nonnull Lookup lookup) { super(original, children, lookup); installIconChangeListener(); }