@Override @Nonnull protected Node createNodeForKey (final @Nonnull Object key) { return new NodePresentationModel(key); } }
/******************************************************************************************************************* * * ******************************************************************************************************************/ @Nonnull public final <T> T as (final @Nonnull Class<T> type) { return as(type, As.Defaults.throwAsException(type)); }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override public boolean canCut() { return canCopy() && canDestroy(); }
/******************************************************************************************************************* * * 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)); }
/******************************************************************************************************************* * * Creates an {@code GenericNode} given the referred object, the children and a {@link Lookup}. * * @param object the referring object * @param children the children * @param lookup the {@code Lookup} * ******************************************************************************************************************/ public NodePresentationModel (final @Nonnull Object object, final @Nonnull Children children, final @Nonnull Lookup lookup) { super(children, createLookup(object, lookup)); this.object = object; try { name = find(object, Displayable).getDisplayName(); } catch (NotFoundException e) { name = "???"; // do this first logger.severe("No Displayable available for %s in %s", this, object); } installDisplayNameListener(); installIconChangeListener(); }
@Override @Nonnull public Node getRootNode() { //@bluebook-begin constructor return new NodePresentationModel(new FileModel1(path)); //@bluebook-end constructor } }
@Override @Nonnull public Node getRootNode() { //@bluebook-begin constructor return new NodePresentationModel(new FileModel2(path)); //@bluebook-end constructor } }
@Override @Nonnull public Node getRootNode() { return new NodePresentationModel(new FileModel3(path)); } }
/******************************************************************************************************************* * * ******************************************************************************************************************/ 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 protected Node[] createNodes (final @Nonnull Object key) { if (key instanceof Node) { final Node node = (Node)key; if (isWaitingNode(node)) { return new Node[] { new GenericFilterNode(node) }; } return new Node[] { nodeFactory.createNode(getNode().getClass(), node) }; } else { return new Node[] { nodeFactory.createNode(getNode().getClass(), new NodePresentationModel(key)) }; } }
/******************************************************************************************************************* * * ******************************************************************************************************************/ 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)); }