public javax.swing.JMenuItem getPopupPresenter() { if (isMethodOverridden(delegate, "getPopupPresenter")) { // NOI18N return delegate.getPopupPresenter(); } else { return org.openide.util.actions.ActionPresenterProvider.getDefault().createPopupPresenter(this); } }
public javax.swing.JMenuItem getMenuPresenter() { if (isMethodOverridden(delegate, "getMenuPresenter")) { // NOI18N return delegate.getMenuPresenter(); } else { return org.openide.util.actions.ActionPresenterProvider.getDefault().createMenuPresenter(this); } }
public java.awt.Component getToolbarPresenter() { if (isMethodOverridden(delegate, "getToolbarPresenter")) { // NOI18N return delegate.getToolbarPresenter(); } else { return org.openide.util.actions.ActionPresenterProvider.getDefault().createToolbarPresenter(this); } }
/** Initialize the action to have no performer. */ protected void initialize() { super.initialize(); updateEnabled(); setSurviveFocusChange(false); }
/** Clears the listener. */ private void clearListener() { synchronized (LISTENER) { // remove listener on any action ActionDelegateListener l = (ActionDelegateListener) getProperty(LISTENER); if (l != null) { l.clear(); putProperty(LISTENER, null); } } }
public void actionPerformed(java.awt.event.ActionEvent ev) { setBooleanState(!getBooleanState()); } }
protected void initialize() { putProperty(PROP_BOOLEAN_STATE, Boolean.TRUE); super.initialize(); }
/** Set the current state. * Fires a change event, which should be used to affect other components when * its state is toggled. * @param value <code>true</code> to turn on, <code>false</code> to turn off */ public void setBooleanState(boolean value) { Boolean newValue = value ? Boolean.TRUE : Boolean.FALSE; Boolean oldValue = (Boolean) putProperty(PROP_BOOLEAN_STATE, newValue); firePropertyChange(PROP_BOOLEAN_STATE, oldValue, newValue); }
public void run() { if (ap == getActionPerformer()) { getActionPerformer().performAction(CallbackSystemAction.this); } } }
/** Obtain a singleton instance of the action with a specified class. * If there already is a instance then it is returned, otherwise * a new one is created. * * @param actionClass the class of the action to find * @return the singleton action instance * @exception ClassCastException if the class is not <code>SystemAction</code> * @exception IllegalArgumentException if the instance cannot be created */ public static <T extends SystemAction> T get(Class<T> actionClass) { return findObject(actionClass, true); }
/** Set whether the action should be enabled. * @param value <code>true</code> to enable it */ public void setEnabled(boolean value) { putProperty(PROP_ENABLED, value ? Boolean.TRUE : Boolean.FALSE, true); }
public final void doRun() { ActionInvoker bridge = Lookup.getDefault().lookup(ActionInvoker.class); if (bridge != null) { bridge.invokeAction (this, ev); } else { this.actionPerformed(ev); } }
/** Get the action's display icon. * @return the icon * @throws IllegalStateException if an icon could not be created */ public final Icon getIcon() { return getIcon(false); }
public void run() { performAction(); } }
public synchronized static GlobalManager getDefault() { if (instance != null) { return instance; } instance = new GlobalManager(); return instance; }
public static ActionRunnable create(ActionEvent ev, Action a, boolean async) { return new ActionRunnable(ev, a, async) { @Override protected void run() { action.actionPerformed(ev); } }; }
public void run() { r.doRun(); } };
/** Perform the action. * This default implementation calls the assigned action performer if it * exists, otherwise does nothing. * @deprecated This only uses {@link ActionPerformer}. Use {@link #actionPerformed} instead. */ @Deprecated public void performAction() { ActionPerformer ap = getActionPerformer(); if (ap != null) { ap.performAction(this); } }
/** Set a property in the singleton. This property is common for all instances * of the same class. * * @param name the name of the property * @param value the value */ public final void putValue(String name, Object value) { putProperty(name, value, true); // Could handle putValue (SMALL_ICON, ImageIcon icon) but not // really that important. }
/** Set the action's display icon. * @param icon the icon */ public final void setIcon(Icon icon) { putProperty(PROP_ICON, icon, true); putProperty(PROP_ICON_TEXTUAL, icon); }