View Javadoc

1   /*
2   Copyright 2010 James Pether Sörling Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 
3   	$Id
4   */
5   package org.directdemocracyportal.democracy.web.views.dialogs;
6   
7   import thinwire.ui.Dialog;
8   
9   /***
10   * The Class AbstractActionDialog.
11   */
12  public class AbstractActionDialog extends Dialog
13  {
14  
15      /***
16       * The Enum DialogResult.
17       */
18      public enum DialogResult {
19  
20          /*** The Dialog_ closed. */
21          Dialog_Closed,
22  
23          /*** The Do_ action. */
24          Do_Action,
25  
26          /*** The Action_ cancelled. */
27          Action_Cancelled;
28      }
29  
30      /*** The dialog result. */
31      protected DialogResult dialogResult = DialogResult.Dialog_Closed;
32  
33      /***
34       * Instantiates a new abstract action dialog.
35       *
36       * @param name the name
37       */
38      public AbstractActionDialog(String name) {
39          super(name);
40          setResizeAllowed(true);
41          setWaitForWindow(true);
42      }
43  
44      /***
45       * Gets the dialog result.
46       *
47       * @return the dialog result
48       */
49      public DialogResult getDialogResult() {
50          dialogResult = DialogResult.Dialog_Closed;
51          setVisible(true);
52          return dialogResult;
53      }
54  }