public Integer getOrder() { getComponent() .getDocument() .getTransactionManager() .readAccess( new Runnable() { public void run() { targetComponent = new WeakReference<DesignComponent>(getTargetComponent()); } }); if (targetComponent == null) throw new IllegalStateException(getComponent() + " has no target component"); // NOI18N Collection<? extends ActionsPresenter> presenters = targetComponent.get().getPresenters(ActionsPresenter.class); for (ActionsPresenter presenter : presenters) { List<Action> pa = presenter.getActions(); for (Action action : pa) { if (action == null) continue; if (actionToInherit == action.getClass()) { return presenter.getOrder(); } } } return null; }
public List<Action> getActions() { getComponent() .getDocument() .getTransactionManager() .readAccess( new Runnable() { public void run() { targetComponent = new WeakReference<DesignComponent>(getTargetComponent()); } }); if (targetComponent == null) throw new IllegalStateException(getComponent() + " has no target component"); // NOI18N // Action[] allActions = ActionsSupport.createActionsArray(targetComponent.get()); List<Action> filteredActions = null; // Fix for IZ#143558 - NullPointerException at // org.netbeans.modules.vmd.model.actions.ActionsPresenterForwarder.getActions if (targetComponent.get() == null) { return Collections.emptyList(); } Collection<? extends ActionsPresenter> presenters = targetComponent.get().getPresenters(ActionsPresenter.class); for (ActionsPresenter presenter : presenters) { List<Action> pa = presenter.getActions(); for (Action action : pa) { if (action == null) continue; if (actionToInherit == action.getClass()) { if (filteredActions == null) filteredActions = new ArrayList<Action>(); filteredActions.add(action); } } } return filteredActions; }