/[schmitzm]/trunk/src/skrueger/swing/CancellableDialogAdapter.java
ViewVC logotype

Diff of /trunk/src/skrueger/swing/CancellableDialogAdapter.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

branches/2.0-RC1/src/skrueger/swing/CancellableDialogAdapter.java revision 604 by alfonx, Wed Dec 9 14:15:53 2009 UTC trunk/src/skrueger/swing/CancellableDialogAdapter.java revision 707 by alfonx, Mon Feb 15 11:07:30 2010 UTC
# Line 2  package skrueger.swing; Line 2  package skrueger.swing;
2    
3  import java.awt.Component;  import java.awt.Component;
4  import java.awt.Dialog;  import java.awt.Dialog;
5    import java.awt.event.ActionEvent;
6  import java.util.Locale;  import java.util.Locale;
7    
8    import javax.swing.AbstractAction;
9  import javax.swing.JDialog;  import javax.swing.JDialog;
10  import javax.swing.JOptionPane;  import javax.swing.JOptionPane;
11    
 import schmitzm.geotools.gui.GeotoolsGUIUtil;  
12  import schmitzm.lang.LangUtil;  import schmitzm.lang.LangUtil;
13  import schmitzm.lang.ResourceProvider;  import schmitzm.lang.ResourceProvider;
14  import schmitzm.swing.SwingUtil;  import schmitzm.swing.SwingUtil;
# Line 30  public abstract class CancellableDialogA Line 31  public abstract class CancellableDialogA
31    
32          /** Has this dialog been canceled ?**/          /** Has this dialog been canceled ?**/
33          protected boolean cancelled = false;          protected boolean cancelled = false;
34    
35            private OkButton okButton;
36            
37            private CancelButton cancelButton;
38                    
39          public CancellableDialogAdapter(Component parentWindow) {          public CancellableDialogAdapter(Component parentWindow) {
40                  super(parentWindow);                  super(parentWindow);
# Line 108  public abstract class CancellableDialogA Line 113  public abstract class CancellableDialogA
113                  dispose();                  dispose();
114                  return true;                  return true;
115          }          }
116    
117            /**
118             * @return a default OkButton that will call {@link #okClose()}
119             */
120            protected OkButton getOkButton() {
121                    if (okButton == null) {
122                            okButton = new OkButton(new AbstractAction() {
123                                    
124                                    @Override
125                                    public void actionPerformed(ActionEvent e) {
126                                            okClose();
127                                    }
128                            });
129                    }
130                    return okButton;
131            }
132                    
133    
134            /**
135             * @return a default CancelButton that will call {@link #cancelClose()}
136             */
137            protected CancelButton getCancelButton() {
138                    if (cancelButton == null) {
139                            cancelButton = new CancelButton(new AbstractAction() {
140                                    
141                                    @Override
142                                    public void actionPerformed(ActionEvent e) {
143                                            cancelClose();
144                                    }
145                            });
146                    }
147                    return cancelButton;
148            }
149    
150  }  }

Legend:
Removed from v.604  
changed lines
  Added in v.707

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26