Search in sources :

Example 1 with SequenceBoxGrid

use of org.eclipse.scout.rt.client.ui.form.fields.sequencebox.internal.SequenceBoxGrid in project scout.rt by eclipse.

the class AbstractSequenceBox method initConfig.

@Override
protected void initConfig() {
    m_labelCompositionLock = new OptimisticLock();
    m_grid = new SequenceBoxGrid();
    super.initConfig();
    setAutoCheckFromTo(getConfiguredAutoCheckFromTo());
    setEqualColumnWidths(getConfiguredEqualColumnWidths());
    // when range box has visible label, suppress first field's label and append
    // to own label
    propertySupport.addPropertyChangeListener(new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent e) {
            if (e.getPropertyName().equals(IFormField.PROP_LABEL_VISIBLE) || e.getPropertyName().equals(IFormField.PROP_LABEL) || e.getPropertyName().equals(IFormField.PROP_VISIBLE)) {
                updateLabelComposition();
            }
        }
    });
    // If inner fields change their visibility dynamically, the label of the SequenceBox might change.
    for (IFormField field : getFields()) {
        field.addPropertyChangeListener(new PropertyChangeListener() {

            @Override
            public void propertyChange(PropertyChangeEvent e) {
                if (e.getPropertyName().equals(IFormField.PROP_LABEL_VISIBLE) || e.getPropertyName().equals(IFormField.PROP_LABEL) || e.getPropertyName().equals(IFormField.PROP_VISIBLE)) {
                    updateLabelComposition();
                }
            }
        });
    }
    updateLabelComposition();
    hideFieldStatusOfChildren();
    // attach change triggers
    attachCheckFromToListeners();
}
Also used : IFormField(org.eclipse.scout.rt.client.ui.form.fields.IFormField) PropertyChangeEvent(java.beans.PropertyChangeEvent) SequenceBoxGrid(org.eclipse.scout.rt.client.ui.form.fields.sequencebox.internal.SequenceBoxGrid) PropertyChangeListener(java.beans.PropertyChangeListener) OptimisticLock(org.eclipse.scout.rt.platform.util.concurrent.OptimisticLock)

Aggregations

PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 IFormField (org.eclipse.scout.rt.client.ui.form.fields.IFormField)1 SequenceBoxGrid (org.eclipse.scout.rt.client.ui.form.fields.sequencebox.internal.SequenceBoxGrid)1 OptimisticLock (org.eclipse.scout.rt.platform.util.concurrent.OptimisticLock)1