當前位置: 首頁>>代碼示例>>Java>>正文


Java ScalarParameterHandle類代碼示例

本文整理匯總了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;
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:17,代碼來源:ParameterDropAdapter.java

示例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$
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:30,代碼來源:Regression_118006.java

示例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$
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:24,代碼來源:Regression_134213.java

示例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 );

}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:21,代碼來源:DataSetParameterChecker.java

示例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( );
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:30,代碼來源:DataSetParameterUpdater.java

示例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 );

}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:21,代碼來源:ReportParamChecker.java

示例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 );

}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:24,代碼來源:ReportParamChecker.java

示例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 );

}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:30,代碼來源:ReportParamChecker.java

示例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$
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:30,代碼來源:ParameterGroupTest.java

示例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( ) ) );
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:26,代碼來源:DesignElementTest.java

示例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( ) );
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:33,代碼來源:ReportTag.java

示例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;
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:32,代碼來源:ParameterPageUtil.java

示例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;
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:27,代碼來源:DataSetParametersPage.java

示例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 ) );

		}
	}

}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:21,代碼來源:DataSetParametersPage.java

示例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;
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:20,代碼來源:DataSetParametersPage.java


注:本文中的org.eclipse.birt.report.model.api.ScalarParameterHandle類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。