aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/data/operation.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/montage/data/operation.js')
-rw-r--r--node_modules/montage/data/operation.js121
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 */
11var Montage = require("montage/core").Montage;
12var 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 */
18var _operationManager = null;
19/**
20 @class module:montage/data/operation.Operation
21 @extends module:montage/core/core.Montage
22 */
23var 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 */
49var 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
86var _noopOperation = null;
87/**
88 @class module:montage/data/operation.NoopOperation
89 @extends module:montage/core/core.Operation
90 */
91var 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 */
100var 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 */
109var 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 */
118var ChangeOperation = exports.ChangeOperation = Montage.create(Operation, /** @lends module:montage/data/operation.ChangeOperation# */ {
119
120
121});