Package com.nexirius.theteam.dataeditor

Source Code of com.nexirius.theteam.dataeditor.AddressEditor

package com.nexirius.theteam.dataeditor;

import com.nexirius.framework.dataviewer.ViewerFactory;
import com.nexirius.framework.datamodel.DataModel;
import com.nexirius.framework.gadgets.ArrayPanel;
import com.nexirius.framework.gadgets.ArrayLayout;
import com.nexirius.theteam.datamodel.AddressModel;

import javax.swing.*;

public class AddressEditor extends StandardStructEditor {
    protected AddressModel addressModel;

    public JComponent createJComponent(ViewerFactory factory) {
        ArrayPanel panel = new ArrayPanel(false, ArrayLayout.FULL_SIZE);

        panel.setOpaque(false);

        panel.add(createBanner(factory, "Address"));
        try {
            panel.add(createField(AddressModel.FIELD_STREET, factory, isEditor()));
            panel.add(createDualField(factory, isEditor(), "zipCity", AddressModel.FIELD_ZIP, AddressModel.FIELD_CITY, 30));
            panel.add(createField(AddressModel.FIELD_STATE, factory, isEditor()));
        } catch (Exception e) {
            e.printStackTrace();
        }

        return panel;
    }

    public void setDataModel(DataModel model) {
        addressModel = (AddressModel)model;
    }

    public DataModel getDataModel() {
        return addressModel;
    }
}
TOP

Related Classes of com.nexirius.theteam.dataeditor.AddressEditor

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.