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.SimpleObjectPropertiesdialog;
21: import com.metaboss.applications.designstudio.propertiesview.PropertiesTableModel;
22: import com.metaboss.sdlctools.models.metabossmodel.MetaBossModelPackage;
23: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.Service;
24: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.ServiceImplementation;
25: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.ServiceImplementationClass;
26: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.SystemImplementationModelPackage;
27:
28: /* BOServiceimplementation user object class */
29:
30: public class ServiceImplementationUserObject extends BaseUserObject {
31: private ServiceImplementation mImplementation = null;
32:
33: public ServiceImplementationUserObject(
34: ServiceImplementation pImplementation) {
35: super (pImplementation, Application.SERVICEIMPL_ICON);
36: mImplementation = pImplementation;
37: }
38:
39: // create new service module
40: public static void addNewServiceImplementation(Service pService)
41: throws Exception {
42: new ServiceImplementationUserObject(null).addNewObject(
43: getObjectPackage(pService), pService
44: .getImplementations());
45: }
46:
47: public BaseUserObject createNewObject(MetaBossModelPackage pPackage) {
48: SystemImplementationModelPackage lPackage = pPackage
49: .getEnterpriseModel().getSystemImplementationModel();
50: ServiceImplementationClass lClass = lPackage
51: .getServiceImplementation();
52: return new ServiceImplementationUserObject(lClass
53: .createServiceImplementation());
54: }
55:
56: public ServiceImplementation getServiceImplementation() {
57: return mImplementation;
58: }
59:
60: // return object root node captions
61: public String getRootNodeName() {
62: return Application.getString("implementations_node");
63: }
64:
65: // load object properties into grid control
66: public void loadObjectProperties(PropertiesTableModel pModel)
67: throws Exception {
68: super .loadObjectProperties(pModel);
69: if (pModel == null || mImplementation == null)
70: return;
71:
72: /*try
73: {
74: ZipArchive lArchive = mImplementation.getSource();
75: pModel.AddProperty("Source", (lArchive!=null) ? lArchive.getName() : "");
76: }
77: catch (Exception e)
78: {
79: //???e.printStackTrace();
80: }*/
81: }
82:
83: // get object editor
84: public BasePropertiesDialog getObjectEditor() {
85: return new SimpleObjectPropertiesdialog(
86: "Service Implementation");
87: }
88: }
|