public NodeExceptionHandlerProviderForGeoCoderEntity() { exceptionHandler.setMaxRetryCount(2); exceptionHandler.setRetryPeriod(5000); }
/******************************************************************************************************************* * * * ******************************************************************************************************************/ @Override public final void loadData() { nodeManager.setRootNodeProvider(new RootNodeProvider() { @Override @Nonnull public Node getRootNode() throws NotFoundException { Node node = NodeDataLoader.this.getRootNode(); for (final NodeDecorator nodeDecorator : nodeDecorators.allInstances()) { node = nodeDecorator.decorate(node); } return node; } }); }
@Override public void resultChanged (final @Nonnull LookupEvent event) { loadData(); } });
@Override @Nonnull protected Node doInBackground() throws NotFoundException { return NotFoundException.throwWhenNull(rootNodeProvider, "null rootNodeProvider").getRootNode(); }
public GenericTreePanel2 (final @Nonnull RootNodeProvider rootNodeProvider, final @Nonnull NodeDecorator nodeDecorator) { setLayout(new BorderLayout()); add(new BeanTreeView(), BorderLayout.CENTER); try { explorerManager.setRootContext(nodeDecorator.decorate(rootNodeProvider.getRootNode())); } catch (NotFoundException e) { e.printStackTrace(); } } }
@Override @Nonnull public Node getRootNode() throws NotFoundException { Node node = NodeDataLoader.this.getRootNode(); for (final NodeDecorator nodeDecorator : nodeDecorators.allInstances()) { node = nodeDecorator.decorate(node); } return node; } });
@Override @Nonnull public Node decorate (final @Nonnull Node node) { final DefaultSortable sortable = new DefaultSortable(); final Node sortableNode = new LookupFilterDecoratorNode(node, new SortableCompositeLookupFilter(sortable)); sortable.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange (final @Nonnull PropertyChangeEvent event) { // Forces the reloading of children in sortableNode //@bluebook-ignore-begin final RearrangingChildren children = (RearrangingChildren)sortableNode.getChildren(); children.loadNodes(); //@bluebook-ignore-end } }); return sortableNode; } }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override @CheckForNull public Action getPreferredAction() { try { return find(object, ActionProvider).getPreferredAction(); } catch (NotFoundException e) { return null; } }
@Override @Nonnull public Node decorate (final @Nonnull Node node) { Node result = node; for (final NodeDecorator nodeDecorator : nodeDecorators) { result = nodeDecorator.decorate(result); } return result; } }
@Override public void actionPerformed (final @Nonnull ActionEvent event) { fireDisplayNameChange(oldDisplayName, getDisplayName()); fireIconChange(); } });
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override @Nonnull public String getShortDescription() { try { return find(object, Describable).getDescription(); } catch (NotFoundException e) { return super.getShortDescription(); } }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override @CheckForNull public Action[] getActions (final boolean context) { try { return find(object, ActionProvider).getActions().toArray(new Action[0]); } catch (NotFoundException e) { return new Action[0]; } }
/******************************************************************************************************************* * * ******************************************************************************************************************/ protected void configureActions (final Class<? extends Node> nodeClass, final @Nonnull String name) { logger.info("configureActions(%s, %s)", nodeClass, name); final Lookup forPath = Lookups.forPath("NodeActions/" + name); for (final Object object : forPath.lookupAll(Object.class)) { if (object instanceof SystemAction) { registerNodeAction(nodeClass, ((SystemAction)object).getClass(), false); // add(new Button((SystemAction)next)); } // else if (object instanceof JSeparator) // { //// add((JSeparator)next); TODO // } } }
/******************************************************************************************************************* * * ******************************************************************************************************************/ @Override protected final boolean createKeys (final @Nonnull List<T> list) { try { return createKeysSafely(list); } catch (Exception e) { ChildFactoryExceptionHandler nodeExceptionHandler = null; try { nodeExceptionHandler = findExceptionHandler(node); } catch (NotFoundException e2) { logger.finest(">>>> no specific NodeExceptionHandler, using the default"); nodeExceptionHandler = Locator.find(ChildFactoryExceptionHandler.class); } nodeExceptionHandler.handleException(node, this, e); return true; } }
@Override @Nonnull protected Node getRootNode() throws NotFoundException { final HViewManager hViewManager = Locator.find(HViewManager); return hViewManager.as(RootNodeProvider).getRootNode(); } }
public CountDownNode (final @Nonnull Throwable t) { super(Children.LEAF, Lookups.fixed(t)); nextRetryTime = System.currentTimeMillis() + retryPeriod; oldDisplayName = getDisplayName(); timer.start(); }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override @Nonnull public String getShortDescription() { final Node delegate = getOriginal(); // // If the delegate is not a GenericNode, it is not using a Displayable for its icon, thus it is directly // providing its own icon. It could even have an Displayable in its Lookup as it could be a FilterNode; for // this reason there's this explicit check. // if (!(delegate instanceof NodePresentationModel) && !(delegate instanceof GenericFilterNode)) { return super.getShortDescription(); } final Describable describable = getLookup().lookup(Describable); return (describable != null) ? describable.getDescription() : super.getShortDescription(); }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override @CheckForNull public Action[] getActions (final boolean context) { final Node delegate = getOriginal(); // // If the delegate is not a NodePresentationModel, it is not using an ActionProvider, thus it is directly // providing its own actions. It could even have an ActionProvider in its Lookup as it could be a FilterNode; for // this reason there's this explicit check. // if (!(delegate instanceof NodePresentationModel) && !(delegate instanceof GenericFilterNode)) { return super.getActions(); } final ActionProvider actionProvider = getLookup().lookup(ActionProvider); return (actionProvider != null) ? actionProvider.getActions().toArray(new Action[0]) : super.getActions(); }
@Override @Nonnull protected Node getRootNode() throws NotFoundException { return geoCoderManager.findDefaultGeoCoder().getLookup().lookup(RootNodeProvider.class).getRootNode(); } }
public GenericTreePanel1 (final @Nonnull RootNodeProvider rootNodeProvider) { setLayout(new BorderLayout()); add(new BeanTreeView(), BorderLayout.CENTER); try { explorerManager.setRootContext(rootNodeProvider.getRootNode()); } catch (NotFoundException e) { e.printStackTrace(); } } }