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.RelationalEntityTableReferenceColumnPropertiesDialog;
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.RelationalEntityTableReferenceColumn;
25: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.domainimplementationmodel.RelationalEntityTableReferenceColumnClass;
26:
27: /* RelationalEntityTableReferenceColumn user object */
28:
29: public class RelationalEntityTableReferenceColumnUserObject extends
30: BaseUserObject {
31: private RelationalEntityTableReferenceColumn mRelationalEntityTableReferenceColumn = null;
32:
33: public RelationalEntityTableReferenceColumnUserObject(
34: RelationalEntityTableReferenceColumn pRelationalEntityTableReferenceColumn) {
35: super (pRelationalEntityTableReferenceColumn,
36: Application.FIELDS_ICON);
37: mRelationalEntityTableReferenceColumn = pRelationalEntityTableReferenceColumn;
38: }
39:
40: public RelationalEntityTableReferenceColumnUserObject(
41: RelationalEntityTableReferenceColumn pRelationalEntityTableReferenceColumn,
42: String pCaption, int pMode) {
43: super (pRelationalEntityTableReferenceColumn, pCaption, pMode);
44: mRelationalEntityTableReferenceColumn = pRelationalEntityTableReferenceColumn;
45: }
46:
47: public BaseUserObject createNewObject(MetaBossModelPackage pPackage) {
48: RelationalEntityTableReferenceColumnClass lClass = pPackage
49: .getEnterpriseModel().getSystemImplementationModel()
50: .getDomainImplementationModel()
51: .getRelationalEntityTableReferenceColumn();
52: return new RelationalEntityTableReferenceColumnUserObject(
53: lClass.createRelationalEntityTableReferenceColumn());
54: }
55:
56: public static void addNewReferenceColumn(
57: RelationalEntityTable pEntityTable) throws Exception {
58: new RelationalEntityTableReferenceColumnUserObject(null)
59: .addNewObject(getObjectPackage(pEntityTable),
60: pEntityTable.getReferenceColumns());
61: }
62:
63: // return object root node captions
64: public String getRootNodeName() {
65: return Application.getString("referencecolumns_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: || mRelationalEntityTableReferenceColumn == null)
74: return;
75:
76: addModelElement(pModel, "Association Role",
77: mRelationalEntityTableReferenceColumn
78: .getAssociationRole());
79: pModel.AddProperty("Column Name Override",
80: mRelationalEntityTableReferenceColumn
81: .getColumnNameOverride());
82: pModel.AddProperty("Column Name Suggestion",
83: mRelationalEntityTableReferenceColumn
84: .getColumnNameSuggestion());
85: pModel.AddProperty("Referential Constraint Name Override",
86: mRelationalEntityTableReferenceColumn
87: .getReferentialConstraintNameOverride());
88: pModel.AddProperty("Referential Constraint Name Suggestion",
89: mRelationalEntityTableReferenceColumn
90: .getReferentialConstraintNameSuggestion());
91: }
92:
93: public BasePropertiesDialog getObjectEditor() {
94: return new RelationalEntityTableReferenceColumnPropertiesDialog();
95: }
96: }
|