01: // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
02: // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
03: // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
04: // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
05: // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
06: // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
07: // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
08: // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
09: // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
10: // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
11: // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
12: // POSSIBILITY OF SUCH DAMAGE.
13: //
14: // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
15: package com.metaboss.applications.designstudio.userobjects;
16:
17: import com.metaboss.applications.designstudio.Application;
18: import com.metaboss.applications.designstudio.BaseUserObject;
19: import com.metaboss.sdlctools.models.metabossmodel.MetaBossModelPackage;
20: import com.metaboss.sdlctools.models.metabossmodel.ModelElement;
21: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.AbstractOperation;
22: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.EnterpriseModelPackage;
23: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.OperationOutputField;
24: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.OperationOutputFieldClass;
25:
26: /* Operation Output Field user object */
27:
28: public class OperationOutputFieldUserObject extends
29: AbstractDataFieldUserObject {
30: OperationOutputField mField = null;
31:
32: public OperationOutputFieldUserObject(OperationOutputField pField) {
33: super (pField);
34: mField = pField;
35: }
36:
37: // create new service module
38: public static void addNewOperationOutputField(
39: AbstractOperation pOperation) throws Exception {
40: new OperationOutputFieldUserObject(null).addNewObject(
41: getObjectPackage(pOperation), pOperation
42: .getOutputFields());
43: }
44:
45: public BaseUserObject createNewObject(MetaBossModelPackage pPackage) {
46: EnterpriseModelPackage lEnterpriseModelPackage = pPackage
47: .getEnterpriseModel();
48: OperationOutputFieldClass lClass = lEnterpriseModelPackage
49: .getOperationOutputField();
50: OperationOutputField lOperationOutputField = lClass
51: .createOperationOutputField();
52: lOperationOutputField.setArray(false);
53: return new OperationOutputFieldUserObject(lOperationOutputField);
54: }
55:
56: public OperationOutputField getField() {
57: return mField;
58: }
59:
60: // return object root node captions
61: public String getRootNodeName() {
62: return Application.getString("outputfields_node");
63: }
64:
65: // return master collection
66: protected ModelCollectionInfo extractMasterCollection() {
67: ModelCollectionInfo lResult = new ModelCollectionInfo(null,
68: null);
69: if (mField != null) {
70: AbstractOperation lOperation = mField.getOperation();
71: if (lOperation != null) {
72: lResult.mCollection = lOperation.getOutputFields();
73: lResult.mElement = lOperation;
74: }
75: }
76: return lResult;
77: }
78:
79: // duplicate model element
80: public ModelElement duplicate() throws Exception {
81: OperationOutputField lField = (OperationOutputField) Application.sModelRepository
82: .duplicateModelElement(mField);
83: lField.setOperation(mField.getOperation());
84: return lField;
85: }
86: }
|