diff options
Diffstat (limited to 'client/inputforms/InputForm.java')
| -rw-r--r-- | client/inputforms/InputForm.java | 144 |
1 files changed, 72 insertions, 72 deletions
diff --git a/client/inputforms/InputForm.java b/client/inputforms/InputForm.java index 75a2dec..41004fa 100644 --- a/client/inputforms/InputForm.java +++ b/client/inputforms/InputForm.java @@ -14,80 +14,80 @@ import client.*; * */ public abstract class InputForm extends SubWindow { - protected final static long serialVersionUID = 1L; - protected Vector vecFields; - protected JPanel jPanelButtons; - protected JButton jButtonClear; - protected JButton jButtonApply; - protected JButton jButtonCancel; - protected JButton jButtonOK; - private boolean bApplyHasBeenPressed = false; - - protected final static String BUTTON_CANCEL = "Cancel"; - protected final static String BUTTON_CLEAR = "Clear"; - protected final static String BUTTON_APPLY = "Apply"; - protected final static String BUTTON_OK = "OK"; + protected final static long serialVersionUID = 1L; + protected Vector vecFields; + protected JPanel jPanelButtons; + protected JButton jButtonClear; + protected JButton jButtonApply; + protected JButton jButtonCancel; + protected JButton jButtonOK; + private boolean bApplyHasBeenPressed = false; - protected final static int TEXTFIELD_LENGTH = 20; - - /** - * Creates the input form window and show it. - * @param sTitleText Specifies the title text of this JFrame. - * @param netCalendarClient Specifies the calendar client session object to use. - */ - public InputForm(String sTitleText, NetCalendarClient netCalendarClient) { - super(sTitleText, netCalendarClient); - } + protected final static String BUTTON_CANCEL = "Cancel"; + protected final static String BUTTON_CLEAR = "Clear"; + protected final static String BUTTON_APPLY = "Apply"; + protected final static String BUTTON_OK = "OK"; - /** - * Initializes the input form - * @param sTitleText Specifies the title text of this JFrame. - * @param netCalendarClient Specifies the calendar client session object to use. - */ - public void init(String sTitleText, NetCalendarClient netCalendarClient) { - super.init(sTitleText, netCalendarClient); - } + protected final static int TEXTFIELD_LENGTH = 20; - /** - * Initializes all the GUI components of the implementating class. - */ - protected void initComponents() { - jButtonClear = new JButton(BUTTON_CLEAR); - jButtonApply = new JButton(BUTTON_APPLY); - jButtonCancel = new JButton(BUTTON_CANCEL); - jButtonOK = new JButton(BUTTON_OK); + /** + * Creates the input form window and show it. + * @param sTitleText Specifies the title text of this JFrame. + * @param netCalendarClient Specifies the calendar client session object to use. + */ + public InputForm(String sTitleText, NetCalendarClient netCalendarClient) { + super(sTitleText, netCalendarClient); + } - ActionListener actionListenerButtons = new ActionListener() { - public void actionPerformed(ActionEvent event) { - if (event.getActionCommand().equals(BUTTON_CANCEL)) { - dispose(); - - } else if (event.getActionCommand().equals(BUTTON_APPLY)) { - bApplyHasBeenPressed = true; - submit(); - - } else if (event.getActionCommand().equals(BUTTON_OK)) { - if (!bApplyHasBeenPressed) - submit(); - dispose(); - } - } - }; - - jButtonCancel.addActionListener(actionListenerButtons); - jButtonClear.addActionListener(actionListenerButtons); - jButtonApply.addActionListener(actionListenerButtons); - jButtonOK.addActionListener(actionListenerButtons); - - jPanelButtons = new JPanel(); - jPanelButtons.add(jButtonOK); - jPanelButtons.add(jButtonCancel); - jPanelButtons.add(jButtonApply); - jPanelButtons.add(jButtonClear); - } - - /** - * Submits the input form of the implementating class. - */ - protected abstract void submit(); + /** + * Initializes the input form + * @param sTitleText Specifies the title text of this JFrame. + * @param netCalendarClient Specifies the calendar client session object to use. + */ + public void init(String sTitleText, NetCalendarClient netCalendarClient) { + super.init(sTitleText, netCalendarClient); + } + + /** + * Initializes all the GUI components of the implementating class. + */ + protected void initComponents() { + jButtonClear = new JButton(BUTTON_CLEAR); + jButtonApply = new JButton(BUTTON_APPLY); + jButtonCancel = new JButton(BUTTON_CANCEL); + jButtonOK = new JButton(BUTTON_OK); + + ActionListener actionListenerButtons = new ActionListener() { + public void actionPerformed(ActionEvent event) { + if (event.getActionCommand().equals(BUTTON_CANCEL)) { + dispose(); + + } else if (event.getActionCommand().equals(BUTTON_APPLY)) { + bApplyHasBeenPressed = true; + submit(); + + } else if (event.getActionCommand().equals(BUTTON_OK)) { + if (!bApplyHasBeenPressed) + submit(); + dispose(); + } + } + }; + + jButtonCancel.addActionListener(actionListenerButtons); + jButtonClear.addActionListener(actionListenerButtons); + jButtonApply.addActionListener(actionListenerButtons); + jButtonOK.addActionListener(actionListenerButtons); + + jPanelButtons = new JPanel(); + jPanelButtons.add(jButtonOK); + jPanelButtons.add(jButtonCancel); + jPanelButtons.add(jButtonApply); + jPanelButtons.add(jButtonClear); + } + + /** + * Submits the input form of the implementating class. + */ + protected abstract void submit(); } |
