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


Java IntegerFieldEditor.setTextLimit方法代码示例

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


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

示例1: 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

示例2: createIntegerFieldEditor

import org.eclipse.jface.preference.IntegerFieldEditor; //导入方法依赖的package包/类
protected IntegerFieldEditor createIntegerFieldEditor(final String name, final String label, final Composite parent, final FieldEditorDetails details) {
	final IntegerFieldEditor fieldEditor = new IntegerFieldEditor(name, label, parent);
	if (details != null) {
		if (details.getEmptyStringAllowed() != null) {
			fieldEditor.setEmptyStringAllowed(details.getEmptyStringAllowed());
		}
		if (details.getNumberMinimum() != null && details.getNumberMaximum() != null) {
			fieldEditor.setValidRange(details.getNumberMinimum().intValue(), details.getNumberMaximum().intValue());
			fieldEditor.setTextLimit(Math.max(Integer.toString(details.getNumberMaximum().intValue()).length(), Integer.toString(details.getNumberMinimum().intValue()).length()));
		}
		if (details.getTextLimit() != null) {
			fieldEditor.setTextLimit(details.getTextLimit());
		}
	}
	return fieldEditor;
}
 
开发者ID:Albertus82,项目名称:JFaceUtils,代码行数:17,代码来源:FieldEditorFactory.java

示例3: 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

示例4: 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

示例5: 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


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