public final void doRun() { ActionInvoker bridge = Lookup.getDefault().lookup(ActionInvoker.class); if (bridge != null) { bridge.invokeAction (this, ev); } else { this.actionPerformed(ev); } }
public void actionPerformed(ActionEvent ev) { if (isEnabled()) { org.openide.util.actions.ActionInvoker.invokeAction( this, ev, asynchronous(), new Runnable() { public void run() { performAction(); } } ); } else { // Should not normally happen. Toolkit.getDefaultToolkit().beep(); } }
/** Invoked when an action occurs. */ public void actionPerformed(final java.awt.event.ActionEvent e) { final Action a = findAction(); if (a != null) { Runnable run = new Runnable() { public void run() { a.actionPerformed(e); } }; org.openide.util.actions.ActionInvoker.invokeAction(delegate, e, delegate.asynchronous(), run); } else { // XXX #30303 if the action falls back to the old behaviour // it may not be performed in case it is in dialog and // is not transmodal. // This is just a hack, see TopComponent.processKeyBinding. Object source = e.getSource(); if ( source instanceof Component && javax.swing.SwingUtilities.getWindowAncestor((Component) source) instanceof java.awt.Dialog ) { Object value = delegate.getValue("OpenIDE-Transmodal-Action"); // NOI18N if (!Boolean.TRUE.equals(value)) { return; } } delegate.actionPerformed(e); } }
/** Perform the action. Tries the performer and then scans the ActionMap * of selected topcomponent. */ public void actionPerformed(final ActionEvent ev) { // First try global context action. final Action action = GlobalManager.getDefault().findGlobalAction(getActionMapKey(), getSurviveFocusChange()); if (action != null) { if (action.isEnabled()) { action.actionPerformed(ev); } else { Toolkit.getDefaultToolkit().beep(); } return; } final Object ap = getActionPerformer(); if (ap != null) { org.openide.util.actions.ActionInvoker.invokeAction( this, ev, asynchronous(), new Runnable() { public void run() { if (ap == getActionPerformer()) { getActionPerformer().performAction(CallbackSystemAction.this); } } } ); return; } Toolkit.getDefaultToolkit().beep(); }
/** Invoked when an action occurs. */ public void actionPerformed(final java.awt.event.ActionEvent e) { assert EventQueue.isDispatchThread(); final javax.swing.Action a = findAction(); if (a != null) { ActionInvoker.invokeAction(a, e, async, null); } }
/** Invoked when an action occurs. */ @Override public void actionPerformed(ActionEvent e) { ActionInvoker.invokeAction(delegate, e, delegate.amIasynchronous(), new Runnable() { @Override public void run() { delegate.performAction(nodes()); } }); }
public final void doRun() { ActionInvoker bridge = Lookup.getDefault().lookup(ActionInvoker.class); if (bridge != null) { bridge.invokeAction (this, ev); } else { this.actionPerformed(ev); } }
ActionInvoker.invokeAction(this, ev, amIasynchronous(), new Runnable() { @Override public void run() { ActionInvoker.invokeAction(this, ev, amIasynchronous(), new Runnable() { @Override public void run() {
public void actionPerformed(final ActionEvent e) { assert EventQueue.isDispatchThread(); if (getDelegate() instanceof Action) { if (!((Action)getDelegate()).isEnabled()) { Toolkit.getDefaultToolkit().beep(); // Do not fire newValue == null (see #165838) firePropertyChange("enabled", null, isEnabled()); // NOI18N return; } } boolean async = Boolean.TRUE.equals(map.get("asynchronous")); // NOI18N Runnable ar = new Runnable() { public void run() { getDelegate().actionPerformed(e); } }; ActionInvoker.invokeAction(this, e, async, ar); }
public void actionPerformed(ActionEvent ev) { if (isEnabled()) { org.openide.util.actions.ActionInvoker.invokeAction( this, ev, asynchronous(), new Runnable() { public void run() { performAction(); } } ); } else { // Should not normally happen. Utilities.disabledActionBeep(); } }
/** Invoked when an action occurs. */ public void actionPerformed(final java.awt.event.ActionEvent e) { final Action a = findAction(); if (a != null) { Runnable run = new Runnable() { public void run() { a.actionPerformed(e); } }; org.openide.util.actions.ActionInvoker.invokeAction(delegate, e, delegate.asynchronous(), run); } else { // XXX #30303 if the action falls back to the old behaviour // it may not be performed in case it is in dialog and // is not transmodal. // This is just a hack, see TopComponent.processKeyBinding. Object source = e.getSource(); if ( source instanceof Component && javax.swing.SwingUtilities.getWindowAncestor((Component) source) instanceof java.awt.Dialog ) { Object value = delegate.getValue("OpenIDE-Transmodal-Action"); // NOI18N if (!Boolean.TRUE.equals(value)) { return; } } delegate.actionPerformed(e); } }
/** Perform the action. Tries the performer and then scans the ActionMap * of selected topcomponent. */ public void actionPerformed(final ActionEvent ev) { // First try global context action. final Action action = GlobalManager.getDefault().findGlobalAction(getActionMapKey(), getSurviveFocusChange()); if (action != null) { if (action.isEnabled()) { action.actionPerformed(ev); } else { Utilities.disabledActionBeep(); } return; } final Object ap = getActionPerformer(); if (ap != null) { org.openide.util.actions.ActionInvoker.invokeAction( this, ev, asynchronous(), new Runnable() { public void run() { if (ap == getActionPerformer()) { getActionPerformer().performAction(CallbackSystemAction.this); } } } ); return; } Utilities.disabledActionBeep(); }
public final void doRun() { ActionInvoker bridge = Lookup.getDefault().lookup(ActionInvoker.class); if (bridge != null) { bridge.invokeAction (this, ev); } else { this.actionPerformed(ev); } }
public void actionPerformed(ActionEvent ev) { if (isEnabled()) { org.openide.util.actions.ActionInvoker.invokeAction( this, ev, asynchronous(), new Runnable() { public void run() { performAction(); } } ); } else { // Should not normally happen. Toolkit.getDefaultToolkit().beep(); } }
/** Invoked when an action occurs. */ public void actionPerformed(final java.awt.event.ActionEvent e) { final Action a = findAction(); if (a != null) { Runnable run = new Runnable() { public void run() { a.actionPerformed(e); } }; org.openide.util.actions.ActionInvoker.invokeAction(delegate, e, delegate.asynchronous(), run); } else { // XXX #30303 if the action falls back to the old behaviour // it may not be performed in case it is in dialog and // is not transmodal. // This is just a hack, see TopComponent.processKeyBinding. Object source = e.getSource(); if ( source instanceof Component && javax.swing.SwingUtilities.getWindowAncestor((Component) source) instanceof java.awt.Dialog ) { Object value = delegate.getValue("OpenIDE-Transmodal-Action"); // NOI18N if (!Boolean.TRUE.equals(value)) { return; } } delegate.actionPerformed(e); } }
/** Perform the action. Tries the performer and then scans the ActionMap * of selected topcomponent. */ public void actionPerformed(final ActionEvent ev) { // First try global context action. final Action action = GlobalManager.getDefault().findGlobalAction(getActionMapKey(), getSurviveFocusChange()); if (action != null) { if (action.isEnabled()) { action.actionPerformed(ev); } else { Toolkit.getDefaultToolkit().beep(); } return; } final Object ap = getActionPerformer(); if (ap != null) { org.openide.util.actions.ActionInvoker.invokeAction( this, ev, asynchronous(), new Runnable() { public void run() { if (ap == getActionPerformer()) { getActionPerformer().performAction(CallbackSystemAction.this); } } } ); return; } Toolkit.getDefaultToolkit().beep(); }