diff options
author | Armen Kesablyan | 2012-06-20 15:04:25 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-06-20 15:04:25 -0700 |
commit | fc818d31de267d2b77fda3b3029ad38d48698be8 (patch) | |
tree | 122ebf54d3378578c1ded4d786ba3940d4a911d2 /node_modules/montage/data/operation.js | |
parent | 120e31dcf1e11eed11ee430d77c438e7b073e9f8 (diff) | |
parent | c9852665eadc1acb9c1c881d207c4bd9ef88805f (diff) | |
download | ninja-fc818d31de267d2b77fda3b3029ad38d48698be8.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal
Diffstat (limited to 'node_modules/montage/data/operation.js')
-rw-r--r-- | node_modules/montage/data/operation.js | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/node_modules/montage/data/operation.js b/node_modules/montage/data/operation.js new file mode 100644 index 00000000..a3946ede --- /dev/null +++ b/node_modules/montage/data/operation.js | |||
@@ -0,0 +1,121 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | /** | ||
7 | @module montage/data/operation | ||
8 | @requires montage/core/core | ||
9 | @requires montage/core/logger | ||
10 | */ | ||
11 | var Montage = require("montage/core").Montage; | ||
12 | var logger = require("montage/logger").logger("operation"); | ||
13 | |||
14 | /** | ||
15 | Handle top the operation manager. The manager is created automatically if not set by the application. | ||
16 | @private | ||
17 | */ | ||
18 | var _operationManager = null; | ||
19 | /** | ||
20 | @class module:montage/data/operation.Operation | ||
21 | @extends module:montage/core/core.Montage | ||
22 | */ | ||
23 | var Operation = exports.Operation = Montage.create(Montage, /** @lends module:montage/data/operation.Operation# */ { | ||
24 | |||
25 | init:{ | ||
26 | value:function () { | ||
27 | return this; | ||
28 | } | ||
29 | }, | ||
30 | |||
31 | manager:{ | ||
32 | get:function () { | ||
33 | if (_operationManager === null) { | ||
34 | _operationManager = OperationManager.create().init(); | ||
35 | } | ||
36 | return _operationManager; | ||
37 | }, | ||
38 | set:function (manager) { | ||
39 | _operationManager = manager; | ||
40 | } | ||
41 | } | ||
42 | |||
43 | }); | ||
44 | |||
45 | /** | ||
46 | @class module:montage/data/operation.OperationManager | ||
47 | @extends module:montage/core/core.Montage | ||
48 | */ | ||
49 | var OperationManager = exports.OperationManager = Montage.create(Montage, /** @lends module:montage/data/operation.OperationManager# */ { | ||
50 | |||
51 | init:{ | ||
52 | value:function () { | ||
53 | return this; | ||
54 | } | ||
55 | }, | ||
56 | |||
57 | createNoopOperation:{ | ||
58 | value:function () { | ||
59 | if (_noopOperation === null) { | ||
60 | _noopOperation = NoopOperation.create().init(); | ||
61 | } | ||
62 | return _noopOperation; | ||
63 | } | ||
64 | }, | ||
65 | |||
66 | createInsertOperation:{ | ||
67 | value:function () { | ||
68 | return InsertOperation.create().init(); | ||
69 | } | ||
70 | }, | ||
71 | |||
72 | createDeleteOperation:{ | ||
73 | value:function () { | ||
74 | return DeleteOperation.create().init(); | ||
75 | } | ||
76 | }, | ||
77 | |||
78 | createChangeOperation:{ | ||
79 | value:function () { | ||
80 | return ChangeOperation.create().init(); | ||
81 | } | ||
82 | } | ||
83 | |||
84 | }); | ||
85 | |||
86 | var _noopOperation = null; | ||
87 | /** | ||
88 | @class module:montage/data/operation.NoopOperation | ||
89 | @extends module:montage/core/core.Operation | ||
90 | */ | ||
91 | var NoopOperation = exports.NoopOperation = Montage.create(Operation, /** @lends module:montage/data/operation.NoopOperation# */ { | ||
92 | |||
93 | |||
94 | }); | ||
95 | |||
96 | /** | ||
97 | @class module:montage/data/operation.InsertOperation | ||
98 | @extends module:montage/core/core.Operation | ||
99 | */ | ||
100 | var InsertOperation = exports.InsertOperation = Montage.create(Operation, /** @lends module:montage/data/operation.InsertOperation# */ { | ||
101 | |||
102 | |||
103 | }); | ||
104 | |||
105 | /** | ||
106 | @class module:montage/data/operation.DeleteOperation | ||
107 | @extends module:montage/core/core.Operation | ||
108 | */ | ||
109 | var DeleteOperation = exports.DeleteOperation = Montage.create(Operation, /** @lends module:montage/data/operation.DeleteOperation# */ { | ||
110 | |||
111 | |||
112 | }); | ||
113 | |||
114 | /** | ||
115 | @class module:montage/data/operation.ChangeOperation | ||
116 | @extends module:montage/core/core.Operation | ||
117 | */ | ||
118 | var ChangeOperation = exports.ChangeOperation = Montage.create(Operation, /** @lends module:montage/data/operation.ChangeOperation# */ { | ||
119 | |||
120 | |||
121 | }); | ||