Java tutorial
/******************************************************************************* * Copyright (c) 2012 IBM 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 *******************************************************************************/ package org.eclipse.ptp.internal.remote.terminal; import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.jface.preference.FieldEditorPreferencePage; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.StringFieldEditor; import org.eclipse.ptp.internal.remote.terminal.messages.Messages; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.ui.preferences.ScopedPreferenceStore; public class TerminalPrefsPage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { @Override public void init(IWorkbench arg0) { // Do nothing } @Override protected void createFieldEditors() { Composite parent = getFieldEditorParent(); addField(new StringFieldEditor(TerminalPrefsInitializer.SHELL_STARTUP_COMMAND, Messages.STARTUP_COMMAND_TITLE, parent)); } @Override public IPreferenceStore doGetPreferenceStore() { return new ScopedPreferenceStore(InstanceScope.INSTANCE, Activator.getUniqueIdentifier()); } }