melnorme.lang.ide.ui.preferences.common.AbstractLangPreferencesPage.java Source code

Java tutorial

Introduction

Here is the source code for melnorme.lang.ide.ui.preferences.common.AbstractLangPreferencesPage.java

Source

/*******************************************************************************
 * Copyright (c) 2015 Bruno Medeiros and other Contributors.
 * 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:
 *     Bruno Medeiros - initial API and implementation
 *******************************************************************************/
package melnorme.lang.ide.ui.preferences.common;

import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.PlatformUI;

public abstract class AbstractLangPreferencesPage extends PreferencePage implements IWorkbenchPreferencePage {

    protected IWorkbench workbench;

    public AbstractLangPreferencesPage(IPreferenceStore store) {
        setPreferenceStore(store);
    }

    protected abstract String getHelpId();

    @Override
    public void init(IWorkbench workbench) {
        this.workbench = workbench;
    }

    @Override
    public void createControl(Composite parent) {
        super.createControl(parent);
        PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), getHelpId());
    }

}