/******************************************************************************* | |
* Copyright (c) 2020 RBEI and others. | |
* | |
* This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v. 2.0 | |
* which accompanies this distribution, and is available at | |
* https://www.eclipse.org/legal/epl-2.0/ | |
* | |
* SPDX-License-Identifier: EPL-2.0 | |
* | |
* Contributors: | |
* Adhith Gopal - Initial contribution and API | |
*******************************************************************************/ | |
package org.eclipse.blockchain.ui.preference; | |
import org.eclipse.jface.preference.PreferencePage; | |
import org.eclipse.swt.SWT; | |
import org.eclipse.swt.graphics.Image; | |
import org.eclipse.swt.layout.GridData; | |
import org.eclipse.swt.layout.GridLayout; | |
import org.eclipse.swt.widgets.Composite; | |
import org.eclipse.swt.widgets.Control; | |
import org.eclipse.swt.widgets.Display; | |
import org.eclipse.swt.widgets.Label; | |
import org.eclipse.ui.IWorkbench; | |
import org.eclipse.ui.IWorkbenchPreferencePage; | |
/** | |
* Root preference section | |
*/ | |
public class SecoBlocksRootPreference extends PreferencePage | |
implements | |
IWorkbenchPreferencePage { | |
/** | |
* {@inheritDoc} | |
*/ | |
@Override | |
protected Control createContents(final Composite parent) { | |
Composite contents = new Composite(parent, SWT.NONE); | |
contents.setLayout(new GridLayout(1, false)); | |
contents.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); | |
Label label = new Label(contents, SWT.NONE); | |
label.setText( | |
"This is just a root page for SecoBlocks expand subtree for preference options"); | |
label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); | |
label = new Label(contents, SWT.NONE); | |
label.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true)); | |
label.setImage(new Image(Display.getDefault(), this.getClass() | |
.getResourceAsStream("/icon/eth-bc-128-128.png"))); | |
noDefaultAndApplyButton(); | |
return contents; | |
} | |
/** | |
* {@inheritDoc} | |
*/ | |
@Override | |
public void init(final IWorkbench workbench) { | |
// Nothing Here | |
} | |
} |