package com.niis.myprice.views;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
import com.niis.myprice.action.ICommandIds;
import com.niis.myprice.domain.DataTree;
import com.niis.myprice.domain.Kind;
import com.niis.myprice.domain.Node;
import com.niis.myprice.domain.Ware;
import com.niis.myprice.util.message.Messages;
public class WareView extends ViewPart {
private TableViewer viewer;
private Label introLab;
private Action addAction;
private Action modifyAction;
private Action deleteAction;
private Action saveAction;
private Action cancelAction;
private Action refreshAction;
private Action doubleClickAction;
private Shell shell;
public static final String ID = "com.niis.myprice.views.WareView"; //$NON-NLS-1$
/**
* Create contents of the view part
*
* @param parent
*/
private static final int OP_GROUP_WIDTH = 60;
private static final int WARE_LIST_DEVIATION = OP_GROUP_WIDTH + 10;
public void createPartControl(Composite parent) {
// define a container for layout
Composite container = new Composite(parent, SWT.NONE);
// layout
FormLayout groupLayout = new FormLayout();
groupLayout.marginHeight = 10;
groupLayout.marginWidth = 10;
groupLayout.spacing = 10;
container.setLayout(groupLayout);
FormData data;
final Group introductionGroup = new Group(container, SWT.NONE);
introductionGroup.setText(Messages.getString("WareView.caption")); //$NON-NLS-1$
// introductionGroup.setBounds(23, 15, 448, 47);
data = new FormData();
data.top = new FormAttachment(0, 0);
data.bottom = new FormAttachment(10, 0);
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(100, 10);
introductionGroup.setLayoutData(data);
introLab = new Label(introductionGroup, SWT.NONE|SWT.WRAP);
// introLab.setBounds(10, 0, 27, 12);
FillLayout flayout = new FillLayout();
introductionGroup.setLayout(flayout);
// introductionGroup.setVisible(false);
final Group opGroup = new Group(container, SWT.NONE);
opGroup.setText("-"); //$NON-NLS-1$
// opGroup.setBounds(1,1,1,1);
data = new FormData();
data.top = new FormAttachment(introductionGroup, 10);
data.bottom = new FormAttachment(100, 0);
// data.left = new FormAttachment(wareListGroup, 0);
data.width = OP_GROUP_WIDTH;
data.right = new FormAttachment(100, 0);
opGroup.setLayoutData(data);
final Group wareListGroup = new Group(container, SWT.NONE);
wareListGroup.setText(Messages.getString("WareView.warelist")); //$NON-NLS-1$
// wareListGroup.setBounds(138, 76, 283, 246);
data = new FormData();
data.left = new FormAttachment(0, 0);
data.top = new FormAttachment(introductionGroup, 10);
data.bottom = new FormAttachment(100, 0);
data.right = new FormAttachment(100, -WARE_LIST_DEVIATION);
wareListGroup.setLayoutData(data);
// wareListGroup.setVisible(false);
final Button addBtn = new Button(opGroup, SWT.NONE);
addBtn.setText(Messages.getString("WareView.add")); //$NON-NLS-1$
addBtn.setBounds(10, 27, 44, 22);
addListener2AddBtn(addBtn);
final Button modifyBtn = new Button(opGroup, SWT.NONE);
modifyBtn.setText(Messages.getString("WareView.modify")); //$NON-NLS-1$
modifyBtn.setBounds(10, 55, 44, 22);
addListener2ModifyBtn(modifyBtn);
final Button delBtn = new Button(opGroup, SWT.NONE);
delBtn.setText(Messages.getString("WareView.delete")); //$NON-NLS-1$
delBtn.setBounds(10, 83, 44, 22);
addListener2DelBtn(delBtn);
final Button refreshBtn = new Button(opGroup, SWT.NONE);
refreshBtn.setText(Messages.getString("WareView.refresh")); //$NON-NLS-1$
refreshBtn.setBounds(10, 111, 44, 22);
addListener2RefreshBtn(refreshBtn);
final Button searchBtn = new Button(opGroup, SWT.NONE);
searchBtn.setText(Messages.getString("WareView.search"));
searchBtn.setBounds(10, 139, 44, 22);
searchBtn.setVisible(false);
final Button saveBtn = new Button(opGroup, SWT.NONE);
saveBtn.setText(Messages.getString("WareView.save")); //$NON-NLS-1$
saveBtn.setBounds(10, 200, 44, 22);
saveBtn.setVisible(false);
addListener2SaveBtn(saveBtn);
final Button cancelBtn = new Button(opGroup, SWT.NONE);
cancelBtn.setText(Messages.getString("WareView.cancel")); //$NON-NLS-1$
cancelBtn.setBounds(10, 228, 44, 22);
cancelBtn.setVisible(false);
addListener2CancelBtn(cancelBtn);
FillLayout tableLayout = new FillLayout();
wareListGroup.setLayout(tableLayout);
viewer = new TableViewer(wareListGroup, SWT.BORDER | SWT.FULL_SELECTION
| SWT.MULTI);
// viewer.getco
final Table table = viewer.getTable();
// table.setFont(new Font(parent.getShell().getDisplay(), "Arial", 11,
// SWT.BOLD));
// table.setBounds(10, 17, 258, 214);
table.setHeaderVisible(true);
table.setLinesVisible(true);
// table.setSortColumn(column)
// table.setSortDirection(direction)
final TableColumn num = new TableColumn(table, SWT.NONE);
num.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
resetSort(WareViewerSort.NUM);
}
});
num.setAlignment(SWT.CENTER);
num.setWidth(50);
num.setText(Messages.getString("WareView.warenum")); //$NON-NLS-1$
final TableColumn name = new TableColumn(table, SWT.NONE);
name.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
resetSort(WareViewerSort.NAME);
}
});
name.setWidth(80);
name.setText(Messages.getString("WareView.warename")); //$NON-NLS-1$
name.setAlignment(SWT.CENTER);
// table.setSortColumn(name);
// table.setSortDirection(SWT.DOWN);
final TableColumn desc = new TableColumn(table, SWT.NONE);
desc.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
resetSort(WareViewerSort.DESC);
}
});
desc.setWidth(110);
desc.setText(Messages.getString("WareView.waredesc")); //$NON-NLS-1$
final TableColumn price = new TableColumn(table, SWT.NONE);
price.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
resetSort(WareViewerSort.PRICE);
}
});
price.setWidth(70);
price.setText(Messages.getString("WareView.wareprice"));
没有合适的资源?快使用搜索试试~ 我知道了~
基于SWt,JFace的Rcp 开发实例
共201个文件
class:74个
java:26个
root:20个
4星 · 超过85%的资源 需积分: 10 24 下载量 10 浏览量
2009-11-03
10:41:14
上传
评论
收藏 978KB RAR 举报
温馨提示
一个介绍RCp开发的实例项目,包含了SWt,JFace组件 的用法,特别适用于初学者
资源推荐
资源详情
资源评论
收起资源包目录
基于SWt,JFace的Rcp 开发实例 (201个子文件)
splash.bmp 394KB
WareView.class 15KB
SWTResourceManager.class 12KB
SendMail.class 9KB
KindTreeView.class 8KB
KindView.class 8KB
DataTree.class 8KB
WareInputDialog.class 6KB
ApplicationActionBarAdvisor.class 5KB
KindView$6.class 3KB
Ware.class 3KB
ApplicationWorkbenchWindowAdvisor.class 3KB
KindView$10.class 3KB
KindTreeView$5.class 3KB
Util.class 3KB
KindTreeView$2.class 3KB
KindTreeView$3.class 3KB
KindTreeView$4.class 3KB
MailAction.class 3KB
WareView$WareViewerSort.class 2KB
Kind.class 2KB
ExitAction.class 2KB
WelcomView.class 2KB
KindTreeView$6.class 2KB
KindTreeView$KindContentProvider.class 2KB
WareView$8.class 2KB
SysConfig.class 2KB
SaveAction.class 2KB
OpenWareViewAction.class 2KB
OpenKindViewAction.class 2KB
WareView$WareContentProvider.class 1KB
KindTreeView$KindLabelProvider.class 1KB
Application.class 1KB
KindTreeView$1.class 1KB
Node.class 1KB
WareView$WareLabelProvider.class 1KB
WareView$12.class 1KB
WareView$7.class 1KB
WareView$6.class 1KB
Messages.class 1KB
ApplicationWorkbenchAdvisor.class 1KB
KindView$7.class 1KB
Activator.class 1KB
KindTreeView$9.class 962B
Perspective.class 958B
WareView$20.class 937B
KindView$8.class 933B
WareView$16.class 933B
WareView$18.class 932B
WareView$14.class 932B
KindView$4.class 930B
KindView$2.class 930B
WareView$17.class 930B
WareView$15.class 929B
WareView$13.class 929B
KindView$5.class 927B
KindView$3.class 927B
KindView$1.class 926B
KindTreeView$8.class 896B
WareInputDialog$2.class 889B
WareView$19.class 870B
SWTResourceManager$1.class 857B
WareView$3.class 811B
WareView$1.class 811B
WareView$4.class 811B
WareView$2.class 811B
WareView$5.class 811B
WareInputDialog$1.class 800B
WareView$9.class 784B
MailAuthenticator.class 725B
WareView$11.class 720B
WareView$10.class 716B
KindView$9.class 651B
KindTreeView$7.class 637B
ICommandIds.class 576B
.classpath 480B
shared.css 671B
root.css 284B
Entries 579B
Entries 354B
Entries 342B
Entries 318B
Entries 311B
Entries 249B
Entries 249B
Entries 177B
Entries 159B
Entries 143B
Entries 104B
Entries 66B
Entries 61B
Entries 57B
Entries 47B
Entries 45B
Entries 38B
Entries 31B
Entries 15B
alt_about.gif 9KB
link_obj.gif 2KB
alt_window_32.gif 1KB
共 201 条
- 1
- 2
- 3
资源评论
- 哈娃呢2014-09-01还行,可以作为参考,要是能再详细点就好了
coding-now
- 粉丝: 36
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- YOLOV4-TINY权重文件
- 以下是一个使用贪心算法解决多机调度问题的基本步骤0.txt
- 基于大数据的房产估价是近年来随着技术的发展而兴起的一种新型估价方法.txt
- 企业供应链管理系统v3.rar
- 富芮坤FR8016HA蓝牙开发板使用手册+硬件PCB图+封装库+DEMO演示软件源代码.zip
- 基于YOLOv7的芯片表面缺陷检测系统
- 京东物流 数字化供应链综合研究报告2018.rar
- 基于YOLOv7的植物虫害识别&防治系统
- 2000.1-2023.8中国经济政策不确定性指数月度数据.xlsx
- Screenshot_2024-04-21-20-42-15-443_com.tencent.mm.jpg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功