亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? wareview.java

?? eclipse rcp 項目實例
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
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.internal.dialogs.ViewSorter;
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")); //$NON-NLS-1$
		price.setAlignment(SWT.RIGHT);

		final TableColumn updDate = new TableColumn(table, SWT.NONE);
		updDate.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				resetSort(WareViewerSort.UPDDATE);
			}
		});
		updDate.setWidth(150);
		updDate.setText(Messages.getString("WareView.wareupddate")); //$NON-NLS-1$
		updDate.setAlignment(SWT.CENTER);

		viewer.setContentProvider(new WareContentProvider());
		viewer.setLabelProvider(new WareLabelProvider());

		viewer.setInput(DataTree.getDt().getAbstractRoot());
		viewer.setSorter(new WareViewerSort());
		//
		createActions();
		hookContextMenu();
		hookDoubleClickAction();
		// contributeToActionBars();
		initializeToolBar();
		initializeMenu();
	}

	/**
	 * 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() {
		KindTreeView.activeViewId = ID;
		viewer.getControl().setFocus();
	}
	public void refresh(){
		if(viewer.getInput() instanceof Kind){
			Kind kind = (Kind)viewer.getInput();
			introLab.setText(kind.getDisplayDesc());
		}
		viewer.refresh();
	}

	/**
	 * Create the actions
	 */
	private void createActions() {
		makeAddAction();
		makeModifyAction();
		makeDeleteAction();
		makeSaveAction();
		makeCancelAction();
		makeRefreshAction();
		makeDoubleClickAction();

	}

	private void makeAddAction() {
		addAction = new Action() {
			public void run() {
				WareInputDialog wareInputDialog = new WareInputDialog(
						getShell(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL,
						viewer, ICommandIds.INSERT);
				wareInputDialog.setText(Messages.getString("WareView.waremanager")); //$NON-NLS-1$
				wareInputDialog.open();
			}
		};
		addAction.setText(Messages.getString("WareView.add")); //$NON-NLS-1$
		addAction.setToolTipText("add Action tooltip"); //$NON-NLS-1$
		addAction.setImageDescriptor(PlatformUI.getWorkbench()
				.getSharedImages().getImageDescriptor(
						ISharedImages.IMG_OBJS_INFO_TSK));

	}

	private void makeModifyAction() {
		modifyAction = new Action() {
			public void run() {
				WareInputDialog wareInputDialog = new WareInputDialog(
						getShell(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL,
						viewer, ICommandIds.MODIFY);
				wareInputDialog.setText(Messages.getString("WareView.waremanager")); //$NON-NLS-1$
				wareInputDialog.open();
			}
		};
		modifyAction.setText(Messages.getString("WareView.modify")); //$NON-NLS-1$
		modifyAction.setToolTipText("modify Action tooltip"); //$NON-NLS-1$
		modifyAction.setImageDescriptor(PlatformUI.getWorkbench()
				.getSharedImages().getImageDescriptor(
						ISharedImages.IMG_OBJS_INFO_TSK));

	}

	private void makeDeleteAction() {
		deleteAction = new Action() {
			public void run() {
				boolean result = MessageDialog.openConfirm(getShell(), Messages.getString("WareView.confirmmessage"), //$NON-NLS-1$
						Messages.getString("WareView.confirmdeletethisware")); //$NON-NLS-1$
				if(result){
					ISelection selection = viewer.getSelection();
					Object obj = ((IStructuredSelection) selection)
							.getFirstElement();
					if(obj instanceof Ware){
						Ware ware = (Ware)obj;
						ware.getParent().removeChild(ware);
						viewer.refresh();
					}
				}

			}
		};
		deleteAction.setText(Messages.getString("WareView.delete")); //$NON-NLS-1$
		deleteAction.setToolTipText("delete action tooltip"); //$NON-NLS-1$
		deleteAction.setImageDescriptor(PlatformUI.getWorkbench()
				.getSharedImages().getImageDescriptor(
						ISharedImages.IMG_OBJS_INFO_TSK));

	}
	private void makeRefreshAction(){
			refreshAction = new Action() {
				public void run() {
					viewer.refresh();
				}
			};
			refreshAction.setText("refresh action"); //$NON-NLS-1$
			refreshAction.setToolTipText("refresh action tooltip"); //$NON-NLS-1$
			refreshAction.setImageDescriptor(PlatformUI.getWorkbench()
					.getSharedImages().getImageDescriptor(
							ISharedImages.IMG_OBJS_INFO_TSK));
	}
	private void makeSaveAction() {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区久久| 黑人巨大精品欧美一区| 国产一区二区中文字幕| 久久品道一品道久久精品| 久久国产精品色| 精品久久人人做人人爱| 成人午夜大片免费观看| 亚洲色图制服丝袜| 欧美色图第一页| 亚洲亚洲精品在线观看| 欧美肥妇bbw| 国产成人精品免费网站| 一级做a爱片久久| 777精品伊人久久久久大香线蕉| 九色综合狠狠综合久久| 中日韩av电影| 欧美日韩二区三区| 成人免费看视频| 97久久精品人人爽人人爽蜜臀| 亚洲午夜在线电影| 日本不卡免费在线视频| 国产日产欧美精品一区二区三区| 日本韩国一区二区三区| 激情丁香综合五月| a级精品国产片在线观看| 蜜臀久久久久久久| 国产精品国产三级国产| 亚洲精品一区二区三区福利| 欧美老女人在线| 久久美女艺术照精彩视频福利播放| 国产日韩在线不卡| 亚洲妇女屁股眼交7| 激情av综合网| 色88888久久久久久影院按摩| 欧美狂野另类xxxxoooo| 国产视频一区不卡| 久久精品欧美一区二区三区麻豆| 中文字幕亚洲综合久久菠萝蜜| 久久嫩草精品久久久精品| 亚洲色图欧洲色图| 国产一区二区三区免费看| 色婷婷综合久久久久中文 | 欧美精品一区视频| 日韩成人av影视| 欧美精彩视频一区二区三区| 日韩伦理电影网| 久久国产综合精品| 色天使色偷偷av一区二区| wwww国产精品欧美| 久久理论电影网| 亚洲成人av电影在线| 亚洲电影在线免费观看| 成人涩涩免费视频| 日韩欧美成人一区| 欧美国产日韩在线观看| 国产视频一区在线观看| 视频在线在亚洲| 久久成人av少妇免费| 在线免费观看视频一区| 欧美性受极品xxxx喷水| 欧美喷潮久久久xxxxx| 亚洲三级电影全部在线观看高清| 麻豆91在线播放免费| 欧美色偷偷大香| 亚洲综合精品久久| 麻豆精品久久久| 欧美精品亚洲二区| 亚洲自拍偷拍网站| 欧美优质美女网站| 亚洲精品久久嫩草网站秘色| 婷婷久久综合九色国产成人 | 欧美一区二区三区四区久久| 亚洲午夜视频在线| 欧美日韩国产另类一区| 亚洲一区二区三区小说| 91在线播放网址| 欧美三级韩国三级日本一级| 亚洲黄色小视频| 欧美中文字幕不卡| 亚洲最快最全在线视频| 欧美丝袜丝交足nylons图片| 亚欧色一区w666天堂| 欧美色中文字幕| 亚洲电影激情视频网站| 91精品一区二区三区在线观看| 五月天中文字幕一区二区| 91精品国产综合久久久久久久| 日本美女一区二区三区| 久久综合九色综合欧美就去吻| 久久国产三级精品| 久久精品人人爽人人爽| 不卡的av电影在线观看| 精品久久国产老人久久综合| 国产一区久久久| 国产精品激情偷乱一区二区∴| 91亚洲精品一区二区乱码| 一区二区免费看| 日韩写真欧美这视频| 亚洲精品亚洲人成人网在线播放| 色婷婷综合五月| 久久国产人妖系列| 一区在线观看视频| 欧美日韩精品是欧美日韩精品| 美女网站色91| 亚洲欧洲性图库| 91精品欧美一区二区三区综合在 | 在线观看视频91| 久久国产精品一区二区| 亚洲欧洲国产日韩| 91精品国产麻豆| 成人黄色软件下载| 日韩国产欧美在线视频| 国产精品女同一区二区三区| 欧美色图免费看| 粗大黑人巨茎大战欧美成人| 亚洲超丰满肉感bbw| 国产精品午夜春色av| 欧美高清视频不卡网| www.日本不卡| 国产综合久久久久久久久久久久| 亚洲乱码中文字幕| www国产精品av| 欧美日韩不卡一区| 99久久精品免费看国产| 中文字幕第一区综合| 成人福利视频在线看| 亚洲一二三四在线| 国产精品久久久久久久浪潮网站 | 中文字幕免费不卡| 欧美日韩成人综合天天影院 | 天堂va蜜桃一区二区三区| 中文字幕不卡在线播放| 日韩一级片网址| 91国内精品野花午夜精品 | 在线亚洲免费视频| 国产精品77777竹菊影视小说| 色婷婷国产精品| 国内外成人在线视频| 国产精品久久网站| 色噜噜狠狠成人中文综合| 久久精品国内一区二区三区| 一区二区三区四区蜜桃| 国产精品素人一区二区| 亚洲精品在线免费播放| 欧美一区二区三区系列电影| 欧美色视频一区| 91美女在线视频| 91免费视频观看| 不卡的av电影| av不卡免费在线观看| 成人黄页在线观看| 成人午夜av电影| 国产成人99久久亚洲综合精品| 国产精品久久久久一区二区三区共| 欧美va日韩va| 久久综合色天天久久综合图片| 日韩一级黄色大片| 欧美一卡在线观看| 日韩免费视频线观看| 日韩欧美成人激情| 久久精品在线观看| 国产欧美精品一区aⅴ影院| 国产精品久久久久久久久果冻传媒 | 91蜜桃在线免费视频| 91美女在线看| 欧美日韩dvd在线观看| 这里是久久伊人| 欧美精品一区二区蜜臀亚洲| 久久理论电影网| 亚洲视频1区2区| 午夜视频久久久久久| 麻豆国产欧美日韩综合精品二区| 国产精品18久久久久久久久| 成人av影视在线观看| 欧美在线不卡一区| 亚洲精品一区二区三区99| 国产精品毛片a∨一区二区三区| 亚洲欧美激情一区二区| 久久久久久久免费视频了| 国产女主播在线一区二区| 亚洲色图欧美在线| 免费看日韩精品| 成人午夜在线视频| 欧美日韩三级在线| 精品国产乱码久久久久久免费 | 在线视频你懂得一区二区三区| 欧美日韩国产三级| 久久综合久久综合亚洲| 一二三区精品福利视频| 毛片av一区二区| 91看片淫黄大片一级| 精品精品国产高清a毛片牛牛| 亚洲日本va午夜在线影院| 日韩成人一区二区| 91视频在线看| 久久久久一区二区三区四区| 亚洲夂夂婷婷色拍ww47| 国产91精品露脸国语对白| 欧美剧情片在线观看| 1区2区3区国产精品|