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; |
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); |
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 |
} |
} |