1 | public class CopyDriverAction extends SquirrelAction↵ | | 1 | public class ShowDriverWebsiteAction extends SquirrelAction↵
|
2 | {↵ | | 2 | {↵
|
3 | /** Logger for this class. */↵ | | 3 | /** Logger for this class. */↵
|
4 | private static ILogger s_log =↵ | | 4 | private static ILogger s_log =↵
|
5 | LoggerController.createLogger(ConnectToAliasAction.class);↵ | | 5 | LoggerController.createLogger(ShowDriverWebsiteAction.class);↵
|
|
6 | /** Internationalized strings for this class. */↵ | | 6 | /** Internationalized strings for this class. */↵
|
7 | private static final StringManager s_stringMgr =↵ | | 7 | private static final StringManager s_stringMgr =↵
|
8 | StringManagerFactory.getStringManager(CopyDriverAction.class);↵ | | 8 | StringManagerFactory.getStringManager(ShowDriverWebsiteAction.class);↵
|
9 | ↵ | | 9 | ↵
|
10 | /**↵ | | |
|
11 | ↵ | | 10 | /**↵
|
12 | * List of all the users drivers.↵ | | 11 | * List of all the users drivers.↵
|
13 | */↵ | | |
|
14 | ↵ | | 12 | */↵
|
15 | private IDriversList _drivers;↵ | | 13 | private IDriversList _drivers;↵
|
|
16 | /**↵ | | 14 | /**↵
|
17 | * Ctor specifying the list of drivers.↵ | | 15 | * Ctor.↵
|
18 | *↵ | | 16 | *↵
|
19 | * @param app Application API.↵ | | 17 | * @param app Application API.↵
|
20 | * @param list List of <TT>ISQLDriver</TT> objects.↵ | | 18 | *↵
|
21 | *↵ | | |
|
22 | * @throws IllegalArgumentException↵ | | |
|
23 | * thrown if a <TT>null</TT> <TT>DriversList</TT> passed.↵ | | |
|
24 | */↵ | | |
|
25 | public CopyDriver↵ | | 19 | /↵
|
26 | Action(IApplication app, IDriversList list)↵ | | 20 | public ShowDriverWebsiteAction(IApplication app, IDriversList list)↵
|
27 | throws IllegalArgumentException↵ | | 21 | ↵
|
28 | {↵ | | 22 | {↵
|
29 | super(app);↵ | | 23 | super(app);↵
|
30 | if (list == null)↵ | | 24 | if (list == null)↵
|
31 | {↵ | | |
|
32 | ↵ | | 25 | {↵
|
33 | throw new IllegalArgumentException("Null DriversList passed");↵ | | 26 | throw new IllegalArgumentException("Null DriversList passed");↵
|
34 | }↵ | | |
|
35 | ↵ | | 27 | } ↵
|
36 | _drivers = list;↵ | | 28 | _drivers = list;↵
|
37 | }↵ | | 29 | }↵
|
|
38 | /**↵ | | 30 | /**↵
|
39 | * Perform this action. Use the <TT>CopyDriverCommand</TT>.↵ | | 31 | * Perform this action. Execute the create driver command.↵
|
40 | *↵ | | 32 | *↵
|
41 | * @param evt The current event.↵ | | 33 | * @param evt The current event.↵
|
42 | */↵ | | 34 | */↵
|
43 | public void actionPerformed(ActionEvent evt)↵ | | 35 | public void actionPerformed(ActionEvent evt)↵
|
44 | {↵ | | 36 | {↵
|
45 | final IApplication app = getApplication();↵ | | 37 | IApplication app = getApplication();↵
|
46 | final DriversListInternalFrame tw = app.getWindowManager().getDriversListInternalFrame();↵ | | 38 | DriversListInternalFrame tw = app.getWindowManager().getDriversListInternalFrame();↵
|
47 | tw.moveToFront();↵ | | 39 | tw.moveToFront();↵
|
48 | try↵ | | 40 | try↵
|
49 | {↵ | | 41 | {↵
|
50 | tw.setSelected(true);↵ | | 42 | tw.setSelected(true);↵
|
51 | }↵ | | 43 | }↵
|
52 | catch (PropertyVetoException ex)↵ | | 44 | catch (PropertyVetoException ex)↵
|
53 | {↵ | | 45 | {↵
|
54 | //i18n[CopyDriverAction.error.selectingwindow=Error selecting window]↵ | | 46 | //i18n[CreateDriverAction.error.selectingwindow=Error selecting window]↵
|
55 | s_log.error(s_stringMgr.getString("CopyDriverAction.error.selectingwindow"), ex);↵ | | 47 | s_log.error(s_stringMgr.getString("CreateDriverAction.error.selectingwindow"), ex);↵
|
56 | }↵ | | 48 | }↵
|
57 | ↵ | | 49 | ↵
|
58 | ISQLDriver driver = _drivers.getSelectedDriver();↵ | | 50 | ISQLDriver driver = _drivers.getSelectedDriver();↵
|
59 | if (driver != null)↵ | | 51 | if (driver != null)↵
|
60 | {↵ | | |
|
61 | new CopyDriver↵ | | 52 | {↵
|
62 | Command(app, driver).execute() | | 53 | new ShowDriverWebsiteCommand(app, driver).execute()
|