Examples of CFJTabbedPane


Examples of com.nexirius.framework.swing.CFJTabbedPane

public class MemberEditor extends StandardStructEditor {
    protected MemberModel memberModel;

    public JComponent createJComponent(ViewerFactory factory) {
        ClientResource cr = factory.getClientResource();
        CFJTabbedPane tabbedPane = new CFJTabbedPane(cr);

        try {
            JPanel personPanel = new ArrayPanel(false, ArrayLayout.FULL_SIZE);

            JComponent personEditor = factory.createDefaultEditor(memberModel.getPerson()).getJComponent();
            personPanel.add(personEditor);
            personPanel.add(createFieldEditor(MemberModel.FIELD_TYPE, factory));
            tabbedPane.addTab(PersonModel.FIELD_PERSON, createTabComponent(personPanel));
            DataModel addressList = memberModel.getChild(AddressListModel.FIELD_ADDRESS_LIST);
            tabbedPane.addTab(AddressListModel.FIELD_ADDRESS_LIST, createTabComponent(factory.createDefaultEditor(addressList).getJComponent()));
            DataModel phoneList = memberModel.getChild(PhoneListModel.FIELD_PHONE_LIST);
            tabbedPane.addTab(PhoneListModel.FIELD_PHONE_LIST, createTabComponent(factory.createDefaultEditor(phoneList).getJComponent()));
        } catch (Exception e) {
            e.printStackTrace();
        }

        tabbedPane.setPreferredSize(new Dimension(450, 300));

        return tabbedPane;
    }
View Full Code Here

Examples of com.nexirius.framework.swing.CFJTabbedPane

        try {
            DataModel parent_model = parent_viewer.getDataModel();
            // look for the associated model
            Viewable model = parent_model.getViewableChild(getModelFieldName());
            DataViewer viewer = null;
            CFJTabbedPane tabbedPane = (CFJTabbedPane) parent_viewer.getJComponent();

            if (viewerCreator == null) {
                viewer = parent_viewer.getFactory().createViewer(model, parent_viewer.isEditor());
            } else {
                viewer = parent_viewer.getFactory().createViewer(viewerCreator, model);
            }

            // layout the associated model

            viewer.setLayout(layout);

            // create a JComponent from the associated viewer
            JComponent comp = viewer.getJComponent();

            int tabIndex = tabbedPane.indexOfTab(tabLabel);

            if (tabIndex < 0) {
                // have to create a new tab
                tabbedPane.addTab(tabLabel, tabIcon, comp);
                tabIndex = tabbedPane.getTabCount() - 1;

                if (model instanceof DataModel) {
                    DataModel dataModel = (DataModel) model;

                    tabModelListeners.add(new TabModelListener(tabbedPane, tabIndex, dataModel));
View Full Code Here

Examples of com.nexirius.framework.swing.CFJTabbedPane

    public void create() {
        if (this.factory == null) {
            throw new RuntimeException("Can't create a TabbedViewer with null factory (call setFactory())");
        }

        setJComponent(new CFJTabbedPane(getFactory().getClientResource()));

        update();
    }
View Full Code Here
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.