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.JComboBox;
20:
21: import com.metaboss.applications.designstudio.BasePropertiesDialog;
22: import com.metaboss.applications.designstudio.userobjects.AttributeItem;
23: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.Attribute;
24: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.Entity;
25: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.ReportOutputEntity;
26:
27: /* Report Entity Attribute Properties Dialog */
28:
29: public class ReportEntityAttributePropertiesDialog extends
30: BasePropertiesDialog {
31: private JComboBox mAttributeField = new JComboBox();
32:
33: public ReportEntityAttributePropertiesDialog() {
34: super ("Report Entity Attribute", true, new Dimension(400, 150));
35:
36: addComboBox("Attribute: ", mAttributeField, 1, false);
37: }
38:
39: // load entity properties
40: public void loadProperties(ReportOutputEntity pEntity)
41: throws Exception {
42: loadComboBoxes(pEntity.getEntity());
43: }
44:
45: // get primary key element
46: public Attribute getAttribute() {
47: Object lItem = mAttributeField.getSelectedItem();
48: if (lItem != null && lItem instanceof AttributeItem
49: && ((AttributeItem) lItem).mAttribute != null)
50: return ((AttributeItem) lItem).mAttribute;
51:
52: return null;
53: }
54:
55: private void loadComboBoxes(Entity pEntity) {
56: AttributeItem.loadBoxWithAttributes(mAttributeField, pEntity,
57: false);
58: }
59: }
|