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

📄 chainmessageview.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.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.part.ViewPart;

/**
 * @author Administrator
 * 在总店的管理界面上操作连锁管理时使用的视图
 */
public class ChainMessageView extends ViewPart
{
	private Text subShopID;// 商店编号

	private Text subShopName;// 商店名称

	private Text subShopHeader;// 商店负责人

	private Text subShopTel;// 负责人电话

	private Text subShopAddress;// 通信地址

	private Text gridDataAddr;// 备注

	private Button shopSearch;// 查询

	private Button shopAdd;// 添加

	private Button shopModify;// 修改

	private Button shopDelete;// 删除

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

	// 必须实现的两个方法
	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("编  号:");
		subShopID = new Text(parent, SWT.BORDER);
		
		subShopID.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));

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

		new Label(parent, SWT.NONE).setText("负责人:");
		subShopHeader = new Text(parent, SWT.BORDER);
		subShopHeader.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));

		new Label(parent, SWT.NONE).setText("联系电话:");
		subShopTel = new Text(parent, SWT.BORDER);
		GridData gridData = new GridData();
		//gridData.horizontalSpan = 2;
		gridData.horizontalAlignment = SWT.FILL;
		subShopTel.setLayoutData(gridData);

		new Label(parent, SWT.NONE).setText("通信地址:");
		subShopAddress = new Text(parent, SWT.BORDER);
		GridData gridDataAdd = new GridData();
		//gridDataAdd.horizontalSpan = 2;
		gridDataAdd.horizontalAlignment = SWT.FILL;
		gridDataAdd.grabExcessHorizontalSpace=true;//水平抢占
		subShopAddress.setLayoutData(gridDataAdd);

		new Label(parent, SWT.NONE).setText("备  注:");
		gridDataAddr = new Text(parent, SWT.BORDER);
		GridData gridDataNote = new GridData();
		//gridDataNote.horizontalSpan = 5;
		gridDataNote.horizontalAlignment = SWT.FILL;
		gridDataNote.grabExcessHorizontalSpace=true;//水平抢占
		gridDataAddr.setLayoutData(gridDataNote);
		

		shopSearch=new Button(parent,SWT.NONE);
		shopSearch.setText("  查询  ");
		
		shopAdd=new Button(parent,SWT.NONE);
		shopAdd.setText("  添加  ");
		
		shopModify=new Button(parent,SWT.NONE);
		shopModify.setText("  修改  ");
		
		shopDelete=new Button(parent,SWT.NONE);
		shopDelete.setText("  删除  ");

	}

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

}

⌨️ 快捷键说明

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