Java Code Examples for org.eclipse.jface.preference.IntegerFieldEditor#setTextLimit()

The following examples show how to use org.eclipse.jface.preference.IntegerFieldEditor#setTextLimit() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LogViewerPreferences.java    From LogViewer with Eclipse Public License 2.0 5 votes vote down vote up
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);
}
 
Example 2
Source File: LogViewerPreferences.java    From LogViewer with Eclipse Public License 2.0 5 votes vote down vote up
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);
}
 
Example 3
Source File: LogViewerPreferences.java    From LogViewer with Eclipse Public License 2.0 5 votes vote down vote up
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);
}