lblUnit.setEnabled(bEnableUI & bDate); cmbUnit.setEnabled(bEnableUI & bDate); lblInterval.setEnabled(bEnableUI); iscInterval.setEnabled(bEnableUI); lblAggregate.setEnabled(bEnableUI); cmbAggregate.setEnabled(bEnableUI); } else if (oSource.equals(cmbUnit)) { getGrouping().setGroupingUnit(GroupingUnitType.get(cmbUnit.getText())); } else if (oSource.equals(cmbAggregate)) { getGrouping().setAggregateExpression(cmbAggregate.getText()); } else if (oSource.equals(btnEnabled)) { SeriesGrouping grp = null; if (!sd.eIsSet(DataPackage.eINSTANCE.getSeriesDefinition_Grouping())) { grp = SeriesGroupingImpl.create(); sd.setGrouping(grp); } else { grp = sd.getGrouping(); } grp.setEnabled(btnEnabled.getSelection()); boolean bEnableUI = btnEnabled.getSelection();
lblUnit.setEnabled( bEnableUI & bDate ); cmbUnit.setEnabled( bEnableUI & bDate ); lblInterval.setEnabled( bEnableUI ); iscInterval.setEnabled( bEnableUI ); lblAggregate.setEnabled( bEnableUI ); cmbAggregate.setEnabled( bEnableUI ); } else if ( oSource.equals( cmbUnit ) ) { getGrouping( ).setGroupingUnit( GroupingUnitType.get( LiteralHelper.groupingUnitTypeSet.getNameByDisplayName( cmbUnit.getText( ) ) ) ); } else if ( oSource.equals( cmbAggregate ) ) { getGrouping( ).setAggregateExpression( cmbAggregate.getText( ) ); } else if ( oSource.equals( btnEnabled ) ) { SeriesGrouping grp = null; if ( !sd.eIsSet( DataPackage.eINSTANCE.getSeriesDefinition_Grouping( ) ) ) { grp = SeriesGroupingImpl.create( ); sd.setGrouping( grp ); } else { grp = sd.getGrouping( ); } grp.setEnabled( btnEnabled.getSelection( ) ); boolean bEnableUI = btnEnabled.getSelection( );
    public void widgetSelected(SelectionEvent e)    {        Object oSource = e.getSource();        if (oSource.equals(cmbType))        {            getGrouping().setGroupType(DataType.get(cmbType.getText()));            boolean bEnableUI = btnEnabled.getSelection();            boolean bDate = cmbType.getText().equals(DataType.DATE_TIME_LITERAL.getName());            lblUnit.setEnabled(bEnableUI & bDate);            cmbUnit.setEnabled(bEnableUI & bDate);            lblInterval.setEnabled(bEnableUI);            iscInterval.setEnabled(bEnableUI);            lblAggregate.setEnabled(bEnableUI);            cmbAggregate.setEnabled(bEnableUI);        }        else if (oSource.equals(cmbUnit))        {            getGrouping().setGroupingUnit(GroupingUnitType.get(cmbUnit.getText()));        }        else if (oSource.equals(cmbAggregate))        {            getGrouping().setAggregateExpression(cmbAggregate.getText());        }        else if (oSource.equals(btnEnabled))        {            SeriesGrouping grp = null;            if (!sd.eIsSet(DataPackage.eINSTANCE.getSeriesDefinition_Grouping()))            {                grp = SeriesGroupingImpl.create();                sd.setGrouping(grp);            }            else            {                grp = sd.getGrouping();            }            grp.setEnabled(btnEnabled.getSelection());            boolean bEnableUI = btnEnabled.getSelection();            lblType.setEnabled(bEnableUI);            cmbType.setEnabled(bEnableUI);            boolean bDate = cmbType.getText().equals(DataType.DATE_TIME_LITERAL.getName());            lblUnit.setEnabled(bEnableUI & bDate);            cmbUnit.setEnabled(bEnableUI & bDate);            lblInterval.setEnabled(bEnableUI);            iscInterval.setEnabled(bEnableUI);            lblAggregate.setEnabled(bEnableUI);            cmbAggregate.setEnabled(bEnableUI);        }    }