1 | public class CommitCommand implements ICommand↵ | | 1 | public class RefreshObjectTreeItemCommand implements ICommand
↵
|
2 | {↵ | | 2 | {
↵
|
3 | /** Current session. */↵ | | 3 | /** The object tree that is to be refreshed. */
↵
|
4 | private ISession _session;↵ | | 4 | private ↵
|
| | | 5 | final IObjectTreeAPI _tree;↵
|
| | | 6 |
↵
|
5 | /**↵ | | 7 | /**
↵
|
6 | * Ctor.↵ | | 8 | * Ctor.
↵
|
7 | *↵ | | 9 | *
↵
|
8 | * @param session Current session.↵ | | 10 | * @param tree The object tree to be refreshed.
↵
|
9 | *↵ | | 11 | *
↵
|
10 | * @throws IllegalArgumentException↵ | | 12 | * @throws IllegalArgumentException
↵
|
11 | * Thrown if a <TT>null</TT> <TT>ISession</TT> passed.↵ | | 13 | * Thrown if a <TT>null</TT> <TT>IObjectTreeAPI</TT> passed.
↵
|
12 | */↵ | | 14 | */
↵
|
13 | public CommitCommand(ISession session)↵ | | 15 | public RefreshObjectTreeItemCommand(IObjectTreeAPI tree)
↵
|
14 | {↵ | | 16 | {
↵
|
15 | super();↵ | | 17 | super();
↵
|
16 | if (session == null)↵ | | 18 | if (tree == null)
↵
|
17 | {↵ | | 19 | {
↵
|
18 | throw new IllegalArgumentException("Null ISession passed");↵ | | 20 | throw new IllegalArgumentException("IObjectTreeAPI == null");
↵
|
19 | }↵ | | 21 | }
↵
|
20 | _session = session;↵ | | 22 | _↵
|
21 | }↵ | | |
|
| | | 23 | tree = tree;↵
|
| | | 24 | }↵
|
| | | 25 |
↵
|
22 | /**↵ | | 26 | /**
↵
|
23 | * Commit the transaction.↵ | | 27 | * Refresh tree.
↵
|
24 | */↵ | | 28 | */
↵
|
25 | public void execute()↵ | | 29 | public void execute()
↵
|
26 | {↵ | | 30 | {
↵
|
27 | _session.commit() | | 31 | _tree.refreshSelectedNodes()
|