1 | public class AliasWindowManager↵ | | 1 | public class DriverWindowManager↵
|
2 | {↵ | | 2 | {↵
|
3 | /** Logger for this class. */↵ | | 3 | /** Logger for this class. */↵
|
4 | private static final ILogger s_log =↵ | | 4 | private static final ILogger s_log =↵
|
5 | LoggerController.createLogger(AliasWindowManager.class);↵ | | 5 | LoggerController.createLogger(WindowManager.class);↵
|
|
6 | /** Application API. */↵ | | 6 | /** Application API. */↵
|
7 | private final IApplication _app;↵ | | 7 | private final IApplication _app;↵
|
|
8 | /** Window Factory for alias maintenace windows. */↵ | | 8 | /** Window Factory for driver maintenace windows. */↵
|
9 | private final AliasWindowFactory _aliasWinFactory;↵ | | 9 | private final DriverWindowFactory _driverWinFactory;↵
|
|
10 | /**↵ | | 10 | /**↵
|
11 | * Ctor.↵ | | 11 | * Ctor.↵
|
12 | *↵ | | 12 | *↵
|
13 | * @param app Application API.↵ | | 13 | * @param app Application API.↵
|
14 | *↵ | | 14 | *↵
|
15 | * @throws IllegalArgumentException↵ | | 15 | * @throws IllegalArgumentException↵
|
16 | * Thrown if <TT>null</TT> <TT>IApplication</TT> passed.↵ | | 16 | * Thrown if <TT>null</TT> <TT>IApplication</TT> passed.↵
|
17 | */↵ | | 17 | */↵
|
18 | public AliasWindowManager(IApplication app)↵ | | 18 | public DriverWindowManager(IApplication app)↵
|
19 | {↵ | | 19 | {↵
|
20 | super();↵ | | 20 | super();↵
|
21 | if (app == null)↵ | | 21 | if (app == null)↵
|
22 | {↵ | | 22 | {↵
|
23 | throw new IllegalArgumentException("IApplication == null");↵ | | 23 | throw new IllegalArgumentException("IApplication == null");↵
|
24 | }↵ | | 24 | }↵
|
|
25 | _app = app;↵ | | 25 | _app = app;↵
|
26 | _aliasWinFactory = new AliasWindowFactory(_app);↵ | | 26 | _driverWinFactory = new DriverWindowFactory(_app);↵
|
27 | }↵ | | 27 | }↵
|
|
28 | /**↵ | | 28 | /**↵
|
29 | * Get a maintenance sheet for the passed alias. If a maintenance sheet↵ | | 29 | * Get a maintenance sheet for the passed driver. If a maintenance sheet↵
|
30 | already↵ | | 30 | * already↵
|
31 | * exists it will be brought to the front. If one doesn't exist↵ | | 31 | exists it will be brought to the front. If one doesn't exist↵
|
32 | it will be↵ | | 32 | * it will be↵
|
33 | * created.↵ | | 33 | created.↵
|
34 | *↵ | | 34 | *↵
|
35 | * @param alias The alias that user has requested to modify.↵ | | 35 | * @param driver The driver that user has requested to modify.↵
|
36 | *↵ | | 36 | *↵
|
37 | * @throws IllegalArgumentException↵ | | 37 | * @throws IllegalArgumentException↵
|
38 | * Thrown if a <TT>null</TT> <TT>ISQLAlias</TT> passed.↵ | | 38 | * Thrown if a <TT>null</TT> <TT>ISQLDriver</TT> passed.↵
|
39 | */↵ | | 39 | */↵
|
40 | public void showModifyAliasInternalFrame(final ISQLAlias alias)↵ | | 40 | public void showModifyDriverInternalFrame(final ISQLDriver driver)↵
|
41 | {↵ | | 41 | {↵
|
42 | if (alias == null)↵ | | 42 | if (driver == null)↵
|
43 | {↵ | | 43 | {↵
|
44 | throw new IllegalArgumentException("ISQLAlias == null");↵ | | 44 | throw new IllegalArgumentException("ISQLDriver == null");↵
|
45 | }↵ | | 45 | }↵
|
|
46 | moveToFront(_aliasWinFactory.getModifySheet(alias));↵ | | 46 | _driverWinFactory.getModifySheet(driver).moveToFront();↵
|
47 | }↵ | | 47 | }↵
|
|
48 | /**↵ | | 48 | /**↵
|
49 | * Create and show a new maintenance window to allow the user to create a↵ | | 49 | * Create and show a new maintenance window to allow the user to create a↵
|
50 | * new alias.↵ | | 50 | * new driver.↵
|
51 | */↵ | | 51 | */↵
|
52 | public void showNewAliasInternalFrame()↵ | | 52 | public void showNewDriverInternalFrame()↵
|
53 | {↵ | | 53 | {↵
|
54 | moveToFront(_aliasWinFactory.getCreateSheet());↵ | | 54 | _driverWinFactory.getCreateSheet().moveToFront();↵
|
55 | }↵ | | 55 | }↵
|
|
56 | /**↵ | | 56 | /**↵
|
57 | * Create and show a new maintenance sheet that will allow the user to↵ | | 57 | * Create and show a new maintenance sheet that will allow the user to↵
|
58 | create a↵ | | 58 | * create a↵
|
59 | * new alias that is a copy of the passed one.↵ | | 59 | new driver that is a copy of the passed one.↵
|
60 | *↵ | | 60 | *↵
|
61 | * @return The new maintenance sheet.↵ | | 61 | * @return The new maintenance sheet.↵
|
62 | *↵ | | 62 | *↵
|
63 | * @throws IllegalArgumentException↵ | | 63 | * @throws IllegalArgumentException↵
|
64 | * Thrown if a <TT>null</TT> <TT>ISQLAlias</TT> passed.↵ | | 64 | * Thrown if a <TT>null</TT> <TT>ISQLDriver</TT> passed.↵
|
65 | */↵ | | 65 | */↵
|
66 | public void showCopyAliasInternalFrame(final SQLAlias alias)↵ | | 66 | public void showCopyDriverInternalFrame(final ISQLDriver driver)↵
|
67 | {↵ | | 67 | {↵
|
68 | if (alias == null)↵ | | 68 | if (driver == null)↵
|
69 | {↵ | | 69 | {↵
|
70 | throw new IllegalArgumentException("ISQLAlias == null");↵ | | 70 | throw new IllegalArgumentException("ISQLDriver == null");↵
|
71 | }↵ | | 71 | }↵
|
|
72 | moveToFront(_aliasWinFactory.getCopySheet(alias));↵ | | 72 | _driverWinFactory.showCopySheet(↵
|
73 | ↵ | | 73 | driver).moveToFront();↵
|
74 | }↵ | | 74 | }↵
|
|
75 | public void moveToFront(final AliasInternalFrame fr)↵ | | 75 | public void moveToFront(final JInternalFrame fr)↵
|
76 | {↵ | | 76 | {↵
|
77 | if (fr != null)↵ | | 77 | if (fr != null)↵
|
78 | {↵ | | 78 | {↵
|
79 | GUIUtils.processOnSwingEventThread(new Runnable()↵ | | 79 | GUIUtils.processOnSwingEventThread(new Runnable()↵
|
80 | {↵ | | 80 | {↵
|
81 | public void run()↵ | | 81 | public void run()↵
|
82 | {↵ | | 82 | {↵
|
83 | fr.moveToFront();↵ | | 83 | GUIUtils.moveToFront(fr);↵
|
84 | }↵ | | 84 | }↵
|
85 | });↵ | | 85 | });↵
|
86 | }↵ | | 86 | }↵
|
87 | else↵ | | 87 | else↵
|
88 | {↵ | | 88 | {↵
|
89 | s_log.debug("JInternalFrame == null") | | 89 | s_log.debug("JInternalFrame == null")
|