1 package net.logAnalyzer.utils.gui.quickbar;
2
3 import java.awt.event.ActionListener;
4
5 import javax.swing.JComponent;
6
7 /***
8 * This interface defines a QuickAction to use in q
9 * {@link net.logAnalyzer.utils.gui.quickbar.QuickBar}.
10 * <p>
11 * A QuickAction must use {@link java.awt.event.ActionEvent} to notify
12 * {@link java.awt.event.ActionListener}(s). If you have to fire an
13 * {@link java.awt.event.ActionEvent}, call
14 * {@link java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)}
15 * on each {@link java.awt.event.ActionListener}.
16 */
17 public interface QuickAction {
18 /***
19 * Adds an <code>ActionListener</code> to the button.
20 *
21 * @param l
22 * the <code>ActionListener</code> to be added
23 */
24 public void addActionListener(ActionListener l);
25
26 /***
27 * Each QuickAction must be a {@link JComponent} or have an internal
28 * {@link JComponent} for GUI. Useful to place the QuickAction in the
29 * {@link QuickBar}.
30 * <p>
31 * Common implementation is :
32 *
33 * <pre>
34 * public JComponent getGUI() {
35 * return (JComponent) this;
36 * }
37 * </pre>
38 *
39 * @return The QuickAction GUI.
40 */
41 public JComponent getGUI();
42
43 /***
44 * Returns the action name.
45 *
46 * @return Action name.
47 */
48 public String getName();
49 }