use of org.entirej.framework.dev.renderer.definition.EJDevItemRendererDefinitionControl in project rap by entirej.
the class EJRWTRadioGroupItemRendererDefinition method getItemControl.
@Override
public EJDevItemRendererDefinitionControl getItemControl(EJDevScreenItemDisplayProperties itemDisplayProperties, Composite parent, FormToolkit toolkit) {
String orientation = itemDisplayProperties.getBlockItemDisplayProperties().getItemRendererProperties().getStringProperty(ORIENTATION);
boolean showBorder = itemDisplayProperties.getBlockItemDisplayProperties().getItemRendererProperties().getBooleanProperty(SHOW_BORDER, false);
final List<Button> buttons = new ArrayList<Button>();
group = new Composite(parent, SWT.SHADOW_NONE) {
@Override
public void addMouseListener(MouseListener listener) {
super.addMouseListener(listener);
for (Button button : buttons) {
button.addMouseListener(listener);
}
}
};
Composite buttonParent = group;
if (showBorder) {
group.setLayout(new FillLayout());
buttonParent = new Group(group, SWT.NONE);
if (itemDisplayProperties.getLabel() != null) {
((Group) buttonParent).setText(itemDisplayProperties.getLabel());
}
}
if (itemDisplayProperties.getHint() != null) {
buttonParent.setToolTipText(itemDisplayProperties.getHint());
}
if (ORIENTATION_HORIZONTAL.equals(orientation)) {
buttonParent.setLayout(new RowLayout(SWT.HORIZONTAL));
} else {
buttonParent.setLayout(new RowLayout(SWT.VERTICAL));
}
EJCoreFrameworkExtensionPropertyList radionButtons = itemDisplayProperties.getBlockItemDisplayProperties().getItemRendererProperties().getPropertyList(RADIO_BUTTONS);
for (EJFrameworkExtensionPropertyListEntry entry : radionButtons.getAllListEntries()) {
Button button = new Button(buttonParent, SWT.RADIO);
button.setText(entry.getProperty(LABEL));
buttons.add(button);
}
return new EJDevItemRendererDefinitionControl(itemDisplayProperties, group, false);
}
use of org.entirej.framework.dev.renderer.definition.EJDevItemRendererDefinitionControl in project rap by entirej.
the class EJRWTCheckBoxRendererDefinition method getItemControl.
@Override
public EJDevItemRendererDefinitionControl getItemControl(EJDevScreenItemDisplayProperties itemDisplayProperties, Composite parent, FormToolkit toolkit) {
String label = itemDisplayProperties.getLabel();
Button cb = toolkit.createButton(parent, label, SWT.CHECK);
final EJDevItemRendererDefinitionControl control = new EJDevItemRendererDefinitionControl(itemDisplayProperties, cb, false);
cb.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
control.fireFocusGained();
}
});
return control;
}
use of org.entirej.framework.dev.renderer.definition.EJDevItemRendererDefinitionControl in project rap by entirej.
the class EJRWTStackedItemRendererDefinition method getItemControl.
@Override
public EJDevItemRendererDefinitionControl getItemControl(EJDevScreenItemDisplayProperties itemProperties, Composite parent, FormToolkit toolkit) {
Text text = toolkit.createText(parent, "");
text.setText("STACK-TEXT-MODE");
text.setEditable(false);
return new EJDevItemRendererDefinitionControl(itemProperties, text);
}
use of org.entirej.framework.dev.renderer.definition.EJDevItemRendererDefinitionControl in project rap by entirej.
the class EJRWTTextItemRendererDefinition method getItemControl.
@Override
public EJDevItemRendererDefinitionControl getItemControl(EJDevScreenItemDisplayProperties itemProperties, Composite parent, FormToolkit toolkit) {
Text text = toolkit.createText(parent, "");
text.setEditable(false);
return new EJDevItemRendererDefinitionControl(itemProperties, text);
}
Aggregations