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.propertiesdialogs;
16:
17: import java.awt.Dimension;
18:
19: import javax.swing.JTextArea;
20: import javax.swing.JTextField;
21:
22: import com.metaboss.sdlctools.models.metabossmodel.ModelElement;
23: import com.metaboss.sdlctools.models.metabossmodel.technologylibrarymodel.StorageTechnology;
24:
25: /* Storage Technology properties dialog */
26:
27: public class StorageTechnologyPropertiesDialog extends
28: ModelElementPropertiesDialog {
29: private JTextField mNameField = new JTextField();
30: private JTextField mImplementationGeneratorPackageField = new JTextField();
31: private JTextField mMetadataGeneratorPackage = new JTextField();
32: private JTextArea mDescriptionField = new JTextArea(8, 40);
33:
34: public StorageTechnologyPropertiesDialog() {
35: super ("Storage Technology", new Dimension(440, 320));
36:
37: addTextField(mPropertiesPanel, "Name: ", mNameField, 1, true);
38: addTextField(mPropertiesPanel,
39: "Implementation Generator Package: ",
40: mImplementationGeneratorPackageField, 2, false);
41: addTextField(mPropertiesPanel, "Metadata Generator Package: ",
42: mMetadataGeneratorPackage, 3, false);
43: addTextArea(mPropertiesPanel, "Description: ",
44: mDescriptionField, 4, false);
45: }
46:
47: // load datatype properties
48: public void loadProperties(ModelElement pObject) throws Exception {
49: if (pObject != null && pObject instanceof StorageTechnology) {
50: StorageTechnology lStorageTechnology = (StorageTechnology) pObject;
51:
52: mNameField.setText(lStorageTechnology.getName());
53: mImplementationGeneratorPackageField
54: .setText(lStorageTechnology
55: .getImplementationGeneratorPackage());
56: mMetadataGeneratorPackage.setText(lStorageTechnology
57: .getMetadataGeneratorPackage());
58: mDescriptionField.setText(lStorageTechnology
59: .getDescription());
60: }
61: super .loadProperties(pObject);
62: }
63:
64: // save datatype proeprties
65: public void saveProperties(ModelElement pObject) throws Exception {
66: super .saveProperties(pObject);
67: if (pObject != null && pObject instanceof StorageTechnology) {
68: StorageTechnology lStorageTechnology = (StorageTechnology) pObject;
69:
70: lStorageTechnology.setName(mNameField.getText());
71: lStorageTechnology
72: .setImplementationGeneratorPackage(mImplementationGeneratorPackageField
73: .getText());
74: lStorageTechnology
75: .setMetadataGeneratorPackage(mMetadataGeneratorPackage
76: .getText());
77: lStorageTechnology.setDescription(mDescriptionField
78: .getText());
79: }
80: }
81: }
|