Search in sources :

Example 1 with EJDevItemRendererDefinitionControl

use of org.entirej.framework.dev.renderer.definition.EJDevItemRendererDefinitionControl in project rap by entirej.

the class EJRWTQueryScreenRendererDefinition method addQueryScreenControl.

@Override
public EJDevScreenRendererDefinitionControl addQueryScreenControl(EJDevBlockDisplayProperties blockDisplayProperties, Composite parent, FormToolkit formToolkit) {
    int height = blockDisplayProperties.getQueryScreenRendererProperties().getIntProperty(EJRWTScreenRendererDefinitionProperties.HEIGHT, 300);
    int width = blockDisplayProperties.getQueryScreenRendererProperties().getIntProperty(EJRWTScreenRendererDefinitionProperties.WIDTH, 300);
    int numcols = blockDisplayProperties.getQueryScreenRendererProperties().getIntProperty(EJRWTScreenRendererDefinitionProperties.NUM_COLS, 1);
    Composite screen = new Composite(parent, SWT.SHADOW_NONE);
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = numcols;
    gridLayout.horizontalSpacing = 0;
    gridLayout.verticalSpacing = 0;
    screen.setLayout(gridLayout);
    GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.verticalAlignment = SWT.FILL;
    gd.grabExcessVerticalSpace = true;
    gd.widthHint = width;
    gd.heightHint = height;
    screen.setLayoutData(gd);
    EJRWTScreenPreviewerCreator creator = new EJRWTScreenPreviewerCreator();
    List<EJDevItemRendererDefinitionControl> itemControls = creator.addQueryScreenPreviewControl(this, blockDisplayProperties, screen, formToolkit);
    return new EJDevScreenRendererDefinitionControl(blockDisplayProperties, itemControls);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) EJDevItemRendererDefinitionControl(org.entirej.framework.dev.renderer.definition.EJDevItemRendererDefinitionControl) GridData(org.eclipse.swt.layout.GridData) EJDevScreenRendererDefinitionControl(org.entirej.framework.dev.renderer.definition.EJDevScreenRendererDefinitionControl)

Example 2 with EJDevItemRendererDefinitionControl

use of org.entirej.framework.dev.renderer.definition.EJDevItemRendererDefinitionControl in project rap by entirej.

the class EJRWTInsertScreenRendererDefinition method addInsertScreenControl.

@Override
public EJDevScreenRendererDefinitionControl addInsertScreenControl(EJDevBlockDisplayProperties blockDisplayProperties, Composite parent, FormToolkit formToolkit) {
    int height = blockDisplayProperties.getInsertScreenRendererProperties().getIntProperty(EJRWTScreenRendererDefinitionProperties.HEIGHT, 300);
    int width = blockDisplayProperties.getInsertScreenRendererProperties().getIntProperty(EJRWTScreenRendererDefinitionProperties.WIDTH, 300);
    int numcols = blockDisplayProperties.getInsertScreenRendererProperties().getIntProperty(EJRWTScreenRendererDefinitionProperties.NUM_COLS, 1);
    Composite screen = new Composite(parent, SWT.SHADOW_NONE);
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = numcols;
    gridLayout.horizontalSpacing = 0;
    gridLayout.verticalSpacing = 0;
    screen.setLayout(gridLayout);
    GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.verticalAlignment = SWT.FILL;
    gd.grabExcessVerticalSpace = true;
    gd.widthHint = width;
    gd.heightHint = height;
    screen.setLayoutData(gd);
    EJRWTScreenPreviewerCreator creator = new EJRWTScreenPreviewerCreator();
    List<EJDevItemRendererDefinitionControl> itemControls = creator.addInsertScreenPreviewControl(this, blockDisplayProperties, screen, formToolkit);
    return new EJDevScreenRendererDefinitionControl(blockDisplayProperties, itemControls);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) EJDevItemRendererDefinitionControl(org.entirej.framework.dev.renderer.definition.EJDevItemRendererDefinitionControl) GridData(org.eclipse.swt.layout.GridData) EJDevScreenRendererDefinitionControl(org.entirej.framework.dev.renderer.definition.EJDevScreenRendererDefinitionControl)

Example 3 with EJDevItemRendererDefinitionControl

use of org.entirej.framework.dev.renderer.definition.EJDevItemRendererDefinitionControl in project rap by entirej.

the class EJRWTHtmlEditorItemRendererDefinition method getItemControl.

@Override
public EJDevItemRendererDefinitionControl getItemControl(EJDevScreenItemDisplayProperties itemProperties, Composite parent, FormToolkit toolkit) {
    Text text = new Text(parent, SWT.NULL);
    text.setText("HTML EDITOR");
    text.setEditable(false);
    EJDevItemRendererDefinitionControl definitionControl = new EJDevItemRendererDefinitionControl(itemProperties, text);
    definitionControl.setUseFontDimensions(false);
    return definitionControl;
}
Also used : EJDevItemRendererDefinitionControl(org.entirej.framework.dev.renderer.definition.EJDevItemRendererDefinitionControl) Text(org.eclipse.swt.widgets.Text)

Example 4 with EJDevItemRendererDefinitionControl

use of org.entirej.framework.dev.renderer.definition.EJDevItemRendererDefinitionControl in project rap by entirej.

the class EJRWTLabelItemRendererDefinition method getItemControl.

@Override
public EJDevItemRendererDefinitionControl getItemControl(EJDevScreenItemDisplayProperties itemProperties, Composite parent, FormToolkit toolkit) {
    // toolkit.createText(parent,
    Label text = new Label(parent, SWT.NULL);
    // itemProperties.getLabel(),
    // SWT.NULL);
    text.setText(itemProperties.getLabel());
    EJDevBlockItemDisplayProperties blockItemDisplayProperties = itemProperties.getBlockItemDisplayProperties();
    if (blockItemDisplayProperties != null) {
        EJFrameworkExtensionProperties itemRendererProperties = blockItemDisplayProperties.getItemRendererProperties();
        if (itemRendererProperties != null) {
            String labelAlignment = itemRendererProperties.getStringProperty(PROPERTY_ALIGNMENT);
            if (PROPERTY_ALIGNMENT_LEFT.equals(labelAlignment)) {
                text.setAlignment(SWT.LEFT);
            } else if (PROPERTY_ALIGNMENT_RIGHT.equals(labelAlignment)) {
                text.setAlignment(SWT.RIGHT);
            } else if (PROPERTY_ALIGNMENT_CENTER.equals(labelAlignment)) {
                text.setAlignment(SWT.CENTER);
            }
        }
    }
    return new EJDevItemRendererDefinitionControl(itemProperties, text);
}
Also used : EJFrameworkExtensionProperties(org.entirej.framework.core.properties.definitions.interfaces.EJFrameworkExtensionProperties) EJDevBlockItemDisplayProperties(org.entirej.framework.dev.properties.interfaces.EJDevBlockItemDisplayProperties) EJDevItemRendererDefinitionControl(org.entirej.framework.dev.renderer.definition.EJDevItemRendererDefinitionControl) Label(org.eclipse.swt.widgets.Label)

Example 5 with EJDevItemRendererDefinitionControl

use of org.entirej.framework.dev.renderer.definition.EJDevItemRendererDefinitionControl in project rap by entirej.

the class EJRWTButtonItemRendererDefinition method getItemControl.

@Override
public EJDevItemRendererDefinitionControl getItemControl(EJDevScreenItemDisplayProperties itemDisplayProperties, Composite parent, FormToolkit toolkit) {
    Button button = new Button(parent, SWT.FLAT);
    if (itemDisplayProperties.getLabel() != null && itemDisplayProperties.getLabel().trim().length() > 0) {
        button.setText(itemDisplayProperties.getLabel());
    }
    EJDevItemRendererDefinitionControl control = new EJDevItemRendererDefinitionControl(itemDisplayProperties, button, false);
    return control;
}
Also used : Button(org.eclipse.swt.widgets.Button) EJDevItemRendererDefinitionControl(org.entirej.framework.dev.renderer.definition.EJDevItemRendererDefinitionControl)

Aggregations

EJDevItemRendererDefinitionControl (org.entirej.framework.dev.renderer.definition.EJDevItemRendererDefinitionControl)19 Composite (org.eclipse.swt.widgets.Composite)7 GridLayout (org.eclipse.swt.layout.GridLayout)6 Label (org.eclipse.swt.widgets.Label)5 Group (org.eclipse.swt.widgets.Group)4 Text (org.eclipse.swt.widgets.Text)4 GridData (org.eclipse.swt.layout.GridData)3 Button (org.eclipse.swt.widgets.Button)3 EJFrameworkExtensionProperties (org.entirej.framework.core.properties.definitions.interfaces.EJFrameworkExtensionProperties)3 EJDevBlockItemDisplayProperties (org.entirej.framework.dev.properties.interfaces.EJDevBlockItemDisplayProperties)3 EJDevScreenRendererDefinitionControl (org.entirej.framework.dev.renderer.definition.EJDevScreenRendererDefinitionControl)3 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)2 Section (org.eclipse.ui.forms.widgets.Section)2 EJPropertyDefinitionGroup (org.entirej.framework.core.properties.definitions.interfaces.EJPropertyDefinitionGroup)2 EJDevPropertyDefinitionGroup (org.entirej.framework.dev.properties.EJDevPropertyDefinitionGroup)2 EJDevItemGroupDisplayProperties (org.entirej.framework.dev.properties.interfaces.EJDevItemGroupDisplayProperties)2 EJDevScreenItemDisplayProperties (org.entirej.framework.dev.properties.interfaces.EJDevScreenItemDisplayProperties)2 ArrayList (java.util.ArrayList)1 MouseListener (org.eclipse.swt.events.MouseListener)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1