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.RelationalEntityTableAttributeColumnPropertiesDialog;
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.domainimplementationmodel.RelationalEntityTable;
24: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.domainimplementationmodel.RelationalEntityTableAttributeColumn;
25: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.domainimplementationmodel.RelationalEntityTableAttributeColumnClass;
26:
27: /* RelationalEntityTableAttributeColumn user object */
28:
29: public class RelationalEntityTableAttributeColumnUserObject extends
30: BaseUserObject {
31: private RelationalEntityTableAttributeColumn mRelationalEntityTableAttributeColumn = null;
32:
33: public RelationalEntityTableAttributeColumnUserObject(
34: RelationalEntityTableAttributeColumn pRelationalEntityTableAttributeColumn) {
35: super (pRelationalEntityTableAttributeColumn,
36: Application.ATTRIBUTECOLUMN_ICON);
37: mRelationalEntityTableAttributeColumn = pRelationalEntityTableAttributeColumn;
38: }
39:
40: public RelationalEntityTableAttributeColumnUserObject(
41: RelationalEntityTableAttributeColumn pRelationalEntityTableAttributeColumn,
42: String pCaption, int pMode) {
43: super (pRelationalEntityTableAttributeColumn, pCaption, pMode);
44: mRelationalEntityTableAttributeColumn = pRelationalEntityTableAttributeColumn;
45: }
46:
47: public BaseUserObject createNewObject(MetaBossModelPackage pPackage) {
48: RelationalEntityTableAttributeColumnClass lClass = pPackage
49: .getEnterpriseModel().getSystemImplementationModel()
50: .getDomainImplementationModel()
51: .getRelationalEntityTableAttributeColumn();
52: return new RelationalEntityTableAttributeColumnUserObject(
53: lClass.createRelationalEntityTableAttributeColumn());
54: }
55:
56: public static void addNewAttributeColumn(
57: RelationalEntityTable pEntityTable) throws Exception {
58: new RelationalEntityTableAttributeColumnUserObject(null)
59: .addNewObject(getObjectPackage(pEntityTable),
60: pEntityTable.getAttributeColumns());
61: }
62:
63: // return object root node captions
64: public String getRootNodeName() {
65: return Application.getString("attributecolumns_node");
66: }
67:
68: // load object properties into grid control
69: public void loadObjectProperties(PropertiesTableModel pModel)
70: throws Exception {
71: super .loadObjectProperties(pModel);
72: if (pModel == null
73: || mRelationalEntityTableAttributeColumn == null)
74: return;
75:
76: addModelElement(pModel, "Attribute",
77: mRelationalEntityTableAttributeColumn.getAttribute());
78: pModel.AddProperty("Column Name Override",
79: mRelationalEntityTableAttributeColumn
80: .getColumnNameOverride());
81: pModel.AddProperty("Column Name Suggestion",
82: mRelationalEntityTableAttributeColumn
83: .getColumnNameSuggestion());
84: pModel.AddProperty("Referential Constraint Name Override",
85: mRelationalEntityTableAttributeColumn
86: .getReferentialConstraintNameOverride());
87: pModel.AddProperty("Referential Constraint Name Suggestion",
88: mRelationalEntityTableAttributeColumn
89: .getReferentialConstraintNameSuggestion());
90: pModel.AddProperty("Has Referential Constraint",
91: boolToString(mRelationalEntityTableAttributeColumn
92: .isHasReferentialConstraint()));
93: }
94:
95: public BasePropertiesDialog getObjectEditor() {
96: return new RelationalEntityTableAttributeColumnPropertiesDialog();
97: }
98: }
|