本文整理汇总了Java中java.awt.event.ActionEvent.ACTION_PERFORMED属性的典型用法代码示例。如果您正苦于以下问题:Java ActionEvent.ACTION_PERFORMED属性的具体用法?Java ActionEvent.ACTION_PERFORMED怎么用?Java ActionEvent.ACTION_PERFORMED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.awt.event.ActionEvent
的用法示例。
在下文中一共展示了ActionEvent.ACTION_PERFORMED属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: notifyActionListeners
/**
* Notifies all the action listeners of the event.
*
* @param command the command
* @param body the effected body
*/
private void notifyActionListeners(String command, SandboxBody body) {
ActionListener[] listeners = this.getListeners(ActionListener.class);
int size = listeners.length;
BodyActionEvent event = new BodyActionEvent(this, ActionEvent.ACTION_PERFORMED, command, body);
for (int i = 0; i < size; i++) {
listeners[i].actionPerformed(event);
}
}
示例2: fireActionPerformed
/**
* Notifies all registered listeners about the event.
*
* @param event The event to be fired
*/
private void fireActionPerformed(boolean committed) {
if (listenerList == null) {
return;
}
CellEditorActionEvent event = new CellEditorActionEvent(this,
ActionEvent.ACTION_PERFORMED,
getActionCommand(),
committed);
Object[] listeners = listenerList.getListenerList();
for (int i = listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i] == ActionListener.class) {
((ActionListener) listeners[i + 1]).actionPerformed(event);
}
}
}
示例3: actionPerformed
public void actionPerformed (ActionEvent ae) {
JComponent item = (JComponent) ae.getSource();
String actionCommand = (String) item.getClientProperty(KEY_ACTION);
String context = (String) item.getClientProperty(KEY_CONTAINERCTX);
getEngine().notifyWillPerform (actionCommand, context);
Action action = getEngine().getAction(context, actionCommand);
if (action.isEnabled()) {
ActionEvent event = new ActionEvent (item,
ActionEvent.ACTION_PERFORMED, actionCommand);
action.actionPerformed(event);
}
getEngine().notifyPerformed (actionCommand, context);
}
示例4: trackEvent
private static boolean trackEvent(int eventID, Component comp, Runnable action, int time, boolean printEvent) {
EventListener listener = null;
switch (eventID) {
case WindowEvent.WINDOW_GAINED_FOCUS:
listener = wgfListener;
break;
case FocusEvent.FOCUS_GAINED:
listener = fgListener;
break;
case ActionEvent.ACTION_PERFORMED:
listener = apListener;
break;
}
listener.listen(comp, printEvent);
action.run();
return Util.waitForCondition(listener.getNotifier(), time);
}
示例5: keyPressed
public void keyPressed(KeyEvent e) {
int keyc = e.getKeyCode();
if (keyc == KeyEvent.VK_UP || keyc == KeyEvent.VK_DOWN
|| keyc == KeyEvent.VK_LEFT || keyc == KeyEvent.VK_RIGHT) {
// System.err.println("arrow key released");
ActionEvent action = new ActionEvent(e.getSource(),
ActionEvent.ACTION_PERFORMED, InputGUI.GRAMSEL);
g.actionPerformed(action);
}
}
示例6: createActionEvent
private static ActionEvent createActionEvent (Action action) {
Object evSource = null;
int evId = ActionEvent.ACTION_PERFORMED;
// text (editor) actions
if (action instanceof TextAction) {
EditorCookie ec = Utilities.actionsGlobalContext().lookup(EditorCookie.class);
if (ec == null) {
return null;
}
JEditorPane[] editorPanes = ec.getOpenedPanes();
if (editorPanes == null || editorPanes.length <= 0) {
return null;
}
evSource = editorPanes[0];
}
if (evSource == null) {
evSource = TopComponent.getRegistry().getActivated();
}
if (evSource == null) {
evSource = WindowManager.getDefault().getMainWindow();
}
return new ActionEvent(evSource, evId, null);
}
示例7: performAction
private static boolean performAction (Action a) {
if (a == null) {
return false;
}
ActionEvent ae = new ActionEvent(ProjectUtilities.class, ActionEvent.ACTION_PERFORMED, "command"); // NOI18N
try {
a.actionPerformed(ae);
return true;
} catch (Exception e) {
LOG.log(Level.WARNING, null, e);
return false;
}
}
示例8: SlideBarActionEvent
public SlideBarActionEvent(Object source, String command, SlideOperation operation,
MouseEvent mouseEvent, int tabIndex) {
super(source, ActionEvent.ACTION_PERFORMED, command);
this.tabIndex = tabIndex;
this.mouseEvent = mouseEvent;
this.slideOperation = operation;
}
示例9: propertyChange
@Override
public void propertyChange(PropertyChangeEvent e) {
ActionListener[] listeners = this.getListeners(ActionListener.class);
ActionEvent event = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "changed");
// forward the event to the listeners on this class
for (ActionListener listener : listeners) {
listener.actionPerformed(event);
}
}
示例10: afterInsert
@Override
public void afterInsert(Context context) throws BadLocationException {
if (isJavadocTouched) {
Lookup.Result<TextAction> res = MimeLookup.getLookup(MimePath.parse("text/x-javadoc")).lookupResult(TextAction.class); // NOI18N
ActionEvent newevt = new ActionEvent(context.getComponent(), ActionEvent.ACTION_PERFORMED, "fix-javadoc"); // NOI18N
for (TextAction action : res.allInstances()) {
action.actionPerformed(newevt);
}
isJavadocTouched = false;
}
}
示例11: mouseClicked
public void mouseClicked(MouseEvent e) {
// hide the balloon by any click
hide();
if (e.getButton() == MouseEvent.BUTTON1) {
ActionEvent aev = new ActionEvent(target, ActionEvent.ACTION_PERFORMED,
liveArguments.getActionCommand(),
e.getWhen(), e.getModifiers());
XToolkit.postEvent(XToolkit.targetToAppContext(aev.getSource()), aev);
}
}
示例12: eventEnabled
boolean eventEnabled(AWTEvent e) {
if (e.id == ActionEvent.ACTION_PERFORMED) {
if ((eventMask & AWTEvent.ACTION_EVENT_MASK) != 0 ||
actionListener != null) {
return true;
}
return false;
}
return super.eventEnabled(e);
}
示例13: postToolTip
public static void postToolTip(JComponent comp) {
Action action = comp.getActionMap().get("postTip");
if (action == null) {
return;
}
ActionEvent ae = new ActionEvent(comp, ActionEvent.ACTION_PERFORMED, "postTip", EventQueue.getMostRecentEventTime(),
0);
action.actionPerformed(ae);
}
示例14: hideToolTip
public static void hideToolTip(JComponent comp) {
Action action = comp.getActionMap().get("hideTip");
if (action == null) {
return;
}
ActionEvent ae = new ActionEvent(comp, ActionEvent.ACTION_PERFORMED, "hideTip", EventQueue.getMostRecentEventTime(),
0);
action.actionPerformed(ae);
}
示例15: actionPerformed
@Override
public void actionPerformed(ActionEvent e) {
int row = table.convertRowIndexToModel(table.getEditingRow());
fireEditingStopped();
// Invoke the Action
ActionEvent event = new ActionEvent(
table,
ActionEvent.ACTION_PERFORMED,
Integer.toString(row));
action.actionPerformed(event);
}