Skip to content

Commit

Permalink
Aggregation is disabled in charting #856 (#857)
Browse files Browse the repository at this point in the history
Enabled aggregation. Seems to have been a negation wrong. Also expanded
the default IChartUIHelper.useDataSetRow() implementation to a simple
startsWith("data") check previously used in the enableAddEditor()
method-
  • Loading branch information
claesrosell authored Mar 11, 2022
1 parent 5dd0edd commit 63a5c3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ private void enableAggEditor(String expression) {
ec.decode(expression);
expression = ec.convertJSExpression(false);

boolean enabled = this.context.getUIFactory().createUIHelper().useDataSetRow(context.getExtendedItem(),
boolean enabled = !this.context.getUIFactory().createUIHelper().useDataSetRow(context.getExtendedItem(),
expression);
fAggEditorComposite.setEnabled(enabled);
} catch (BirtException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ public boolean canCombine(IChartType type, ChartWizardContext context) {

@Override
public boolean useDataSetRow(Object reportItem, String expression) throws BirtException {
// Default implementation, do nothing
return false;
/*
* Default implementation is a bit simple, this behavior is copied from
* org.eclipse.birt.chart.ui.swt.wizard.data.BaseDataDefinitionComponent.
* enableAggEditor( String expression ) prior to the refactoring that yielded
* this method. According to the javadoc it should be more comprehensive though.
*/
return expression.startsWith("data"); //$NON-NLS-1$
}
}

0 comments on commit 63a5c3c

Please sign in to comment.