net.openchrom.msd.converter.supplier.csv.ui.preferences.PreferencePage.java Source code

Java tutorial

Introduction

Here is the source code for net.openchrom.msd.converter.supplier.csv.ui.preferences.PreferencePage.java

Source

/*******************************************************************************
 * Copyright (c) 2011, 2016 Philip (eselmeister) Wenig.
 * 
 * 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:
 * Philip (eselmeister) Wenig - initial API and implementation
 *******************************************************************************/
package net.openchrom.msd.converter.supplier.csv.ui.preferences;

import org.eclipse.chemclipse.support.ui.preferences.fieldeditors.SpacerFieldEditor;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;

import net.openchrom.msd.converter.supplier.csv.preferences.PreferenceSupplier;
import net.openchrom.msd.converter.supplier.csv.ui.Activator;

public class PreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {

    public PreferencePage() {
        super(GRID);
        setPreferenceStore(Activator.getDefault().getPreferenceStore());
        setDescription("CSV Converter");
    }

    @Override
    public void init(IWorkbench workbench) {

    }

    @Override
    protected void createFieldEditors() {

        addField(new SpacerFieldEditor(getFieldEditorParent()));
        addField(new StringFieldEditor(PreferenceSupplier.P_DELIMITER, "Delimiter character", 1,
                getFieldEditorParent()));
        addField(new BooleanFieldEditor(PreferenceSupplier.P_USE_TIC, "Export only TIC values.",
                getFieldEditorParent()));
    }
}