1 | public class CopyQualifiedObjectNameAction↵ | | 1 | public class CopySimpleObjectNameAction↵
|
2 | extends SquirrelAction↵ | | 2 | extends SquirrelAction↵
|
3 | implements IObjectTreeAction, CopyObjectNameCommand.ICopyTypes↵ | | 3 | implements IObjectTreeAction, CopyObjectNameCommand.ICopyTypes↵
|
4 | {↵ | | 4 | {↵
|
5 | /** Logger for this class. */↵ | | 5 | /** Logger for this class. */↵
|
6 | private final static ILogger s_log =↵ | | 6 | private final static ILogger s_log =↵
|
7 | LoggerController.createLogger(CopyQualifiedObjectNameAction.class);↵ | | 7 | LoggerController.createLogger(CopySimpleObjectNameAction.class);↵
|
|
8 | /** API for the current tree. */↵ | | 8 | /** API for the current tree. */↵
|
9 | private IObjectTreeAPI _tree;↵ | | 9 | private IObjectTreeAPI _tree;↵
|
|
10 | /**↵ | | 10 | /**↵
|
11 | * Ctor.↵ | | 11 | * Ctor.↵
|
12 | *↵ | | 12 | *↵
|
13 | * @param app Application API.↵ | | 13 | * @param app Application API.↵
|
14 | */↵ | | 14 | */↵
|
15 | public CopyQualifiedObjectNameAction(IApplication app)↵ | | 15 | public CopySimpleObjectNameAction(IApplication app)↵
|
16 | {↵ | | 16 | {↵
|
17 | super(app);↵ | | 17 | super(app);↵
|
18 | }↵ | | 18 | }↵
|
|
19 | /**↵ | | 19 | /**↵
|
20 | * Set the current object tree API.↵ | | 20 | * Set the current object tree API.↵
|
21 | *↵ | | 21 | *↵
|
22 | * @param tree Current ObjectTree↵ | | 22 | * @param tree Current ObjectTree↵
|
23 | */↵ | | 23 | */↵
|
24 | public void setObjectTree(IObjectTreeAPI tree)↵ | | 24 | public void setObjectTree(IObjectTreeAPI tree)↵
|
25 | {↵ | | 25 | {↵
|
26 | _tree = tree;↵ | | 26 | _tree = tree;↵
|
27 | setEnabled(null != _tree);↵ | | 27 | setEnabled(null != _tree);↵
|
28 | }↵ | | 28 | }↵
|
|
29 | /**↵ | | 29 | /**↵
|
30 | * Perform this action. Use the <TT>CopyObjectNameCommand</TT>.↵ | | 30 | * Perform this action. Use the <TT>CopyObjectNameCommand</TT>.↵
|
31 | *↵ | | 31 | *↵
|
32 | * @param evt The current event.↵ | | 32 | * @param evt The current event.↵
|
33 | */↵ | | 33 | */↵
|
34 | public void actionPerformed(ActionEvent evt)↵ | | 34 | public void actionPerformed(ActionEvent evt)↵
|
35 | {↵ | | 35 | {↵
|
36 | if (_tree != null)↵ | | 36 | if (_tree != null)↵
|
37 | {↵ | | 37 | {↵
|
38 | try↵ | | 38 | try↵
|
39 | {↵ | | 39 | {↵
|
40 | new CopyObjectNameCommand(_tree, QUALIFIED_NAME).execute();↵ | | 40 | new CopyObjectNameCommand(_tree, SIMPLE_NAME).execute();↵
|
41 | }↵ | | 41 | }↵
|
42 | catch (Throwable ex)↵ | | 42 | catch (Throwable ex)↵
|
43 | {↵ | | 43 | {↵
|
44 | final String msg = "Error occured copying object names";↵ | | 44 | final String msg = "Error occured copying object names";↵
|
45 | _tree.getSession().showErrorMessage(msg + ": " + ex);↵ | | 45 | _tree.getSession().showErrorMessage(msg + ": " + ex);↵
|
46 | s_log.error(msg, ex);↵ | | 46 | s_log.error(msg, ex);↵
|
47 | | | 47 |
|