⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 staffmessageview.java

📁 java eclipse rcp学习
💻 JAVA
字号:
/**
 * 
 */
package chainShopMS.views;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.part.ViewPart;

/**
 * @author Administrator
 *员工信息视图
 */
public class StaffMessageView extends ViewPart
{
	private Text staffID;// 员工编号

	private Text staffName;// 员工姓名

	private Combo staffSex;// 员工性别
	
	private Text staffAge;//员工年龄

	private Text staffDuty;// 员工职务

	private Text staffPassWord;// 登录口令

	private Text staffNote;// 备注
	

	private Button staffSearch;// 查询

	private Button staffAdd;// 添加

	private Button staffModify;// 修改

	private Button staffDelete;// 删除

	/** 该视图的ID */
	public static final String ID = "chainShopMS.views.StaffMessageView";

	// 必须实现的两个方法
	public void createPartControl(final Composite parent)
	{
		// 设置表单的基本属性
		
		//parent.setLayoutData(new GridData(GridData.FILL_BOTH));
		parent.setLayout(new GridLayout(4, false));// 信息面板分成6列

		new Label(parent, SWT.NONE).setText("编  号:");
		staffID = new Text(parent, SWT.BORDER);
		
		staffID.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));

		new Label(parent, SWT.NONE).setText("姓  名:");
		staffName = new Text(parent, SWT.BORDER);
		staffName.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));

		new Label(parent, SWT.NONE).setText("性  别:");
		staffSex = new Combo(parent, SWT.BORDER);
		staffSex.add("男");
		staffSex.add("女");
		staffSex.select(0);
		staffSex.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));

		new Label(parent, SWT.NONE).setText("年  龄:");
		staffAge = new Text(parent, SWT.BORDER);
		GridData gridData = new GridData();
		//gridData.horizontalSpan = 2;
		gridData.horizontalAlignment = SWT.FILL;
		gridData.grabExcessHorizontalSpace=true;//水平抢占
		staffAge.setLayoutData(gridData);
		
		new Label(parent, SWT.NONE).setText("职  务:");
		staffDuty = new Text(parent, SWT.BORDER);
		GridData gridDataDuty = new GridData();
		//gridData.horizontalSpan = 2;
		gridDataDuty.horizontalAlignment = SWT.FILL;
		gridDataDuty.grabExcessHorizontalSpace=true;//水平抢占
		staffDuty.setLayoutData(gridDataDuty);

		new Label(parent, SWT.NONE).setText("口  令:");
		staffPassWord = new Text(parent, SWT.BORDER);
		GridData gridDataAdd = new GridData();
		//gridDataAdd.horizontalSpan = 2;
		gridDataAdd.horizontalAlignment = SWT.FILL;
		gridDataAdd.grabExcessHorizontalSpace=true;//水平抢占
		staffPassWord.setLayoutData(gridDataAdd);

		new Label(parent, SWT.NONE).setText("权  限:");
		staffDuty= new Text(parent, SWT.BORDER);
		GridData gridDataNote = new GridData();
		//gridDataNote.horizontalSpan = 5;
		gridDataNote.horizontalAlignment = SWT.FILL;
		gridDataNote.grabExcessHorizontalSpace=true;//水平抢占
		staffDuty.setLayoutData(gridDataNote);
		
		new Label(parent, SWT.NONE).setText("备  注:");
		staffNote= new Text(parent, SWT.BORDER);
		staffNote.setLayoutData(gridDataNote);
		
		//按钮
		staffSearch =new Button(parent,SWT.NONE);
		staffSearch.setText("  查询  ");
		
		staffAdd=new Button(parent,SWT.NONE);
		staffAdd.setText("  添加  ");
		
		staffModify=new Button(parent,SWT.NONE);
		staffModify.setText("  修改  ");
		
		staffDelete=new Button(parent,SWT.NONE);
		staffDelete.setText("  删除  ");

	}

	public void setFocus()
	{
		staffID.setFocus();
	}

}



⌨️ 快捷键说明

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