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


Java IntegerFieldEditor.setValidateStrategy方法代码示例

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


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

示例1: createFieldEditors

import org.eclipse.jface.preference.IntegerFieldEditor; //导入方法依赖的package包/类
/**
    * Creates the page components.
 */
protected void createFieldEditors() {
       TexlipsePreferencePage.addSpacer(getFieldEditorParent());
       addField(new BooleanFieldEditor(TexlipseProperties.INDENTATION, TexlipsePlugin.getResourceString("preferenceIndentEnabledLabel"), getFieldEditorParent()));

       String message = TexlipsePlugin.getResourceString("preferenceIndentLevelLabel").replaceFirst("%1", "" + MIN_INDENTATION).replaceFirst("%2", "" + MAX_INDENTATION);
       final IntegerFieldEditor indentationWidth = new IntegerFieldEditor(TexlipseProperties.INDENTATION_LEVEL, message, getFieldEditorParent());
       indentationWidth.setValidateStrategy(IntegerFieldEditor.VALIDATE_ON_KEY_STROKE);
       indentationWidth.setValidRange(MIN_INDENTATION, MAX_INDENTATION);
       if (TexlipsePlugin.getDefault().getPreferenceStore().getBoolean(TexlipseProperties.INDENTATION_TABS)) {
           indentationWidth.setEnabled(false, getFieldEditorParent());
       }
       addField(indentationWidth);
	
       BooleanFieldEditor indentationTabs = new BooleanFieldEditor(TexlipseProperties.INDENTATION_TABS, TexlipsePlugin.getResourceString("preferenceIndentTabsLabel"), getFieldEditorParent()){
	  @Override
	    protected void valueChanged(boolean oldValue, boolean newValue) {
	        super.valueChanged(oldValue, newValue);
	        if (newValue == true) indentationWidth.setEnabled(false, getFieldEditorParent());
	        else indentationWidth.setEnabled(true, getFieldEditorParent());
	    }  
	};
       addField(indentationTabs);
       TexlipsePreferencePage.addSpacer(getFieldEditorParent());
       addField(new StringListFieldEditor(TexlipseProperties.INDENTATION_ENVS, TexlipsePlugin.getResourceString("preferenceIndentEnvsLabel"), getFieldEditorParent()));
}
 
开发者ID:eclipse,项目名称:texlipse,代码行数:29,代码来源:IndentationPreferencePage.java

示例2: createPollChangesIntervalGroup

import org.eclipse.jface.preference.IntegerFieldEditor; //导入方法依赖的package包/类
private void createPollChangesIntervalGroup(Composite composite) {
	Composite groupComposite = new Composite(composite, SWT.LEFT);
	GridLayout layout = new GridLayout();
	layout.numColumns = 2;
	groupComposite.setLayout(layout);
	GridData gd = new GridData();
	gd.horizontalAlignment = GridData.FILL;
	gd.grabExcessHorizontalSpace = true;
	groupComposite.setLayoutData(gd);

	pollChangesInterval = new IntegerFieldEditor(POLL_CHANGES_INTERVAL_PREF, "Poll changes interval (seconds)",
			groupComposite);

	pollChangesInterval.setTextLimit(Integer.toString(MAX_POLL_CHANGES_INTERVAL).length());
	pollChangesInterval.setErrorMessage("The workspace save interval should be between 30 and 9999.");
	pollChangesInterval.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
	pollChangesInterval.setValidRange(MIN_POLL_CHANGES_INTERVAL, MAX_POLL_CHANGES_INTERVAL);
	pollChangesInterval.setPropertyChangeListener(event -> {
		if (event.getProperty().equals(FieldEditor.IS_VALID)) {
			setValid(pollChangesInterval.isValid());
		}
	});
	addField(pollChangesInterval);
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:25,代码来源:GDriveBookmarksStorePreferencePage.java

示例3: createFieldEditors

import org.eclipse.jface.preference.IntegerFieldEditor; //导入方法依赖的package包/类
/**
 * Creates the field editors. Field editors are abstractions of the common GUI blocks needed to manipulate various types of preferences. Each field editor knows how to save and restore itself.
 */
@Override
public void createFieldEditors ()
{
    final IntegerFieldEditor fieldEditor = new IntegerFieldEditor ( PreferenceConstants.P_DEFAULT_CHUNK_SIZE, "&Default chunk size:", getFieldEditorParent () );
    fieldEditor.setEmptyStringAllowed ( false );
    fieldEditor.setValidRange ( 1, Integer.MAX_VALUE );
    fieldEditor.setValidateStrategy ( StringFieldEditor.VALIDATE_ON_KEY_STROKE );

    addField ( fieldEditor );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:14,代码来源:ImportPreferencePage.java

示例4: createFieldEditors

import org.eclipse.jface.preference.IntegerFieldEditor; //导入方法依赖的package包/类
/**
 * Creates the field editors. Field editors are abstractions of
 * the common GUI blocks needed to manipulate various types
 * of preferences. Each field editor knows how to save and
 * restore itself.
 */
public void createFieldEditors() {
    TexlipsePreferencePage.addSpacer(3, getFieldEditorParent());
    addField(new BooleanFieldEditor(TexlipseProperties.BIB_COMPLETION, TexlipsePlugin.getResourceString("preferenceBibCompletion"), getFieldEditorParent()));
    String message = TexlipsePlugin.getResourceString("preferenceBibCompletionDelay").replaceFirst("%1", "" + MIN_DELAY).replaceFirst("%2", "" + MAX_DELAY);
    IntegerFieldEditor delay = new IntegerFieldEditor(TexlipseProperties.BIB_COMPLETION_DELAY, message, getFieldEditorParent());
    delay.setValidateStrategy(IntegerFieldEditor.VALIDATE_ON_KEY_STROKE);
    delay.setValidRange(MIN_DELAY, MAX_DELAY);
    addField(delay);
    
    addField(new BooleanFieldEditor(TexlipseProperties.BIB_CODE_FOLDING, TexlipsePlugin.getResourceString("preferenceBibCodeFolding"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(TexlipseProperties.BIB_FOLD_INITIAL, TexlipsePlugin.getResourceString("preferenceBibFoldInitial"), getFieldEditorParent()));
    //addField(new BooleanFieldEditor(TexlipseProperties.BIB_STRING, TexlipsePlugin.getResourceString("preferenceBibString"), getFieldEditorParent()));        
    //addField(new BooleanFieldEditor(TexlipseProperties.BIB_FREQSORT, TexlipsePlugin.getResourceString("preferenceBibFreqSort"), getFieldEditorParent()));
}
 
开发者ID:eclipse,项目名称:texlipse,代码行数:21,代码来源:BibtexPreferencePage.java

示例5: createFieldEditors

import org.eclipse.jface.preference.IntegerFieldEditor; //导入方法依赖的package包/类
/**
    * Creates the page components.
 */
protected void createFieldEditors() {
       
       TexlipsePreferencePage.addSpacer(2, getFieldEditorParent());
       ViewerListFieldEditor vfe = new ViewerListFieldEditor(TexlipsePlugin.getResourceString("preferenceViewerConfigsLabel"), getFieldEditorParent());
       addField(vfe);
       WorkbenchHelp.setHelp(vfe.getListControl(getFieldEditorParent()), TexlipseHelpIds.VIEWER_LIST);

       // Depricated. Eclipse has it's own mechanism for auto rebuild.
       //TexlipsePreferencePage.addSpacer(2, getFieldEditorParent());
       //TexlipsePreferencePage.addSeparator(2, getFieldEditorParent());
       //addField(new BooleanFieldEditor(TexlipseProperties.BUILD_BEFORE_VIEW, TexlipsePlugin.getResourceString("preferenceViewerBuildLabel"), getFieldEditorParent()));
       
       TexlipsePreferencePage.addSpacer(2, getFieldEditorParent());
       TexlipsePreferencePage.addSeparator(2, getFieldEditorParent());
       
       TexlipsePreferencePage.addSpacer(2, getFieldEditorParent());
       TexlipsePreferencePage.addLabelField(2, TexlipsePlugin.getResourceString("preferenceViewerPortLabel"), getFieldEditorParent());
       String message = TexlipsePlugin.getResourceString("preferenceViewerConfigsPort").replaceFirst("%1", "" + MIN_PORT).replaceFirst("%2", "" + MAX_PORT);
       IntegerFieldEditor port = new IntegerFieldEditor(TexlipseProperties.FILE_LOCATION_PORT, message, getFieldEditorParent());
       port.setValidateStrategy(IntegerFieldEditor.VALIDATE_ON_KEY_STROKE);
       port.setValidRange(MIN_PORT, MAX_PORT);
       addField(port);
       
       addField(new BooleanFieldEditor(TexlipseProperties.BUILDER_FORCE_RETURN_FOCUS, TexlipsePlugin.getResourceString("forceReturnFocusOnInverseSearch"), getFieldEditorParent()));
       
       addField(new BooleanFieldEditor(TexlipseProperties.BUILDER_RETURN_FOCUS, TexlipsePlugin.getResourceString("preferenceViewerReturnFocusLabel"), getFieldEditorParent()));
       
       WorkbenchHelp.setHelp(port.getTextControl(getFieldEditorParent()), TexlipseHelpIds.VIEWER_PORT);
   }
 
开发者ID:eclipse,项目名称:texlipse,代码行数:33,代码来源:ViewerSettingsPreferencePage.java

示例6: createFieldEditors

import org.eclipse.jface.preference.IntegerFieldEditor; //导入方法依赖的package包/类
@Override
protected void createFieldEditors() {
  portField = new IntegerFieldEditor(PORT, "Port number: ", getFieldEditorParent(), 5);
  portField.setValidRange(1, 65536);
  portField.setValidateStrategy(IntegerFieldEditor.VALIDATE_ON_FOCUS_LOST);
  portField.setErrorMessage(String.format("Port number is not valid valid (1-65536).", portField.getStringValue()));
  addField(portField);

  final String[][] entries = new String[][] { //
  new String[] { "On", Boolean.TRUE.toString() }, //
      new String[] { "Off", Boolean.FALSE.toString() } };

  enabledField = new ComboFieldEditor(ENABLED, "Switch ON/OFF", entries, getFieldEditorParent());
  addField(enabledField);
}
 
开发者ID:k0ner,项目名称:olv-eclipse-integration,代码行数:16,代码来源:OLVPreferencePage.java

示例7: createBacklogField

import org.eclipse.jface.preference.IntegerFieldEditor; //导入方法依赖的package包/类
private void createBacklogField(Composite composite) {
	backlogEditor = new IntegerFieldEditor(ILogViewerConstants.PREF_BACKLOG,LogViewerPlugin.getResourceString("preferences.backlog.label.text"),composite); //$NON-NLS-1$
	backlogEditor.setPreferenceStore(doGetPreferenceStore());
	backlogEditor.setPage(this);
	backlogEditor.setTextLimit(Integer.toString(ILogViewerConstants.MAX_BACKLOG).length());
	backlogEditor.setErrorMessage(LogViewerPlugin.getResourceString("preferences.backlog.label.errortext",new Object[]{new Integer(ILogViewerConstants.MAX_BACKLOG)})); //$NON-NLS-1$
	backlogEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
	backlogEditor.setValidRange(0,ILogViewerConstants.MAX_BACKLOG);
	backlogEditor.load();
	backlogEditor.setPropertyChangeListener(validityChangeListener);
}
 
开发者ID:anb0s,项目名称:LogViewer,代码行数:12,代码来源:LogViewerPreferences.java

示例8: createReadBufferField

import org.eclipse.jface.preference.IntegerFieldEditor; //导入方法依赖的package包/类
private void createReadBufferField(Composite composite) {
	bufferEditor = new IntegerFieldEditor(ILogViewerConstants.PREF_BUFFER,LogViewerPlugin.getResourceString("preferences.buffer.label.text"),composite); //$NON-NLS-1$
	bufferEditor.setPreferenceStore(doGetPreferenceStore());
	bufferEditor.setPage(this);
	bufferEditor.setTextLimit(Integer.toString(ILogViewerConstants.MAX_TAIL_BUFFER_SIZE).length());
	bufferEditor.setErrorMessage(LogViewerPlugin.getResourceString("preferences.buffer.label.errortext",new Object[]{new Integer(ILogViewerConstants.MAX_TAIL_BUFFER_SIZE)})); //$NON-NLS-1$
	bufferEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
	bufferEditor.setValidRange(0,ILogViewerConstants.MAX_TAIL_BUFFER_SIZE);
	bufferEditor.load();
	bufferEditor.setPropertyChangeListener(validityChangeListener);
}
 
开发者ID:anb0s,项目名称:LogViewer,代码行数:12,代码来源:LogViewerPreferences.java

示例9: createReadWaitField

import org.eclipse.jface.preference.IntegerFieldEditor; //导入方法依赖的package包/类
private void createReadWaitField(Composite composite) {
	readWaitEditor = new IntegerFieldEditor(ILogViewerConstants.PREF_READWAIT,LogViewerPlugin.getResourceString("preferences.readwait.label.text"),composite); //$NON-NLS-1$
	readWaitEditor.setPreferenceStore(doGetPreferenceStore());
	readWaitEditor.setPage(this);
	readWaitEditor.setTextLimit(Integer.toString(ILogViewerConstants.MAX_READWAIT_SIZE).length());
	readWaitEditor.setErrorMessage(LogViewerPlugin.getResourceString("preferences.readwait.label.errortext",new Object[]{new Integer(ILogViewerConstants.MAX_READWAIT_SIZE)})); //$NON-NLS-1$
	readWaitEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
	readWaitEditor.setValidRange(0,ILogViewerConstants.MAX_READWAIT_SIZE);
	readWaitEditor.load();
	readWaitEditor.setPropertyChangeListener(validityChangeListener);
}
 
开发者ID:anb0s,项目名称:LogViewer,代码行数:12,代码来源:LogViewerPreferences.java

示例10: createIntegerFieldEditor

import org.eclipse.jface.preference.IntegerFieldEditor; //导入方法依赖的package包/类
private IntegerFieldEditor createIntegerFieldEditor(String propertyName, String label, Composite parent) {
	IntegerFieldEditor integerFieldEditor = new IntegerFieldEditor(propertyName, label, parent, 2);
	integerFieldEditor.setPreferenceStore(PREFERENCE_STORE);
	integerFieldEditor.load();
	integerFieldEditor.setValidRange(0, 23);
	integerFieldEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
	return integerFieldEditor;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:9,代码来源:MissionTimePreferencePage.java

示例11: createContents

import org.eclipse.jface.preference.IntegerFieldEditor; //导入方法依赖的package包/类
protected Control createContents( Composite parent )
	{
		UIUtil.bindHelp( parent,
				IHelpContextIds.PREFERENCE_BIRT_PREVIEW_DATA_ID );

		Composite cmpTop = new Composite( parent, SWT.NONE );
		GridLayout layout = new GridLayout( 1, false );
		cmpTop.setLayout( layout );
		GridData gd = new GridData( GridData.FILL_HORIZONTAL );
		cmpTop.setLayoutData( gd );

		createDispalyRowLimitGroup( cmpTop );

//		txtMaxRowLevelMember = new IntegerFieldEditor( PREVIEW_MAX_ROW_LEVEL_MEMBER,
//				Messages.getString( "designer.preview.preference.resultset.maxrowlevelmember.description" ), cmpTop ); //$NON-NLS-1$ 
//		txtMaxRowLevelMember.setPage( this );
//		txtMaxRowLevelMember.setValidateStrategy( StringFieldEditor.VALIDATE_ON_KEY_STROKE );
//		txtMaxRowLevelMember.setEmptyStringAllowed( false );
//		txtMaxRowLevelMember.setPropertyChangeListener( new IPropertyChangeListener( ) {
//
//			public void propertyChange( PropertyChangeEvent event )
//			{
//				if ( event.getProperty( ).equals( FieldEditor.IS_VALID ) )
//					setValid( txtMaxRowLevelMember.isValid( ) );
//			}
//		} );
//		
//		txtMaxColumnLevelMember = new IntegerFieldEditor( PREVIEW_MAX_COLUMN_LEVEL_MEMBER,
//				Messages.getString( "designer.preview.preference.resultset.maxcolumnlevelmember.description" ), cmpTop ); //$NON-NLS-1$ 
//		txtMaxColumnLevelMember.setPage( this );
//		txtMaxColumnLevelMember.setValidateStrategy( StringFieldEditor.VALIDATE_ON_KEY_STROKE );
//		txtMaxColumnLevelMember.setEmptyStringAllowed( false );
//		txtMaxColumnLevelMember.setPropertyChangeListener( new IPropertyChangeListener( ) {
//
//			public void propertyChange( PropertyChangeEvent event )
//			{
//				if ( event.getProperty( ).equals( FieldEditor.IS_VALID ) )
//					setValid( txtMaxColumnLevelMember.isValid( ) );
//			}
//		} );

		txtMaxInMemoryCubeSize = new IntegerFieldEditor( PREVIEW_MAX_IN_MEMORY_CUBE_SIZE,
				Messages.getString( "designer.preview.preference.resultset.maxinmemorycubesize.description" ), cmpTop ); //$NON-NLS-1$ 
		txtMaxInMemoryCubeSize.setPage( this );
		txtMaxInMemoryCubeSize.setValidateStrategy( StringFieldEditor.VALIDATE_ON_KEY_STROKE );
		txtMaxInMemoryCubeSize.setEmptyStringAllowed( false );
		txtMaxInMemoryCubeSize.setPropertyChangeListener( new IPropertyChangeListener( ) {

			public void propertyChange( PropertyChangeEvent event )
			{
				if ( event.getProperty( ).equals( FieldEditor.IS_VALID ) )
					setValid( txtMaxInMemoryCubeSize.isValid( ) );
			}
		} );

		initControlValues( );

		return cmpTop;
	}
 
开发者ID:eclipse,项目名称:birt,代码行数:60,代码来源:PreviewDataPreferencePage.java


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