Git Product home page Git Product logo

e4-preferences's Introduction

e4-preference-pages

Managing preference pages with an extension point in Eclipse 4.

Extendion Points:

Extension Preference Page
class* Must implement PreferencePage or FieldEditorPreferencePage
id* Id of the page e.g. page_general
title Title of the page
category Rood node/id e.g. page_root
order* Page position
Extension Preference Scope
class* Must implement IPreferenceStore

Show prefrences example:

Inject EPreferenceService and set preference manager in preference dialog.

    @Execute
    public void showPreferences(Shell shell, EPreferenceService service) {
        final PreferenceDialog dlg = new PreferenceDialog(shell, service.getPreferenceManager());
        dlg.create();
        dlg.open();
    }

A simple preference page which extends FieldEditorPreferencePage. Furthermore dependency injection is also available if you need it.

public class PreferenceGeneralPage extends FieldEditorPreferencePage {

    @Inject
    MyService service;

    public PreferenceGeneralPage() {
        super(GRID);
        setTitle("General");
    }

    @Override
    protected void createFieldEditors() {
        addField(new ColorFieldEditor("pref_text_color", "Text color:", getFieldEditorParent()));
        addField(new ColorFieldEditor("pref_link_color", "Link color:", getFieldEditorParent()));
    }
}

Define custom instance scope:

TODO example

TODO download section

e4-preferences's People

Contributors

nucle avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.