欢迎来到虫虫下载站 | 资源下载 资源专辑 关于我们
虫虫下载站

todopreferencepage.java

eclipse开发笔记
JAVA
字号:
package rcpdev.todo.persistence.preferences;

import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.SWT;
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.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import com.swtdesigner.ResourceManager;
import rcpdev.todo.persistence.Activator;

public class TodoPreferencePage extends PreferencePage implements
		IWorkbenchPreferencePage {

	/**
	 * Create the preference page
	 */
	public TodoPreferencePage() {
		super();
	}

	/**
	 * Create contents of the preference page
	 * @param parent
	 */
	@Override
	public Control createContents(Composite parent) {
		Composite container = new Composite(parent, SWT.NULL);
		container.setLayout(new GridLayout());

		final Label imageLabel = new Label(container, SWT.NONE);
		imageLabel.setImage(ResourceManager.getPluginImage(Activator.getDefault(), "images/logo.JPG"));
		imageLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

		final Label todoPluginWrittenLabel = new Label(container, SWT.NONE);
		todoPluginWrittenLabel.setText("To-Do plugin written by Harper Jiang");

		final Label contactMeaLink = new Label(container, SWT.NONE);
		contactMeaLink.setText("Contact me : harper.jiang@gmail.com");
		//
		return container;
	}

	/**
	 * Initialize the preference page
	 */
	public void init(IWorkbench workbench) {
		// Initialize the preference page
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -