diff options
author | Kruti Shah | 2012-06-20 15:12:48 -0700 |
---|---|---|
committer | Kruti Shah | 2012-06-20 15:12:48 -0700 |
commit | 1fe1202ba87d6de9b0f0d8efee78f955c5350210 (patch) | |
tree | 26ff4c6c5a94accfd5801f124244d3eef152a5c7 /node_modules/montage/data/operation.js | |
parent | 1ce4bd7033a413c7697888e5712f278219d6d095 (diff) | |
parent | 782b66c783df4a9c36fa240cc77900e69b9130cf (diff) | |
download | ninja-1fe1202ba87d6de9b0f0d8efee78f955c5350210.tar.gz |
Merge branch 'refs/heads/TimelineUberJD' into Timeline-local-kruti
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 | }); | ||