// THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
// CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
// BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
// OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
// EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// Copyright 2000-2005 Softaris Pty.Ltd. All Rights Reserved.
package com.metaboss.applications.designstudio.propertiesdialogs;
import java.awt.Dimension;
import javax.swing.JComboBox;
import com.metaboss.applications.designstudio.BasePropertiesDialog;
import com.metaboss.applications.designstudio.userobjects.AttributeItem;
import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.Attribute;
import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.Entity;
import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.ReportOutputEntity;
/* Report Entity Attribute Properties Dialog */
public class ReportEntityAttributePropertiesDialog extends BasePropertiesDialog
{
private JComboBox mAttributeField = new JComboBox();
public ReportEntityAttributePropertiesDialog()
{
super("Report Entity Attribute", true, new Dimension(400, 150));
addComboBox("Attribute: ", mAttributeField, 1, false);
}
// load entity properties
public void loadProperties(ReportOutputEntity pEntity) throws Exception
{
loadComboBoxes(pEntity.getEntity());
}
// get primary key element
public Attribute getAttribute()
{
Object lItem = mAttributeField.getSelectedItem();
if (lItem!=null && lItem instanceof AttributeItem &&
((AttributeItem)lItem).mAttribute!=null)
return ((AttributeItem)lItem).mAttribute;
return null;
}
private void loadComboBoxes(Entity pEntity)
{
AttributeItem.loadBoxWithAttributes(mAttributeField, pEntity, false);
}
}
|