welcomview.java

来自「eclipse rcp 项目实例」· Java 代码 · 共 62 行

JAVA
62
字号
package com.niis.myprice.views;

import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.part.ViewPart;

import com.niis.myprice.util.message.Messages;
import com.swtdesigner.SWTResourceManager;

public class WelcomView extends ViewPart {

	public static final String ID = "com.niis.myprice.views.WelcomView"; //$NON-NLS-1$

	/**
	 * Create contents of the view part
	 * @param parent
	 */
	public void createPartControl(Composite parent) {
		Composite container = new Composite(parent, SWT.NONE);

		final Label introductionLab = new Label(container, SWT.NONE);
		introductionLab.setFont(SWTResourceManager.getFont("SimSun", 16, SWT.BOLD)); //$NON-NLS-1$
		introductionLab.setText(Messages.getString("WelcomView.welcomemessage")); //$NON-NLS-1$
		introductionLab.setBounds(66, 52, 345, 36);
		//
		createActions();
		initializeToolBar();
		initializeMenu();
	}

	/**
	 * Create the actions
	 */
	private void createActions() {
		// Create the actions
	}

	/**
	 * Initialize the toolbar
	 */
	private void initializeToolBar() {
		IToolBarManager toolbarManager = getViewSite().getActionBars()
				.getToolBarManager();
	}

	/**
	 * Initialize the menu
	 */
	private void initializeMenu() {
		IMenuManager menuManager = getViewSite().getActionBars()
				.getMenuManager();
	}

	public void setFocus() {
		// Set the focus
	}

}

⌨️ 快捷键说明

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