Skip to content

Commit

Permalink
Add method to IBindingDialogHelper to get/set groups.
Browse files Browse the repository at this point in the history
Signed-off-by: Carl Thronson <cthronson@actuate.com>
  • Loading branch information
Carl Thronson committed Mar 1, 2016
1 parent 0765993 commit 77c4fbf
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 2 deletions.
@@ -0,0 +1,18 @@
/*******************************************************************************
* Copyright (c) 2013 Actuate Corporation.
* All rights reserved.
*******************************************************************************/
package org.eclipse.birt.report.designer.data.ui.datasource;

import java.util.List;

/**
*
*/

public interface INewAdapterType
{

public List<String> getObsolueteNames( );

}
Expand Up @@ -36,6 +36,8 @@ public abstract class AbstractBindingDialogHelper implements
protected ExpressionProvider expressionProvider;
private Object itemContainer;

private String[] groups = new String[0];

public boolean isAggregate( )
{
return isAggregate;
Expand Down Expand Up @@ -169,4 +171,16 @@ public boolean canProcessMeasure( )
{
return false;
}

@Override
public void setGroups( String[] groups )
{
this.groups = groups;
}

@Override
public String[] getGroups( )
{
return this.groups;
}
}
Expand Up @@ -804,7 +804,7 @@ else if ( this.container instanceof ListGroupHandle )
}
}

protected String[] getGroups( )
public String[] getGroups( )
{
if ( getBindingHolder( ) instanceof ListingHandle )
{
Expand All @@ -819,7 +819,10 @@ protected String[] getGroups( )
}
return (String[]) groupNames.toArray( new String[0] );
}
return new String[0];
else
{
return super.getGroups( );
}
}

private void setDataFieldExpression( ComputedColumnHandle binding )
Expand Down
Expand Up @@ -144,4 +144,7 @@ ComputedColumnHandle editBinding( ComputedColumnHandle binding )

boolean canProcessMeasure( );

String[] getGroups( );

void setGroups( String[] groups );
}
Expand Up @@ -3220,4 +3220,31 @@ private boolean isAggregateWithFunction( )
{
return isAggregate( ) && !isMeasure( );
}

@Override
public String[] getGroups( )
{
CrosstabReportItemHandle xtabHandle;
try
{
xtabHandle = (CrosstabReportItemHandle) ( (ExtendedItemHandle) getBindingHolder( ) ).getReportItem( );
String[] groups = getAggOns( xtabHandle );
List<String> list = new ArrayList<String>( );
for ( String group : groups )
{
if ( !group.equals( "All" ) ) //$NON-NLS-1$
{
list.add( group );
}
}
groups = new String[list.size( )];
groups = list.toArray( groups );
return groups;
}
catch ( ExtendedElementException e )
{
ExceptionUtil.handle( e );
}
return new String[0];
}
}

0 comments on commit 77c4fbf

Please sign in to comment.