mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 10:46:02 +02:00
Bug 378691 - [terminal][api] Terminal Preferences should be maintained in the Widget (for font, invert, and buffer)
This commit is contained in:
parent
4d63c4eb51
commit
8ac4e01b61
2 changed files with 0 additions and 121 deletions
|
@ -1,31 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2006, 2007 Wind River Systems, Inc. and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* Michael Scharf (Wind River) - initial API and implementation
|
|
||||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
|
||||||
*******************************************************************************/
|
|
||||||
package org.eclipse.tm.internal.terminal.view;
|
|
||||||
|
|
||||||
import org.eclipse.core.runtime.Preferences;
|
|
||||||
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
|
|
||||||
|
|
||||||
public class TerminalPreferenceInitializer extends AbstractPreferenceInitializer {
|
|
||||||
|
|
||||||
public TerminalPreferenceInitializer() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void initializeDefaultPreferences() {
|
|
||||||
Preferences store = TerminalViewPlugin.getDefault().getPluginPreferences();
|
|
||||||
store.setDefault(TerminalPreferencePage.PREF_LIMITOUTPUT, TerminalPreferencePage.DEFAULT_LIMITOUTPUT);
|
|
||||||
store.setDefault(TerminalPreferencePage.PREF_INVERT_COLORS, TerminalPreferencePage.DEFAULT_INVERT_COLORS);
|
|
||||||
store.setDefault(TerminalPreferencePage.PREF_BUFFERLINES, TerminalPreferencePage.DEFAULT_BUFFERLINES);
|
|
||||||
store.setDefault(TerminalPreferencePage.PREF_TIMEOUT_SERIAL, TerminalPreferencePage.DEFAULT_TIMEOUT_SERIAL);
|
|
||||||
store.setDefault(TerminalPreferencePage.PREF_TIMEOUT_NETWORK, TerminalPreferencePage.DEFAULT_TIMEOUT_NETWORK);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,90 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2003, 2007 Wind River Systems, Inc. and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Initial Contributors:
|
|
||||||
* The following Wind River employees contributed to the Terminal component
|
|
||||||
* that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
|
||||||
* Helmut Haigermoser and Ted Williams.
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
|
||||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
|
||||||
*******************************************************************************/
|
|
||||||
package org.eclipse.tm.internal.terminal.view;
|
|
||||||
|
|
||||||
import org.eclipse.jface.preference.BooleanFieldEditor;
|
|
||||||
import org.eclipse.jface.preference.FieldEditorPreferencePage;
|
|
||||||
import org.eclipse.jface.preference.IPreferenceStore;
|
|
||||||
import org.eclipse.jface.preference.IntegerFieldEditor;
|
|
||||||
import org.eclipse.ui.IWorkbench;
|
|
||||||
import org.eclipse.ui.IWorkbenchPreferencePage;
|
|
||||||
|
|
||||||
public class TerminalPreferencePage extends FieldEditorPreferencePage implements
|
|
||||||
IWorkbenchPreferencePage {
|
|
||||||
public static final String PREF_LIMITOUTPUT = "TerminalPrefLimitOutput"; //$NON-NLS-1$
|
|
||||||
public static final String PREF_BUFFERLINES = "TerminalPrefBufferLines"; //$NON-NLS-1$
|
|
||||||
public static final String PREF_TIMEOUT_SERIAL = "TerminalPrefTimeoutSerial"; //$NON-NLS-1$
|
|
||||||
public static final String PREF_TIMEOUT_NETWORK = "TerminalPrefTimeoutNetwork"; //$NON-NLS-1$
|
|
||||||
public static final String PREF_INVERT_COLORS = "TerminalPrefInvertColors"; //$NON-NLS-1$
|
|
||||||
public static final boolean DEFAULT_LIMITOUTPUT = true;
|
|
||||||
public static final int DEFAULT_BUFFERLINES = 1000;
|
|
||||||
public static final int DEFAULT_TIMEOUT_SERIAL = 5;
|
|
||||||
public static final int DEFAULT_TIMEOUT_NETWORK = 5;
|
|
||||||
public static final boolean DEFAULT_INVERT_COLORS = false;
|
|
||||||
|
|
||||||
|
|
||||||
protected BooleanFieldEditor fInvertColors;
|
|
||||||
|
|
||||||
protected IntegerFieldEditor fEditorBufferSize;
|
|
||||||
|
|
||||||
protected IntegerFieldEditor fEditorSerialTimeout;
|
|
||||||
|
|
||||||
protected IntegerFieldEditor fEditorNetworkTimeout;
|
|
||||||
public TerminalPreferencePage() {
|
|
||||||
super(GRID);
|
|
||||||
}
|
|
||||||
protected void createFieldEditors() {
|
|
||||||
setupPage();
|
|
||||||
}
|
|
||||||
public void init(IWorkbench workbench) {
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
protected void setupPage() {
|
|
||||||
setupData();
|
|
||||||
setupEditors();
|
|
||||||
}
|
|
||||||
protected void setupData() {
|
|
||||||
TerminalViewPlugin plugin;
|
|
||||||
IPreferenceStore preferenceStore;
|
|
||||||
|
|
||||||
plugin = TerminalViewPlugin.getDefault();
|
|
||||||
preferenceStore = plugin.getPreferenceStore();
|
|
||||||
setPreferenceStore(preferenceStore);
|
|
||||||
}
|
|
||||||
protected void setupEditors() {
|
|
||||||
fInvertColors = new BooleanFieldEditor(
|
|
||||||
PREF_INVERT_COLORS, ViewMessages.INVERT_COLORS,
|
|
||||||
getFieldEditorParent());
|
|
||||||
fEditorBufferSize = new IntegerFieldEditor(PREF_BUFFERLINES,
|
|
||||||
ViewMessages.BUFFERLINES, getFieldEditorParent());
|
|
||||||
fEditorSerialTimeout = new IntegerFieldEditor(
|
|
||||||
PREF_TIMEOUT_SERIAL, ViewMessages.SERIALTIMEOUT,
|
|
||||||
getFieldEditorParent());
|
|
||||||
fEditorNetworkTimeout = new IntegerFieldEditor(
|
|
||||||
PREF_TIMEOUT_NETWORK, ViewMessages.NETWORKTIMEOUT,
|
|
||||||
getFieldEditorParent());
|
|
||||||
|
|
||||||
fEditorBufferSize.setValidRange(0, Integer.MAX_VALUE);
|
|
||||||
fEditorSerialTimeout.setValidRange(0, Integer.MAX_VALUE);
|
|
||||||
fEditorNetworkTimeout.setValidRange(0, Integer.MAX_VALUE);
|
|
||||||
|
|
||||||
addField(fInvertColors);
|
|
||||||
addField(fEditorBufferSize);
|
|
||||||
addField(fEditorSerialTimeout);
|
|
||||||
addField(fEditorNetworkTimeout);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue