summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorning.zhang2011-12-05 03:17:47 (EST)
committer dgao2011-12-05 03:38:24 (EST)
commit1f4316b96bddc0342372869a41da7ffcd41c4a0d (patch)
tree221ed2c92fff94c50cdb720498fb7efad1c043b0
parent37436d82534f9997276a6503f52458c6cd5ed32d (diff)
downloadorg.eclipse.birt-1f4316b96bddc0342372869a41da7ffcd41c4a0d.zip
org.eclipse.birt-1f4316b96bddc0342372869a41da7ffcd41c4a0d.tar.gz
org.eclipse.birt-1f4316b96bddc0342372869a41da7ffcd41c4a0d.tar.bz2
- Summary:
Enable cube measure selection on the expression builder when the measure is a derived measure; Don't check data type when the measure is a derived measure. - Bugzilla Bug (s) Resolved: None - Description: Enable cube measure selection on the expression builder when the measure is a derived measure; Don't check data type when the measure is a derived measure. - Tests Description: Manual test - Notes to Build Team: None - Notes to Developers: None - Notes to QA: None - Notes to Documentation: None - Files Edited: - Files Added: - Files Deleted:
-rw-r--r--UI/org.eclipse.birt.report.designer.ui.cubebuilder/src/org/eclipse/birt/report/designer/ui/cubebuilder/dialog/MeasureDialog.java18
-rw-r--r--UI/org.eclipse.birt.report.designer.ui.cubebuilder/src/org/eclipse/birt/report/designer/ui/cubebuilder/provider/CubeExpressionProvider.java2
-rw-r--r--UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/ExpressionProvider.java11
3 files changed, 26 insertions, 5 deletions
diff --git a/UI/org.eclipse.birt.report.designer.ui.cubebuilder/src/org/eclipse/birt/report/designer/ui/cubebuilder/dialog/MeasureDialog.java b/UI/org.eclipse.birt.report.designer.ui.cubebuilder/src/org/eclipse/birt/report/designer/ui/cubebuilder/dialog/MeasureDialog.java
index 24ed816..7c2074b 100644
--- a/UI/org.eclipse.birt.report.designer.ui.cubebuilder/src/org/eclipse/birt/report/designer/ui/cubebuilder/dialog/MeasureDialog.java
+++ b/UI/org.eclipse.birt.report.designer.ui.cubebuilder/src/org/eclipse/birt/report/designer/ui/cubebuilder/dialog/MeasureDialog.java
@@ -29,6 +29,7 @@ import org.eclipse.birt.report.designer.internal.ui.util.UIUtil;
import org.eclipse.birt.report.designer.internal.ui.util.WidgetUtil;
import org.eclipse.birt.report.designer.ui.cubebuilder.nls.Messages;
import org.eclipse.birt.report.designer.ui.cubebuilder.provider.CubeExpressionProvider;
+import org.eclipse.birt.report.designer.ui.cubebuilder.provider.CubeMeasureExpressionProvider;
import org.eclipse.birt.report.designer.ui.cubebuilder.provider.LinkToCubeExpressionProvider;
import org.eclipse.birt.report.designer.ui.cubebuilder.util.BuilderConstants;
import org.eclipse.birt.report.designer.ui.newelement.DesignElementFactory;
@@ -76,6 +77,8 @@ public class MeasureDialog extends TitleAreaDialog
private boolean isEdit = false;
private boolean isAutoPrimaryKeyChecked = false;
+ private ExpressionButton exprBtn;
+ private CubeMeasureExpressionProvider provider;
private Combo typeCombo;
private Text expressionText;
private Combo functionCombo;
@@ -498,6 +501,11 @@ public class MeasureDialog extends TitleAreaDialog
{
functionCombo.setEnabled( !( derivedMeasureBtn.getSelection( ) || isAutoPrimaryKeyChecked ) );
exprDesc.setText( Messages.getString( derivedMeasureBtn.getSelection( ) ? "MeasureDialog.Label.ExprDesc.Derived" : "MeasureDialog.Label.ExprDesc" ) ); //$NON-NLS-1$ //$NON-NLS-2$
+ provider.setDerivedMeasure(derivedMeasureBtn.getSelection( ));
+ if(!derivedMeasureBtn.getSelection())
+ {
+ handleTypeSelectEvent( );
+ }
}
} );
@@ -532,7 +540,10 @@ public class MeasureDialog extends TitleAreaDialog
public void widgetSelected( SelectionEvent e )
{
- handleTypeSelectEvent( );
+ if (!derivedMeasureBtn.getSelection())
+ {
+ handleTypeSelectEvent( );
+ }
checkOkButtonStatus( );
if ( formatHelper != null )
{
@@ -558,9 +569,10 @@ public class MeasureDialog extends TitleAreaDialog
} );
- ExpressionButtonUtil.createExpressionButton( group,
+ provider = new CubeMeasureExpressionProvider( input, input.isCalculated() );
+ exprBtn = ExpressionButtonUtil.createExpressionButton( group,
expressionText,
- new CubeExpressionProvider( input ),
+ provider,
input );
new Label( group, SWT.NONE );
diff --git a/UI/org.eclipse.birt.report.designer.ui.cubebuilder/src/org/eclipse/birt/report/designer/ui/cubebuilder/provider/CubeExpressionProvider.java b/UI/org.eclipse.birt.report.designer.ui.cubebuilder/src/org/eclipse/birt/report/designer/ui/cubebuilder/provider/CubeExpressionProvider.java
index 0f1c25c..34404bb 100644
--- a/UI/org.eclipse.birt.report.designer.ui.cubebuilder/src/org/eclipse/birt/report/designer/ui/cubebuilder/provider/CubeExpressionProvider.java
+++ b/UI/org.eclipse.birt.report.designer.ui.cubebuilder/src/org/eclipse/birt/report/designer/ui/cubebuilder/provider/CubeExpressionProvider.java
@@ -143,7 +143,7 @@ public class CubeExpressionProvider extends ExpressionProvider
* @param handle
* @return
*/
- private List getOutputList( DataSetHandle handle )
+ protected List getOutputList( DataSetHandle handle )
{
List outputList = new ArrayList( );
PropertyHandle parameters = handle.getPropertyHandle( DataSetHandle.PARAMETERS_PROP );
diff --git a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/ExpressionProvider.java b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/ExpressionProvider.java
index 5ce5ace..0991b64 100644
--- a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/ExpressionProvider.java
+++ b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/ExpressionProvider.java
@@ -63,6 +63,7 @@ import org.eclipse.birt.report.model.api.olap.DimensionHandle;
import org.eclipse.birt.report.model.api.olap.LevelHandle;
import org.eclipse.birt.report.model.api.olap.MeasureHandle;
import org.eclipse.birt.report.model.api.olap.TabularMeasureGroupHandle;
+import org.eclipse.birt.report.model.api.olap.TabularMeasureHandle;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.swt.graphics.Image;
@@ -609,7 +610,15 @@ public class ExpressionProvider implements
}
else if ( CURRENT_CUBE.equals( parent ) )
{
- CubeHandle cube = ( (ReportItemHandle) elementHandle ).getCube( );
+ CubeHandle cube = null;
+ if( elementHandle instanceof TabularMeasureHandle)
+ {
+ cube = (CubeHandle)( (TabularMeasureHandle) elementHandle ).getContainer().getContainer();
+ }
+ else
+ {
+ cube = ( (ReportItemHandle) elementHandle ).getCube( );
+ }
Object nodeProviderAdapter = ElementAdapterManager.getAdapter( cube,
INodeProvider.class );
if ( nodeProviderAdapter != null )