/*
* Jampa
* Copyright (C) 2008-2009 J. Devauchelle and contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 3 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
package org.jampa.preferences.pages;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.FileFieldEditor;
import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.jampa.Activator;
import org.jampa.gui.translations.Messages;
import org.jampa.preferences.PreferenceConstants;
import org.jampa.preferences.pages.editors.RegexPatternListEditor;
public class MPlayerEnginePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
private FileFieldEditor mplayerPath;
private StringFieldEditor additionalOptionsEditor;
private BooleanFieldEditor useVolume;
private BooleanFieldEditor forceProxySettings;
public MPlayerEnginePage() {
super(GRID);
setPreferenceStore(Activator.getDefault().getPreferenceStore());
setDescription(Messages.getString("MPlayerEnginePage.Title")); //$NON-NLS-1$
}
@Override
protected void createFieldEditors() {
Label horizontalLine;
horizontalLine = new Label(getFieldEditorParent(), SWT.NONE);
horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 3, 1));
mplayerPath = new FileFieldEditor(PreferenceConstants.P_MPLAYER_PATH,
Messages.getString("MPlayerEnginePage.MPlayerPath"), getFieldEditorParent()); //$NON-NLS-1$
addField(mplayerPath);
additionalOptionsEditor = new StringFieldEditor(PreferenceConstants.MPLAYER_ADDITIONAL_OPTIONS,
Messages.getString("MPlayerEnginePage.MPlayerAdditionalOptions"), //$NON-NLS-1$
getFieldEditorParent());
additionalOptionsEditor.getTextControl(getFieldEditorParent()).setToolTipText(Messages.getString("MPlayerEnginePage.AdditionalOptionsTooltip")); //$NON-NLS-1$
addField(additionalOptionsEditor);
addField(new BooleanFieldEditor(PreferenceConstants.MPLAYER_USE_VOLUME_NORMALIZATION,
Messages.getString("MPlayerEnginePage.UseVolumeNormalization"), //$NON-NLS-1$
getFieldEditorParent()));
useVolume = new BooleanFieldEditor(PreferenceConstants.MPLAYER_USE_VOLUME_COMMAND,
Messages.getString("MPlayerEnginePage.UseVolumeCommand"), //$NON-NLS-1$
getFieldEditorParent());
useVolume.getDescriptionControl(getFieldEditorParent()).setToolTipText(Messages.getString("MPlayerEnginePage.VolumeCommandExplanation")); //$NON-NLS-1$
addField(useVolume);
forceProxySettings = new BooleanFieldEditor(PreferenceConstants.MPLAYER_FORCE_PROXY_SETTINGS,
Messages.getString("MPlayerEnginePage.ForceProxySettings"), //$NON-NLS-1$
getFieldEditorParent());
forceProxySettings.getDescriptionControl(getFieldEditorParent()).setToolTipText(Messages.getString("MPlayerEnginePage.ForceProxySettingsExplanation")); //$NON-NLS-1$
addField(forceProxySettings);
horizontalLine = new Label(getFieldEditorParent(), SWT.NONE);
horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 3, 1));
RegexPatternListEditor regexPatternLE = new RegexPatternListEditor(PreferenceConstants.RADIO_PLAYLIST_PATTERN_LIST,
Messages.getString("MPlayerEnginePage.RadioPatternList"), //$NON-NLS-1$
getFieldEditorParent());
regexPatternLE.getLabelControl(getFieldEditorParent()).setToolTipText(Messages.getString("MPlayerEnginePage.RadioPatternListToolTip"));
addField(regexPatternLE);
}
@Override
public void init(IWorkbench workbench) {
// TODO Auto-generated method stub
}
}