net.yatomiya.nicherry.ui.preference.ThreadViewPage.java Source code

Java tutorial

Introduction

Here is the source code for net.yatomiya.nicherry.ui.preference.ThreadViewPage.java

Source

/*******************************************************************************
 * Copyright (c) 2014,2015 Hideki Yatomi
 * 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 net.yatomiya.nicherry.ui.preference;

import org.eclipse.jface.preference.*;
import net.yatomiya.e4.ui.preference.*;
import net.yatomiya.nicherry.*;

class ThreadViewPage extends StructuredFieldEditorPreferencePage {
    ThreadViewPage() {
        super("");
    }

    @Override
    public void createFieldEditors() {
        CompositeField rootField = getRootCompositeField();

        rootField.addField(new FontFieldEditor(NPreferences.MESSAGE_VIEWER_FONT_PROPOTIONAL, "",
                " ABC abc", rootField.getControl()));
        /*
                rootField.addField(new FontFieldEditor(
                           NPreferences.MESSAGE_VIEWER_FONT_MONOSPACE,
                           "?",
                           " ABC abc",
                           rootField.getControl()));
        */
        rootField.addField(new ColorFieldEditor(NPreferences.MESSAGE_VIEWER_COLOR_FOREGROUND, "",
                rootField.getControl()));
        rootField.addField(new ColorFieldEditor(NPreferences.MESSAGE_VIEWER_COLOR_BACKGROUND, "",
                rootField.getControl()));

        rootField.addField(LabelField.createSeparatorField(rootField.getControl()));

        rootField.addField(new FontFieldEditor(NPreferences.POST_MESSAGE_PANEL_FONT,
                "??", " ABC abc", rootField.getControl()));
        rootField.addField(new BooleanFieldEditor(NPreferences.THREAD_VIEW_UPDATE_WHEN_OPEN_VIEW,
                "???????", rootField.getControl()));
        rootField.addField(new SpinnerFieldEditor(NPreferences.MESSAGE_VIEWER_HOVER_DELAY_TIME,
                "???????",
                rootField.getControl(), 0, 1000 * 60, 1, 1000));
        rootField.addField(new SpinnerFieldEditor(NPreferences.THREAD_VIEW_POST_PANEL_HEIGHT,
                "????", rootField.getControl(), 1, 4096, 1, 10));
        rootField.addField(new SpinnerFieldEditor(NPreferences.POST_MESSAGE_PANEL_WAIT_TIME,
                "????", rootField.getControl(), 0, 60 * 60, 1, 10));
        rootField.addField(new StringFieldEditor(NPreferences.POST_MESSAGE_PANEL_QUOTE_PREFIX, "",
                rootField.getControl()));
    }
}