本文整理汇总了Java中org.eclipse.jface.util.Assert.isTrue方法的典型用法代码示例。如果您正苦于以下问题:Java Assert.isTrue方法的具体用法?Java Assert.isTrue怎么用?Java Assert.isTrue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.util.Assert
的用法示例。
在下文中一共展示了Assert.isTrue方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ComboBoxMeasureFieldEditor
import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
/**
* Constructs new instance width value choice and measure choice field
* editor. Put the editor working in Combo Mode.
*
* @param prop_name
* preference name of the field editor
* @param labelText
* label text of the preference
* @param entryNamesAndValues
* names and values list for entry Combo
* @param measureNamesAndValues
* names and values list for measure Combo
* @param parent
* parent Composite of field editors
*/
public ComboBoxMeasureFieldEditor( String prop_name, String labelText,
String[][] entryNamesAndValues, String[][] measureNamesAndValues,
Composite parent )
{
hasChoice = true;
init( prop_name, labelText );
Assert.isTrue( checkArray( entryNamesAndValues ) );
Assert.isTrue( checkArray( measureNamesAndValues ) );
fBoxNamesAndValues = entryNamesAndValues;
fMeasureNamesAndValues = measureNamesAndValues;
this.parent = parent;
createControl( parent );
}
示例2: doSetValue
import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
@Override
protected void doSetValue(Object value) {
if (value == null) {
value = ""; //$NON-NLS-1$
}
Assert.isTrue(text != null && (value instanceof String));
text.setText((String) value);
}
示例3: doSetValue
import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
/**
* The <code>TextCellEditor</code> implementation of this
* <code>CellEditor</code> framework method accepts a text string (type
* <code>String</code>).
*
* @param value
* a text string (type <code>String</code>)
*/
protected void doSetValue( Object value )
{
Assert.isTrue( text != null && (value == null || value instanceof String ) );
text.removeModifyListener( getModifyListener( ) );
if(value == null)
{
text.setText( "" );
}else
{
text.setText( (String) value );
}
text.addModifyListener( getModifyListener( ) );
}
示例4: insert
import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
public void insert( Object object ) throws SemanticException
{
Assert.isTrue( object instanceof DesignElementHandle );
newTarget.addElement( (DesignElementHandle) object,
CellHandle.CONTENT_SLOT );
}
示例5: ComboFieldEditor
import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
public ComboFieldEditor(String name, String labelText, String[][] entryNamesAndValues, Composite parent) {
init(name, labelText);
Assert.isTrue(checkArray(entryNamesAndValues));
fEntryNamesAndValues= entryNamesAndValues;
createControl(parent);
}
示例6: setValidateStrategy
import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
/**
* Sets the strategy for validating the text.
* <p>
* Calling this method has no effect after <code>createPartControl</code>
* is called. Thus this method is really only useful for subclasses to call
* in their constructor. However, it has public visibility for backward
* compatibility.
* </p>
*
* @param value
* either <code>VALIDATE_ON_KEY_STROKE</code> to perform on the
* fly checking (the default), or
* <code>VALIDATE_ON_FOCUS_LOST</code> to perform validation
* only after the text has been typed in
*/
public void setValidateStrategy( int value )
{
Assert.isTrue( value == VALIDATE_ON_FOCUS_LOST
|| value == VALIDATE_ON_KEY_STROKE );
validateStrategy = value;
}
示例7: EditableComboFieldEditor
import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
/**
* Creates a editable combo field editor.
*
* @param name
* the name of the preference this field editor works on
* @param labelText
* the label text of the field editor
* @param entryNamesAndValues
* the entry name and value choices of the combox of the field
* editor
* @param parent
* the parent of the field editor's control
*/
public EditableComboFieldEditor( String name, String labelText,
String[][] entryNamesAndValues, Composite parent )
{
init( name, labelText );
Assert.isTrue( checkArray( entryNamesAndValues ) );
fEntryNamesAndValues = entryNamesAndValues;
createControl( parent );
}
示例8: checkParent
import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
/**
* Checks if the given parent is the current parent of the supplied control;
* throws an (unchecked) exception if they are not correctly related.
*
* @param control
* the control
* @param parent
* the parent control
*/
protected void checkParent( Control control, Composite parent )
{
Assert.isTrue( control.getParent( ) == parent, "Different parents" );//$NON-NLS-1$
}
示例9: setValidateStrategy
import org.eclipse.jface.util.Assert; //导入方法依赖的package包/类
/**
* Sets the strategy for validating the text.
* <p>
* Calling this method has no effect after <code>createPartControl</code>
* is called. Thus this method is really only useful for subclasses to call
* in their constructor. However, it has public visibility for backward
* compatibility.
* </p>
*
* @param value either <code>VALIDATE_ON_KEY_STROKE</code> to perform
* on the fly checking (the default), or <code>VALIDATE_ON_FOCUS_LOST</code> to
* perform validation only after the text has been typed in
*/
public void setValidateStrategy(int value) {
Assert.isTrue(
value == VALIDATE_ON_FOCUS_LOST || value == VALIDATE_ON_KEY_STROKE);
validateStrategy = value;
}
开发者ID:tmorcinek,项目名称:android-codegenerator-plugin-eclipse,代码行数:19,代码来源:MultiLineTextFieldEditor.java