Search in sources :

Example 1 with RectShape

use of com.servoy.j2db.persistence.RectShape in project servoy-client by Servoy.

the class ComponentFactory method createComponentEx.

protected static IComponent createComponentEx(IApplication application, Form form, IPersist meta, IDataProviderLookup dataProviderLookup, IScriptExecuter el, boolean printing) {
    IComponent comp = null;
    switch(meta.getTypeID()) {
        case IRepository.FIELDS:
            comp = createField(application, form, (Field) meta, dataProviderLookup, el, printing);
            break;
        case IRepository.GRAPHICALCOMPONENTS:
            comp = createGraphicalComponent(application, form, (GraphicalComponent) meta, el, dataProviderLookup);
            break;
        case IRepository.RECTSHAPES:
            comp = createRectangle(application, form, (RectShape) meta);
            break;
        case IRepository.PORTALS:
            comp = createPortal(application, form, (Portal) meta, dataProviderLookup, el, printing);
            break;
        case IRepository.PARTS:
            comp = createPart(application, (Part) meta);
            break;
        case IRepository.TABPANELS:
            TabPanel tabPanelMeta = (TabPanel) meta;
            int orient = tabPanelMeta.getTabOrientation();
            if (orient == TabPanel.SPLIT_HORIZONTAL || orient == TabPanel.SPLIT_VERTICAL)
                comp = createSplitPane(application, form, tabPanelMeta, el);
            else
                comp = createTabPanel(application, form, tabPanelMeta, el);
            break;
        case IRepository.BEANS:
            comp = createBean(application, form, (Bean) meta, null);
            break;
        case IRepository.WEBCOMPONENTS:
            comp = createWebComponentPlaceholder(application, form, (WebComponent) meta);
            break;
        default:
            Debug.error("ComponentFactory:unkown type " + meta.getTypeID() + ", uuid: " + meta.getUUID() + ", parent:" + meta.getParent());
            IStandardLabel label = application.getItemFactory().createLabel(getWebID(form, meta), "ComponentFactory:unkown type " + meta.getTypeID());
            label.setSize(new Dimension(200, 20));
            comp = label;
    }
    if (comp instanceof JComponent) {
        ((JComponent) comp).putClientProperty("Id", ComponentFactory.getWebID(form, meta));
    }
    return comp;
}
Also used : ITabPanel(com.servoy.j2db.ui.ITabPanel) TabPanel(com.servoy.j2db.persistence.TabPanel) RuntimeTabPanel(com.servoy.j2db.ui.scripting.RuntimeTabPanel) RectShape(com.servoy.j2db.persistence.RectShape) IComponent(com.servoy.j2db.ui.IComponent) GraphicalComponent(com.servoy.j2db.persistence.GraphicalComponent) JComponent(javax.swing.JComponent) Dimension(java.awt.Dimension) IStandardLabel(com.servoy.j2db.ui.IStandardLabel) IServoyAwareBean(com.servoy.j2db.dataui.IServoyAwareBean) Bean(com.servoy.j2db.persistence.Bean) RuntimeMediaField(com.servoy.j2db.ui.scripting.RuntimeMediaField) RuntimeDataLookupField(com.servoy.j2db.ui.scripting.RuntimeDataLookupField) Field(com.servoy.j2db.persistence.Field) RuntimeDataField(com.servoy.j2db.ui.scripting.RuntimeDataField) AbstractRuntimeField(com.servoy.j2db.ui.scripting.AbstractRuntimeField) WebComponent(com.servoy.j2db.persistence.WebComponent) Part(com.servoy.j2db.persistence.Part) Portal(com.servoy.j2db.persistence.Portal) RuntimePortal(com.servoy.j2db.ui.scripting.RuntimePortal)

Aggregations

IServoyAwareBean (com.servoy.j2db.dataui.IServoyAwareBean)1 Bean (com.servoy.j2db.persistence.Bean)1 Field (com.servoy.j2db.persistence.Field)1 GraphicalComponent (com.servoy.j2db.persistence.GraphicalComponent)1 Part (com.servoy.j2db.persistence.Part)1 Portal (com.servoy.j2db.persistence.Portal)1 RectShape (com.servoy.j2db.persistence.RectShape)1 TabPanel (com.servoy.j2db.persistence.TabPanel)1 WebComponent (com.servoy.j2db.persistence.WebComponent)1 IComponent (com.servoy.j2db.ui.IComponent)1 IStandardLabel (com.servoy.j2db.ui.IStandardLabel)1 ITabPanel (com.servoy.j2db.ui.ITabPanel)1 AbstractRuntimeField (com.servoy.j2db.ui.scripting.AbstractRuntimeField)1 RuntimeDataField (com.servoy.j2db.ui.scripting.RuntimeDataField)1 RuntimeDataLookupField (com.servoy.j2db.ui.scripting.RuntimeDataLookupField)1 RuntimeMediaField (com.servoy.j2db.ui.scripting.RuntimeMediaField)1 RuntimePortal (com.servoy.j2db.ui.scripting.RuntimePortal)1 RuntimeTabPanel (com.servoy.j2db.ui.scripting.RuntimeTabPanel)1 Dimension (java.awt.Dimension)1 JComponent (javax.swing.JComponent)1