当前位置: 首页>>代码示例>>Java>>正文


Java Assert.isNotNull方法代码示例

本文整理汇总了Java中org.eclipse.jface.util.Assert.isNotNull方法的典型用法代码示例。如果您正苦于以下问题:Java Assert.isNotNull方法的具体用法?Java Assert.isNotNull怎么用?Java Assert.isNotNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.util.Assert的用法示例。


在下文中一共展示了Assert.isNotNull方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: save

import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
public static boolean save(IEditorPart editorPart, GraphicalViewer viewer,
		String saveFilePath, int format) {
	Assert.isNotNull(editorPart,
			"null editorPart passed to ImageSaveUtil::save");
	Assert.isNotNull(viewer, "null viewer passed to ImageSaveUtil::save");
	Assert.isNotNull(saveFilePath,
			"null saveFilePath passed to ImageSaveUtil::save");

	if (format != SWT.IMAGE_BMP && format != SWT.IMAGE_JPEG
			&& format != SWT.IMAGE_PNG && format != SWT.IMAGE_GIF)
		throw new IllegalArgumentException("Save format not supported");

	try {
		saveEditorContentsAsImage(editorPart, viewer, saveFilePath, format);
	} catch (Exception ex) {
		MessageDialog.openError(editorPart.getEditorSite().getShell(),
				"Save Error", "Could not save editor contents");
		return false;
	}

	return true;
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:23,代码来源:ImageSaveUtil.java

示例2: save

import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
public static boolean save(IEditorPart editorPart, GraphicalViewer viewer) {
	Assert.isNotNull(editorPart, "null editorPart passed to ImageSaveUtil::save");
	Assert.isNotNull(viewer, "null viewer passed to ImageSaveUtil::save");

	String saveFilePath = getSaveFilePath(editorPart, viewer, -1);
	if (saveFilePath == null)
		return false;
	int format = SWT.IMAGE_JPEG;
	if (saveFilePath.endsWith(".jpeg"))
		format = SWT.IMAGE_JPEG;
	else if (saveFilePath.endsWith(".bmp"))
		format = SWT.IMAGE_BMP;
	// else if (saveFilePath.endsWith(".ico"))
	// format = SWT.IMAGE_ICO;
	return save(editorPart, viewer, saveFilePath, format);
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:17,代码来源:ImageSaveUtil.java

示例3: okPressed

import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
/**
 * (non-Javadoc)
 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
 */
@SuppressWarnings("deprecation")
@Override
protected void okPressed() {
	if (validateValue()) {
		this.searEntry.setSearchName(nameText.getText());
		if (style == ADD) {
			this.searEntry.setDefault(false);
		}
		this.searEntry.setSearchUrl(urlText.getText());
		this.searEntry.setChecked(btnYesRadioButton.getSelection());
		Assert.isNotNull(handler, "OKhandler can not be null");
		if (!handler.doOk()) {
			return;
		}
	}
	super.okPressed();
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:22,代码来源:AddSearchEntryDialog.java

示例4: CompareDialog

import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
public CompareDialog(Shell shell, CompareEditorInput input) {
	super(shell);
	setShellStyle(getShellStyle() | SWT.RESIZE | SWT.MAX);
	
	Assert.isNotNull(input);
	compareEditorInput= input;

	settings = SVNUIPlugin.getPlugin().getDialogSettings();
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:10,代码来源:CompareDialog.java

示例5: setItems

import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
/**
 * Sets the list of choices for the combo box
 * 
 * @param items
 *            the list of choices for the combo box
 */
public void setItems( String[] items )
{
	Assert.isNotNull( items );
	this.items = items;
	populateComboBoxItems( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:13,代码来源:ParameterComboCellEditor.java

示例6: updateFigure

import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
public void updateFigure( ExtendedItemHandle handle, IFigure figure )
{
	Assert.isNotNull( handle );
	( (LabelFigure) figure ).setText( handle.getProperty( TEST_PROPERTY[0] )
			+ ":"
			+ handle.getProperty( TEST_PROPERTY[1] ).toString( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:8,代码来源:TestingMatrixUI.java

示例7: getColumnExpression

import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
/**
 * Create a row expression base on a binding column name.
 * 
 * @param columnName
 *            the column name
 * @return the expression, or null if the column name is blank.
 */
public static String getColumnExpression( String columnName )
{
	Assert.isNotNull( columnName );
	if ( StringUtil.isBlank( columnName ) )
	{
		return null;
	}
	return ExpressionUtil.createJSRowExpression( columnName );//$NON-NLS-1$ //$NON-NLS-2$
}
 
开发者ID:eclipse,项目名称:birt,代码行数:17,代码来源:Utility.java

示例8: AbstractGlobalSelectionAction

import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
protected AbstractGlobalSelectionAction( ISelectionProvider provider, String id )
{
	super( null );
	Assert.isNotNull( provider );
	setId( id );
	setSelectionProvider( provider );
	provider.addSelectionChangedListener( new ISelectionChangedListener( ) {

		public void selectionChanged( SelectionChangedEvent event )
		{
			update( );
		}
	} );
	setLazyEnablementCalculation( true );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:16,代码来源:AbstractGlobalSelectionAction.java

示例9: PaletteCategory

import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
/**
 * 
 * 
 * @param name
 * @param displayLabellabel
 * @param icon
 */
public PaletteCategory( String name, String displayLabel,
		ImageDescriptor icon )
{
	super( displayLabel, icon );
	Assert.isNotNull( name );
	this.name = name;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:15,代码来源:PaletteCategory.java

示例10: ColumnsDescription

import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
public ColumnsDescription( ColumnLayoutData[] columns,
		String[] headers, boolean drawLines )
{
	Assert.isNotNull( columns );
	this.columns = columns;
	this.headers = headers;
	this.drawLines = drawLines;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:9,代码来源:LayoutTable.java

示例11: TableArea

import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
public TableArea( Composite parent, int tableStyle,
		IBaseTableAreaModifier modifier )
{
	super( parent, SWT.NONE );
	Assert.isNotNull( modifier );
	setLayout( UIUtil.createGridLayoutWithoutMargin( 2, false ) );
	this.modifier = modifier;
	createTableViewer( tableStyle );
	createButtonBar( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:11,代码来源:TableArea.java

示例12: generateComputedColumns

import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
/**
 * Generate computed columns for the given report item with the closest data
 * set available.
 * 
 * @param handle
 *            the handle of the report item
 * 
 * @return true if succeed,or fail if no column generated.
 */
public static List generateComputedColumns( ReportItemHandle handle )
		throws SemanticException
{
	Assert.isNotNull( handle );
	DataSetHandle dataSetHandle = handle.getDataSet( );
	if ( dataSetHandle == null )
	{
		dataSetHandle = DEUtil.getBindingHolder( handle ).getDataSet( );
	}
	if ( dataSetHandle != null )
	{
		List resultSetColumnList = getColumnList( dataSetHandle );
		ArrayList columnList = new ArrayList( );
		String groupType = DEUtil.getGroupControlType( handle );
		List groupList = DEUtil.getGroups( handle );
		for ( Iterator iter = resultSetColumnList.iterator( ); iter.hasNext( ); )
		{
			ResultSetColumnHandle resultSetColumn = (ResultSetColumnHandle) iter.next( );
			ComputedColumn column = StructureFactory.createComputedColumn( );
			column.setName( resultSetColumn.getColumnName( ) );
			column.setDataType( resultSetColumn.getDataType( ) );
			ExpressionUtility.setBindingColumnExpression( resultSetColumn,
					column );
			if ( ExpressionUtil.hasAggregation( column.getExpression( ) ) )
			{
				if ( groupType.equals( DEUtil.TYPE_GROUP_GROUP ) )
					column.setAggregateOn( ( (GroupHandle) groupList.get( 0 ) ).getName( ) );
				else if ( groupType.equals( DEUtil.TYPE_GROUP_LISTING ) )
					column.setAggregateOn( null );
			}
			columnList.add( column );
		}
		return columnList;
	}
	return Collections.EMPTY_LIST;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:46,代码来源:DataUtil.java

示例13: setLabelText

import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
/**
 * Sets this field editor's label text. The label is typically presented to
 * the left of the entry field.
 * 
 * @param text
 *            the label text
 */
public void setLabelText( String text )
{
	Assert.isNotNull( text );
	labelText = text;
	if ( displayLabel != null )
	{
		displayLabel.setText( text );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:17,代码来源:Section.java

示例14: NonRuleBasedDamagerRepairer

import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
/**
 * Constructor for NonRuleBasedDamagerRepairer.
 */
public NonRuleBasedDamagerRepairer(TextAttribute defaultTextAttribute) {
	Assert.isNotNull(defaultTextAttribute);

	fDefaultTextAttribute = defaultTextAttribute;
}
 
开发者ID:nextinterfaces,项目名称:http4e,代码行数:9,代码来源:NonRuleBasedDamagerRepairer.java

示例15: performInsert

import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
/**
 * Creates a object to insert.
 * 
 * @param insertObj
 *            object insert to layout
 * @param target
 *            insert target, like cell or ListBandProxy
 * @param targetParent
 *            insert target's non-dummy container, like table or list
 * @return new object in layout
 * @throws SemanticException
 */
public static DesignElementHandle performInsert( Object insertObj,
		Object target, Object targetParent ) throws SemanticException
{
	Assert.isNotNull( insertObj );
	Assert.isNotNull( target );
	if ( insertObj instanceof DataSetHandle )
	{
		return performInsertDataSet( (DataSetHandle) insertObj );
	}
	else if ( insertObj instanceof ResultSetColumnHandle )
	{
		return performInsertDataSetColumn( (ResultSetColumnHandle) insertObj,
				target,
				targetParent );
	}
	else if ( insertObj instanceof MeasureHandle )
	{
		return performInsertLinkedDataModelMeasure( (MeasureHandle) insertObj,
				target,
				(ReportItemHandle)targetParent );
	}
	else if ( insertObj instanceof ScalarParameterHandle )
	{
		return performInsertParameter( (ScalarParameterHandle) insertObj );
	}
	else if ( insertObj instanceof VariableElementHandle )
	{
		return performInsertVariable( (VariableElementHandle) insertObj );
	}
	else if ( insertObj instanceof String )
	{
		// Such as invalid group key
		return performInsertString( (String) insertObj, target );
	}
	else if ( insertObj instanceof Object[] )
	{
		return performMultiInsert( (Object[]) insertObj,
				target,
				targetParent );
	}
	else if ( insertObj instanceof IStructuredSelection )
	{
		return performMultiInsert( ( (IStructuredSelection) insertObj ).toArray( ),
				target,
				targetParent );
	}
	return null;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:61,代码来源:InsertInLayoutUtil.java


注:本文中的org.eclipse.jface.util.Assert.isNotNull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。