Package org.jampa.preferences.pages

Source Code of org.jampa.preferences.pages.DiskViewPage

/*
* 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.RadioGroupFieldEditor;
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;

public class DiskViewPage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {

  public DiskViewPage() {
    super(GRID);
    setPreferenceStore(Activator.getDefault().getPreferenceStore());
    setDescription(Messages.getString("DiskViewPage.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, 2, 1));
   
    addField(new BooleanFieldEditor(
        PreferenceConstants.DISKVIEW_MERGE_FOLDER,
        Messages.getString("DiskViewPage.MergeFolder"), //$NON-NLS-1$
        getFieldEditorParent()));
   
    horizontalLine = new Label(getFieldEditorParent(), SWT.NONE);
    horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
   
    addField(new RadioGroupFieldEditor(
        PreferenceConstants.DISKVIEW_FOLDER_DOUBLECLICK_ACTION,
        Messages.getString("DiskViewPage.FolderDoubleclickAction"), //$NON-NLS-1$
        1,
        new String[][] { { Messages.getString("DiskViewPage.FolderDoubleclickActionDefault"), "0" }, { //$NON-NLS-1$ //$NON-NLS-2$
                  Messages.getString("DiskViewPage.FolderDoubleclickActionExpand"), "1" } }, //$NON-NLS-1$ //$NON-NLS-2$
        getFieldEditorParent()));
   
    horizontalLine = new Label(getFieldEditorParent(), SWT.NONE);
    horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));   
   
    addField(new RadioGroupFieldEditor(
        PreferenceConstants.DISKVIEW_DEFAULT_DOUBLECLICK_ACTION,
        Messages.getString("DiskViewPage.PlayDefaultDoubleclickAction"), //$NON-NLS-1$
        1,
        new String[][] { { Messages.getString("ViewsPage.DoubleclickActionPlay"), "0" }, { //$NON-NLS-1$ //$NON-NLS-2$
                  Messages.getString("ViewsPage.DoubleclickActionEnqueue"), "1" } }, //$NON-NLS-1$ //$NON-NLS-2$
        getFieldEditorParent()));
   
    horizontalLine = new Label(getFieldEditorParent(), SWT.NONE);
    horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
   
    addField(new RadioGroupFieldEditor(
        PreferenceConstants.DISKVIEW_DISPLAY_MODE,
        Messages.getString("DiskViewPage.DisplayMode"), //$NON-NLS-1$
        1,
        new String[][] { { Messages.getString("DiskViewPage.DisplayModeDirectoriesFirst"), "0" }, { //$NON-NLS-1$ //$NON-NLS-2$
                  Messages.getString("DiskViewPage.DisplayModeFilesFirst"), "1" } }, //$NON-NLS-1$ //$NON-NLS-2$
        getFieldEditorParent()));
  }
 
  @Override
  public void init(IWorkbench workbench) {
    // TODO Auto-generated method stub

  }

}
TOP

Related Classes of org.jampa.preferences.pages.DiskViewPage

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.