Search in sources :

Example 6 with EJRWTStackedItemRendererType

use of org.entirej.applicationframework.rwt.renderers.stack.EJRWTStackedItemRendererType in project rap by entirej.

the class EJRWTStackedItemRenderer method setEditAllowed.

@Override
public void setEditAllowed(boolean editAllowed) {
    EJRWTStackedItemRendererType[] values = EJRWTStackedItemRendererType.values();
    for (EJRWTStackedItemRendererType type : values) {
        Control control = stackedPane.getControl(type.name());
        if (control != null && controlState(control)) {
            if (control instanceof Button) {
                ((Button) control).setEnabled(editAllowed);
            } else if (control instanceof Text) {
                ((Text) control).setEditable(editAllowed);
            } else if (control instanceof Combo) {
                ((Combo) control).setEnabled(editAllowed);
            }
        }
    }
    setMandatoryBorder(editAllowed && _mandatory);
    if (controlState(_actionControl)) {
        _actionControl.setActionVisible(isLovActivated() && editAllowed);
    }
}
Also used : Control(org.eclipse.swt.widgets.Control) Button(org.eclipse.swt.widgets.Button) Text(org.eclipse.swt.widgets.Text) Combo(org.eclipse.swt.widgets.Combo) EJRWTStackedItemRendererType(org.entirej.applicationframework.rwt.renderers.stack.EJRWTStackedItemRendererType)

Example 7 with EJRWTStackedItemRendererType

use of org.entirej.applicationframework.rwt.renderers.stack.EJRWTStackedItemRendererType in project rap by entirej.

the class EJRWTStackedItemRenderer method refreshFont.

private void refreshFont() {
    EJRWTStackedItemRendererType[] values = EJRWTStackedItemRendererType.values();
    for (EJRWTStackedItemRendererType type : values) {
        Control control = stackedPane.getControl(type.name());
        if (control != null && controlState(control)) {
            EJRWTItemRendererVisualContext _visualContext = (EJRWTItemRendererVisualContext) control.getData("EJRWTItemRendererVisualContext");
            control.setFont(EJRWTVisualAttributeUtils.INSTANCE.getFont(_visualAttributeProperties, _visualContext.getItemFont()));
        }
    }
}
Also used : Control(org.eclipse.swt.widgets.Control) EJRWTStackedItemRendererType(org.entirej.applicationframework.rwt.renderers.stack.EJRWTStackedItemRendererType) EJRWTItemRendererVisualContext(org.entirej.applicationframework.rwt.utils.EJRWTItemRendererVisualContext)

Aggregations

Control (org.eclipse.swt.widgets.Control)7 EJRWTStackedItemRendererType (org.entirej.applicationframework.rwt.renderers.stack.EJRWTStackedItemRendererType)7 Button (org.eclipse.swt.widgets.Button)3 Combo (org.eclipse.swt.widgets.Combo)3 Text (org.eclipse.swt.widgets.Text)3 EJRWTItemRendererVisualContext (org.entirej.applicationframework.rwt.utils.EJRWTItemRendererVisualContext)3 Color (org.eclipse.swt.graphics.Color)2 Label (org.eclipse.swt.widgets.Label)2 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 List (java.util.List)1 ComboViewer (org.eclipse.jface.viewers.ComboViewer)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 EJRWTStackedItemRendererConfig (org.entirej.applicationframework.rwt.renderers.stack.EJRWTStackedItemRendererConfig)1 CheckBox (org.entirej.applicationframework.rwt.renderers.stack.EJRWTStackedItemRendererConfig.CheckBox)1 EJMessage (org.entirej.framework.core.EJMessage)1