boolean bEnableUI = btnEnabled.getSelection();  lblType.setEnabled(bEnableUI); cmbType.setEnabled(bEnableUI);  boolean bText = cmbType.getText().equals("Text"); boolean bDate = cmbType.getText().equals("Date/Time");  lblUnit.setEnabled(bEnableUI & bDate); cmbUnit.setEnabled(bEnableUI & bDate); lblInterval.setEnabled(bEnableUI & !bText); iscInterval.setEnabled(bEnableUI & !bText); lblAggregate.setEnabled(bEnableUI & !bText); cmbAggregate.setEnabled(bEnableUI & !bText);
    public void widgetSelected(SelectionEvent e)    {        Object oSource = e.getSource();        if (oSource.equals(cmbType))        {            if (cmbType.getText().equals("Date/Time")) //$NON-NLS-1$            {                lblUnit.setEnabled(true);                cmbUnit.setEnabled(true);            }            else            {                lblUnit.setEnabled(false);                cmbUnit.setEnabled(false);            }            getGrouping().setGroupType(cmbType.getText());        }        else if (oSource.equals(cmbUnit))        {            getGrouping().setGroupingUnit(cmbUnit.getText());        }        else if (oSource.equals(cmbAggregate))        {            getGrouping().setAggregateExpression(cmbAggregate.getText());        }        else if (oSource.equals(btnEnabled))        {            getGrouping().setEnabled(btnEnabled.getSelection());        }    }