本文整理汇总了Java中org.eclipse.birt.report.model.api.ScalarParameterHandle类的典型用法代码示例。如果您正苦于以下问题:Java ScalarParameterHandle类的具体用法?Java ScalarParameterHandle怎么用?Java ScalarParameterHandle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ScalarParameterHandle类属于org.eclipse.birt.report.model.api包,在下文中一共展示了ScalarParameterHandle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isScalarParameterHandle
import org.eclipse.birt.report.model.api.ScalarParameterHandle; //导入依赖的package包/类
private boolean isScalarParameterHandle( Object transfer )
{
if ( transfer instanceof Object[] )
{
DesignElementHandle container = null;
Object[] items = (Object[]) transfer;
for ( int i = 0; i < items.length; i++ )
{
if ( !( items[i] instanceof ScalarParameterHandle ) )
return false;
}
return true;
}
return transfer instanceof ScalarParameterHandle;
}
示例2: test_regression_118006
import org.eclipse.birt.report.model.api.ScalarParameterHandle; //导入依赖的package包/类
/**
* @throws NameException
* @throws ContentException
*
*/
public void test_regression_118006( ) throws ContentException, NameException
{
DesignEngine engine = new DesignEngine( new DesignConfig( ) );
SessionHandle session = engine.newSessionHandle( ULocale.ENGLISH );
ReportDesignHandle designHandle = session.createDesign( );
ElementFactory factory = designHandle.getElementFactory( );
ScalarParameterHandle p1 = factory.newScalarParameter( null );
ScalarParameterHandle p2 = factory.newScalarParameter( null );
designHandle.getParameters( ).add( p1 );
designHandle.getParameters( ).add( p2 );
ParameterGroupHandle parameterGroupHandle = factory.newParameterGroup( "group" ); //$NON-NLS-1$
ScalarParameterHandle p3 = factory.newScalarParameter( null );
parameterGroupHandle.getParameters( ).add( p3 );
// make sure that the default names will not duplicate.
assertEquals( "NewParameter", p1.getName( ) ); //$NON-NLS-1$
assertEquals( "NewParameter1", p2.getName( ) ); //$NON-NLS-1$
assertEquals( "NewParameter2", p3.getName( ) ); //$NON-NLS-1$
}
示例3: test_regression_134213
import org.eclipse.birt.report.model.api.ScalarParameterHandle; //导入依赖的package包/类
/**
* @throws DesignFileException
*/
public void test_regression_134213( ) throws DesignFileException
{
openDesign( INPUT );
ScalarParameterHandle param1 = (ScalarParameterHandle) designHandle
.getParameters( ).get( 0 );
ScalarParameterHandle param2 = (ScalarParameterHandle) designHandle
.getParameters( ).get( 1 );
ScalarParameterHandle param3 = (ScalarParameterHandle) designHandle
.getParameters( ).get( 2 );
ScalarParameterHandle param4 = (ScalarParameterHandle) designHandle
.getParameters( ).get( 3 );
assertEquals( "##,###.##", param1.getPattern( ) ); //$NON-NLS-1$
assertEquals( DesignChoiceConstants.STRING_FORMAT_TYPE_CUSTOM, param2
.getCategory( ) );
assertEquals( "@@[email protected]@", param2.getPattern( ) ); //$NON-NLS-1$
assertEquals( DesignChoiceConstants.NUMBER_FORMAT_TYPE_CURRENCY, param3
.getCategory( ) );
assertEquals( "abc:##:00", param4.getPattern( ) ); //$NON-NLS-1$
}
示例4: processLinkedReportParameter
import org.eclipse.birt.report.model.api.ScalarParameterHandle; //导入依赖的package包/类
public void processLinkedReportParameter( )
{
String reportParamName = paramHandle.getParamName( );
if ( StringUtil.isBlank( reportParamName ) )
return;
ScalarParameterHandle reportParam = (ScalarParameterHandle) paramHandle
.getModule( ).getModuleHandle( )
.findParameter( reportParamName );
if ( reportParam == null )
return;
ReportParamChecker tmpVisitor = new ReportParamChecker( paramDefn,
reportParam );
List<IAmbiguousAttribute> tmpList = tmpVisitor.process( );
ambiguousList.addAll( tmpList );
}
示例5: processLinkedReportParameter
import org.eclipse.birt.report.model.api.ScalarParameterHandle; //导入依赖的package包/类
/**
*
* @throws SemanticException
*/
private void processLinkedReportParameter( ) throws SemanticException
{
String reportParamName = newParam.getParamName( );
if ( StringUtil.isBlank( reportParamName ) )
return;
ScalarParameterHandle reportParam = (ScalarParameterHandle) module
.findParameter( reportParamName );
if ( reportParam == null )
return;
CommandStack cmdStack = reportParam.getModuleHandle( )
.getCommandStack( );
cmdStack.startTrans( null );
ReportParamUpdater tmpUpdater = new ReportParamUpdater( paramDefn,
newParam, reportParam, setHandle );
tmpUpdater.process( );
cmdStack.commit( );
}
示例6: processDataElementAttributes
import org.eclipse.birt.report.model.api.ScalarParameterHandle; //导入依赖的package包/类
/**
*
* @param dataAttrs
*/
private void processDataElementAttributes( DataElementAttributes dataAttrs )
{
if ( dataAttrs == null )
return;
boolean allowsNull = dataAttrs.allowsNull( );
boolean oldValue = reportParam.isRequired( );
// if isRequiried=true, means allowsNull=false. In such case, need
// to step into this code snippet
handleValue( allowsNull, oldValue,
ScalarParameterHandle.IS_REQUIRED_PROP, true );
DataElementUIHints dataElementUIHints = dataAttrs.getUiHints( );
processDataElementUIHints( dataElementUIHints );
}
示例7: processDataElementUIHints
import org.eclipse.birt.report.model.api.ScalarParameterHandle; //导入依赖的package包/类
/**
*
* @param dataElementUiHints
*/
private void processDataElementUIHints(
DataElementUIHints dataElementUiHints )
{
if ( dataElementUiHints == null )
return;
// handle propmpText
String newPromptText = dataElementUiHints.getDisplayName( );
String oldPrompText = reportParam.getPromptText( );
handleValue( newPromptText, oldPrompText,
ScalarParameterHandle.PROMPT_TEXT_PROP );
// handle helpText
String newHelpText = dataElementUiHints.getDescription( );
String oldHelpText = reportParam.getHelpText( );
handleValue( newHelpText, oldHelpText,
ScalarParameterHandle.HELP_TEXT_PROP );
}
示例8: processInputElementUIHints
import org.eclipse.birt.report.model.api.ScalarParameterHandle; //导入依赖的package包/类
/**
*
* @param inputElementUiHints
*/
private void processInputElementUIHints(
InputElementUIHints inputElementUiHints )
{
if ( inputElementUiHints == null )
return;
// handle auto suggest threshold
int newValue = inputElementUiHints.getAutoSuggestThreshold( );
int oldValue = reportParam.getAutoSuggestThreshold( );
if ( newValue != oldValue
&& !ambiguousAttrs
.contains( ScalarParameterHandle.AUTO_SUGGEST_THRESHOLD_PROP ) )
{
ambiguousList.add( new AmbiguousAttribute(
ScalarParameterHandle.AUTO_SUGGEST_THRESHOLD_PROP,
oldValue, newValue, true ) );
ambiguousAttrs
.add( ScalarParameterHandle.AUTO_SUGGEST_THRESHOLD_PROP );
}
// handle control type in prompt style
InputPromptControlStyle style = inputElementUiHints.getPromptStyle( );
processInputPromptControlStyle( style );
}
示例9: testParameters
import org.eclipse.birt.report.model.api.ScalarParameterHandle; //导入依赖的package包/类
/**
* Test the parameters in this group.
*
* @throws Exception
*/
public void testParameters( ) throws Exception
{
ParameterGroupHandle h = getParameterGroup( "My Param Group" ); //$NON-NLS-1$
assertNotNull( h );
SlotHandle slotHandle = h.getParameters( );
assertTrue( slotHandle.getCount( ) == 1 );
DesignElementHandle elementHandle = slotHandle.get( 0 );
Object o = elementHandle.getName( );
assertEquals( "Param 2", o ); //$NON-NLS-1$
// cascading
ParameterGroupHandle countryStateCity = getParameterGroup( "Country-State-City" ); //$NON-NLS-1$
SlotHandle cascadingParameters = countryStateCity.getParameters();
assertEquals( 3, cascadingParameters.getCount() );
ScalarParameterHandle p1 = (ScalarParameterHandle)cascadingParameters.get( 0 );
assertEquals( "dynamic", p1.getValueType() ); //$NON-NLS-1$
assertEquals( "ds1", p1.getDataSetName()); //$NON-NLS-1$
assertEquals( "country", p1.getValueExpr() ); //$NON-NLS-1$
assertEquals( "Enter country:", p1.getLabelExpr() ); //$NON-NLS-1$
}
示例10: testNameManager
import org.eclipse.birt.report.model.api.ScalarParameterHandle; //导入依赖的package包/类
/**
* Tests the name-manager.
*
* @throws Exception
*/
public void testNameManager( ) throws Exception
{
openDesign( "DesignElementTest_1.xml" ); //$NON-NLS-1$
assertNotNull( designHandle );
ScalarParameterHandle param = designHandle.getElementFactory( )
.newScalarParameter( null );
assertNotNull( param.getName( ) );
assertEquals( param.getElement( ), ( (AbstractNameHelper) design
.getNameHelper( ) ).getCachedNameSpace(
Module.PARAMETER_NAME_SPACE ).getElement( param.getName( ) ) );
// add the parameter into the design and find that
// the cached name in the name manger is cleared.
designHandle.getParameters( ).add( param );
assertNull( ( (AbstractNameHelper) design.getNameHelper( ) )
.getCachedNameSpace( Module.PARAMETER_NAME_SPACE ).getElement(
param.getName( ) ) );
}
示例11: getParameterValue
import org.eclipse.birt.report.model.api.ScalarParameterHandle; //导入依赖的package包/类
/**
* parse parameter value by string value
*
* @param handle
* @param field
* @param value
* @return
* @throws Exception
*/
private Object getParameterValue( ScalarParameterHandle handle,
ParameterField field, String value ) throws Exception
{
// get parameter data type
String dataType = handle.getDataType( );
// if String type, return String value
if ( DesignChoiceConstants.PARAM_TYPE_STRING
.equalsIgnoreCase( dataType ) )
{
return value;
}
// convert parameter to object
String pattern = field.getPattern( );
if ( pattern == null || pattern.length( ) <= 0 )
{
pattern = handle.getPattern( );
}
return DataUtil.validate( handle.getName( ), handle.getDataType( ),
pattern, value, this.locale, this.timeZone, field.isLocale( ) );
}
示例12: getScalarParameter
import org.eclipse.birt.report.model.api.ScalarParameterHandle; //导入依赖的package包/类
/**
* Gets the ScalarParameterHandle according to the given report parameter name.
* Furthermore, if the argument needsRefresh is true then the linked report parameter
* list should be refreshed every time this method is called. If needsRefresh is false,
* then the linked report parameter list won't be refreshed after it is initialized.
* This behavior is for the purpose of performance.
*
* @param name
* @param needsRefresh indicates whether the linked report parameter list should be refreshed
*
* @return
*/
static ScalarParameterHandle getScalarParameter( String name,
boolean needsRefresh )
{
if ( needsRefresh || linkedToParamList == null )
{
linkedToParamList = Utility.getAllParameters( );
}
Object parameterObject = null;
for ( int i = 0; i < linkedToParamList.size( ); i++ )
{
parameterObject = linkedToParamList.get( i );
if ( parameterObject instanceof ScalarParameterHandle )
{
if ( name.equals( ( (ScalarParameterHandle) parameterObject ).getQualifiedName( ) ) )
return (ScalarParameterHandle) parameterObject;
}
}
return null;
}
示例13: getAllScalarParamName
import org.eclipse.birt.report.model.api.ScalarParameterHandle; //导入依赖的package包/类
private String[] getAllScalarParamName()
{
List names = new ArrayList();
String[] paramNames = null;
List allNames = Utility.getAllParameters( );
names.add( Messages.getString( "DataSetParametersPage.reportParam.None" ) );
for ( int i = 0; i < allNames.size( ); i++ )
{
ReportElementHandle handle = (ReportElementHandle) allNames.get( i );
if ( handle instanceof ScalarParameterHandle
//now multi-value type report parameter can also be linked with data set parameter now
//at runtime, only the first provided value is passed into data set
/*&& !( DesignChoiceConstants.SCALAR_PARAM_TYPE_MULTI_VALUE.equals( ( (ScalarParameterHandle) handle ).getParamType( ) ) )*/ )
{
names.add( handle.getQualifiedName( ) );
}
}
paramNames = new String[names.size( )];
for ( int i = 0; i < names.size( ); i++ )
{
paramNames[i] = names.get( i ).toString( );
}
return paramNames;
}
示例14: handleLinkedMultipleValuesReportParam
import org.eclipse.birt.report.model.api.ScalarParameterHandle; //导入依赖的package包/类
private void handleLinkedMultipleValuesReportParam( OdaDataSetParameter dsParam )
{
if ( dsParam.getParamName( ) == null )
return;
ScalarParameterHandle paramHandle = ParameterPageUtil.getScalarParameter( dsParam.getParamName( ),
true );
if ( paramHandle != null )
{
if ( DesignChoiceConstants.SCALAR_PARAM_TYPE_MULTI_VALUE.equals( paramHandle.getParamType( ) ) )
{
MessageDialog.openWarning( Workbench.getInstance( )
.getDisplay( )
.getActiveShell( ),
Messages.getString( "DataSetParameterPage.warningLinkedMultipleValuesParams.title" ),
getWarning( dsParam ) );
}
}
}
示例15: getLinkedReportParameterLabel
import org.eclipse.birt.report.model.api.ScalarParameterHandle; //导入依赖的package包/类
protected String getLinkedReportParameterLabel( OdaDataSetParameter parameter )
{
String value = parameter.getParamName( );
if ( value != null )
{
ScalarParameterHandle reportParam = ParameterPageUtil.getScalarParameter( parameter.getParamName( ),
true );
if ( reportParam != null )
{
if ( DesignChoiceConstants.SCALAR_PARAM_TYPE_MULTI_VALUE.equals( reportParam.getParamType( ) ) )
{
value += (" (" + Messages.getString("DataSetParameterPage.multiValuesType") + ")");
}
}
}
if ( value == null || value.trim( ).length( ) == 0 )
value = UNLINKED_REPORT_PARAM;
return value;
}