01: /*
02: * Copyright (C) 2007 Rob Manning
03: * manningr@users.sourceforge.net
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18: */
19: package net.sourceforge.squirrel_sql.fw.gui;
20:
21: import java.awt.Component;
22: import java.awt.Frame;
23: import java.io.File;
24:
25: import javax.swing.JComponent;
26:
27: import net.sourceforge.squirrel_sql.fw.util.FileExtensionFilter;
28:
29: /**
30: * A Utility class that is instantiatable and delegates all calls to the
31: * static methods of Dialogs. This allows IDialogUtils to be injected so that
32: * a direct reference to Dialogs is unnecessary. This is important in unit
33: * tests since it is not desirable to instantiate windowing toolkit components.
34: *
35: * @author manningr
36: *
37: */
38: public class DialogUtils implements IDialogUtils {
39:
40: /**
41: * @see net.sourceforge.squirrel_sql.fw.gui.IDialogUtils#selectFileForWriting(java.awt.Frame, net.sourceforge.squirrel_sql.fw.util.FileExtensionFilter[])
42: */
43: public File selectFileForWriting(Frame parentFrame,
44: FileExtensionFilter[] filters) {
45: return Dialogs.selectFileForWriting(parentFrame, filters);
46: }
47:
48: /**
49: * @see net.sourceforge.squirrel_sql.fw.gui.IDialogUtils#selectFileForWriting(java.awt.Frame, net.sourceforge.squirrel_sql.fw.util.FileExtensionFilter[], javax.swing.JComponent)
50: */
51: public File selectFileForWriting(Frame parentFrame,
52: FileExtensionFilter[] filters, JComponent accessory) {
53: return Dialogs.selectFileForWriting(parentFrame, filters,
54: accessory);
55: }
56:
57: /**
58: * @see net.sourceforge.squirrel_sql.fw.gui.IDialogUtils#showNotYetImplemented(java.awt.Component)
59: */
60: public void showNotYetImplemented(Component owner) {
61: Dialogs.showNotYetImplemented(owner);
62: }
63:
64: /**
65: * @see net.sourceforge.squirrel_sql.fw.gui.IDialogUtils#showOk(java.awt.Component, java.lang.String)
66: */
67: public void showOk(Component owner, String msg) {
68: Dialogs.showOk(owner, msg);
69: }
70:
71: /**
72: * @see net.sourceforge.squirrel_sql.fw.gui.IDialogUtils#showYesNo(java.awt.Component, java.lang.String)
73: */
74: public boolean showYesNo(Component owner, String msg) {
75: return Dialogs.showYesNo(owner, msg);
76: }
77:
78: /**
79: * @see net.sourceforge.squirrel_sql.fw.gui.IDialogUtils#showYesNo(java.awt.Component, java.lang.String, java.lang.String)
80: */
81: public boolean showYesNo(Component owner, String msg, String title) {
82: return Dialogs.showYesNo(owner, msg, title);
83: }
84:
85: }
|