rcp dialog上table右键菜单实例

MenuManager menuManager = new MenuManager(); 
		menuManager.add(new Action("打开保护") { 
		@Override 
		public void run() { 
		MessageBox box = new MessageBox(Display.getCurrent().getActiveShell()); 
		box.setMessage("hello!"); 
		box.open(); 
		} 
		}); 
		menuManager.add(new Action("关闭保护") { 
			@Override 
			public void run() { 
			MessageBox box = new MessageBox(Display.getCurrent().getActiveShell()); 
			box.setMessage("hello!"); 
			box.open(); 
			} 
			}); 
		menuManager.add(new Action("普通电路") { 
			@Override 
			public void run() { 
			MessageBox box = new MessageBox(Display.getCurrent().getActiveShell()); 
			box.setMessage("hello!"); 
			box.open(); 
			} 
			});
		menuManager.add(new Action("区间电路") { 
			@Override 
			public void run() { 
			MessageBox box = new MessageBox(Display.getCurrent().getActiveShell()); 
			box.setMessage("hello!"); 
			box.open(); 
			} 
			});
		menuManager.add(new Action("落地透传") { 
			@Override 
			public void run() { 
			MessageBox box = new MessageBox(Display.getCurrent().getActiveShell()); 
			box.setMessage("hello!"); 
			box.open(); 
			} 
			});
		menuManager.add(new Action("激活") { 
			@Override 
			public void run() { 
			MessageBox box = new MessageBox(Display.getCurrent().getActiveShell()); 
			box.setMessage("hello!"); 
			box.open(); 
			} 
			});
		menuManager.add(new Action("去激活") { 
			@Override 
			public void run() { 
			MessageBox box = new MessageBox(Display.getCurrent().getActiveShell()); 
			box.setMessage("hello!"); 
			box.open(); 
			} 
			});
		menuManager.add(new Action("重置标单") { 
			@Override 
			public void run() { 
			MessageBox box = new MessageBox(Display.getCurrent().getActiveShell()); 
			box.setMessage("hello!"); 
			box.open(); 
			} 
			});
		Menu menu = menuManager.createContextMenu(table); 
		table.setMenu(menu); 

你可能感兴趣的:(rcp dialog上table右键菜单实例)