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.BasePropertiesDialog;
19: import com.metaboss.applications.designstudio.BaseUserObject;
20: import com.metaboss.applications.designstudio.propertiesdialogs.FieldPropertiesDialog;
21: import com.metaboss.applications.designstudio.propertiesview.PropertiesTableModel;
22: import com.metaboss.sdlctools.models.metabossmodel.MetaBossModelPackage;
23: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.ReportOutputElement;
24: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.ReportOutputField;
25: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.ReportOutputFieldClass;
26: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.SystemImplementationModelPackage;
27:
28: /* Report output field user object */
29:
30: public class ReportOutputFieldUserObject extends BaseUserObject {
31: ReportOutputField mField = null;
32:
33: public ReportOutputFieldUserObject(ReportOutputField pField) {
34: super (pField, Application.FIELDS_ICON);
35: mField = pField;
36: }
37:
38: // create new field
39: public static void addNewReportOutputField(
40: ReportOutputElement pOutputElement) throws Exception {
41: new ReportOutputFieldUserObject(null).addNewObject(
42: getObjectPackage(pOutputElement), pOutputElement
43: .getOutputFields());
44: }
45:
46: public BaseUserObject createNewObject(MetaBossModelPackage pPackage) {
47: SystemImplementationModelPackage lSystemImplementationModelPackage = pPackage
48: .getEnterpriseModel().getSystemImplementationModel();
49: ReportOutputFieldClass lClass = lSystemImplementationModelPackage
50: .getReportOutputField();
51: return new ReportOutputFieldUserObject(lClass
52: .createReportOutputField());
53: }
54:
55: public ReportOutputField getField() {
56: return mField;
57: }
58:
59: // return object root node captions
60: public String getRootNodeName() {
61: return Application.getString("outputfields_node");
62: }
63:
64: // load object properties into grid control
65: public void loadObjectProperties(PropertiesTableModel pModel)
66: throws Exception {
67: super .loadObjectProperties(pModel);
68: if (pModel == null || mField == null)
69: return;
70:
71: addModelElement(pModel, "DataType", mField.getDataType());
72: pModel.AddProperty("Array", boolToString(mField.isArray()));
73: }
74:
75: // get object editor
76: public BasePropertiesDialog getObjectEditor() {
77: return new FieldPropertiesDialog();
78: }
79: }
|