summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlzhang2011-11-28 02:37:16 (EST)
committer xgu2011-11-28 02:37:16 (EST)
commit113995c9af93b18187de24d6149ef8dc95ccbd92 (patch)
treeb4e90355c1ab015beebe0bf0a8d40b8e8683eb98
parent8db3a9e60f8af8fd8d3f4a903bcd31b2b165a4f7 (diff)
downloadorg.eclipse.birt-113995c9af93b18187de24d6149ef8dc95ccbd92.zip
org.eclipse.birt-113995c9af93b18187de24d6149ef8dc95ccbd92.tar.gz
org.eclipse.birt-113995c9af93b18187de24d6149ef8dc95ccbd92.tar.bz2
Checkin: Get rid of the DimensionHandle parameter in the function
"getTooptipForTimeFunction" since we do not need it now
-rw-r--r--data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/api/timeFunction/TimeFunctionManager.java13
-rw-r--r--data/org.eclipse.birt.report.data.adapter/test/org/eclipse/birt/report/data/adapter/internal/script/TimeFunctionManagerTest.java8
2 files changed, 6 insertions, 15 deletions
diff --git a/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/api/timeFunction/TimeFunctionManager.java b/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/api/timeFunction/TimeFunctionManager.java
index b73bb89..21059d0 100644
--- a/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/api/timeFunction/TimeFunctionManager.java
+++ b/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/api/timeFunction/TimeFunctionManager.java
@@ -508,14 +508,12 @@ public class TimeFunctionManager
/**
* get the description for a specific time function
*
- * @param dim
- * @param timeLevelsInXtab
* @param column
+ * @param locale
* @return
* @throws BirtException
*/
- public static String getTooltipForTimeFunction( DimensionHandle dim,
- ComputedColumnHandle column, ULocale locale ) throws BirtException
+ public static String getTooltipForTimeFunction( ComputedColumnHandle column, ULocale locale ) throws BirtException
{
String desc = null;
DataRequestSession session = DataRequestSession.newSession( new DataSessionContext( DataSessionContext.MODE_DIRECT_PRESENTATION ) );
@@ -527,19 +525,12 @@ public class TimeFunctionManager
Date date = functionBinding.getTimeFunction( ).getReferenceDate( ).getDate( );
Calendar cal = Calendar.getInstance( locale );
cal.setTime( date );
- // int levelCount = dim.getDefaultHierarchy( ).getLevelCount( );
int[] values = new int[3];
String[] levelTypes = new String[3];
levelTypes[0] = TimeMember.TIME_LEVEL_TYPE_YEAR;
levelTypes[1] = TimeMember.TIME_LEVEL_TYPE_MONTH;
levelTypes[2] = TimeMember.TIME_LEVEL_TYPE_DAY_OF_MONTH;
-// for ( int i = 0; i < levelCount; i++ )
-// {
-// levelTypes[i] = dim.getDefaultHierarchy( )
-// .getLevel( i )
-// .getDateTimeLevelType( );
-// }
values = getValueFromCal( cal, levelTypes );
TimeMember member = new TimeMember( values, levelTypes );
IPeriodsFunction periodsFunction = null;
diff --git a/data/org.eclipse.birt.report.data.adapter/test/org/eclipse/birt/report/data/adapter/internal/script/TimeFunctionManagerTest.java b/data/org.eclipse.birt.report.data.adapter/test/org/eclipse/birt/report/data/adapter/internal/script/TimeFunctionManagerTest.java
index a98eb90..00131de 100644
--- a/data/org.eclipse.birt.report.data.adapter/test/org/eclipse/birt/report/data/adapter/internal/script/TimeFunctionManagerTest.java
+++ b/data/org.eclipse.birt.report.data.adapter/test/org/eclipse/birt/report/data/adapter/internal/script/TimeFunctionManagerTest.java
@@ -350,7 +350,7 @@ public class TimeFunctionManagerTest extends TestCase
.setExpression( new Expression( "\"2003-08-17\"", null ) );
computedHandle.setProperty( ComputedColumn.TIME_DIMENSION_MEMBER,
"dimension[\"TimeDimension\"]" );
- String desc = TimeFunctionManager.getTooltipForTimeFunction( cube1.getDimension( "TimeDimension" ), computedHandle, ULocale.getDefault( ) );
+ String desc = TimeFunctionManager.getTooltipForTimeFunction( computedHandle, ULocale.getDefault( ) );
assertTrue(desc.equals( "Quarter to Date ( 2003-7-1 To 2003-8-17 )" ) );
}
@@ -368,7 +368,7 @@ public class TimeFunctionManagerTest extends TestCase
computedHandle.setProperty( ComputedColumn.TIME_DIMENSION_MEMBER,
"dimension[\"TimeDimension\"]" );
- String desc = TimeFunctionManager.getTooltipForTimeFunction( cube1.getDimension( "TimeDimension" ), computedHandle, ULocale.getDefault( ) );
+ String desc = TimeFunctionManager.getTooltipForTimeFunction( computedHandle, ULocale.getDefault( ) );
assertTrue(desc.equals( "previous Year to Date ( 2002-1-1 To 2002-8-17 )" ) );
}
@@ -386,7 +386,7 @@ public class TimeFunctionManagerTest extends TestCase
computedHandle.setProperty( ComputedColumn.TIME_DIMENSION_MEMBER,
"dimension[\"TimeDimension\"]" );
- String desc = TimeFunctionManager.getTooltipForTimeFunction( cube1.getDimension( "TimeDimension" ), computedHandle, ULocale.getDefault( ) );
+ String desc = TimeFunctionManager.getTooltipForTimeFunction( computedHandle, ULocale.getDefault( ) );
assertTrue(desc.equals( "Trailing 12 Months ( 2002-8-18 To 2003-8-17 )" ) );
}
@@ -402,7 +402,7 @@ public class TimeFunctionManagerTest extends TestCase
.setExpression( new Expression( "\"2003-08-17\"", null ) );
computedHandle.setProperty( ComputedColumn.TIME_DIMENSION_MEMBER,
"dimension[\"TimeDimension\"]" );
- String desc = TimeFunctionManager.getTooltipForTimeFunction( cube1.getDimension( "TimeDimension" ), computedHandle, ULocale.getDefault( ) );
+ String desc = TimeFunctionManager.getTooltipForTimeFunction( computedHandle, ULocale.getDefault( ) );
assertTrue(desc.equals( "Current Year ( 2003-1-1 To 2003-12-31 )" ) );
}
}