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

📄 usertypepage.java

📁 学生成绩管理系统 eclipse rcp开发 swt技术
💻 JAVA
字号:
package com.zdh.sms.editor.wizard;

import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;

import com.zdh.sms.db.Constants;



public class UserTypePage extends WizardPage {
	private Combo combo;

	protected UserTypePage(String pageName) {
		super(pageName);
	}

	public void createControl(Composite parent) {
		setTitle("添加用户");
		setMessage("选择用户类型", INFORMATION);
		Composite topComp = new Composite(parent, SWT.NULL);
		topComp.setLayout(new GridLayout());

		Composite c = new Composite(topComp, SWT.NULL);
		c.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, true,
				true));
		c.setLayout(new RowLayout());
		new Label(c, SWT.NONE).setText("用户类型:");
		combo = new Combo(c, SWT.BORDER);
		combo.setLayoutData(new RowData(50, -1));// 设定Combo的宽度
		combo.add("老师");
		combo.add("学生");
		// 用项名做键值,将类型值挂在Combo
		combo.setData("老师", Constants.IUSER_TEACHER_TYPE);
		combo.setData("学生", Constants.IUSER_STUDENT_TYPE);
		combo.select(0);
		setControl(topComp);
	}

	// 获得用户的类型
	public String getUserType() {
		String key = combo.getText();
		return combo.getData(key) + "";
	}
}

⌨️ 快捷键说明

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