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

📄 adddemodataviewactiondelegate.java

📁 对于可视的桌面开发系统的一些详细的设计资料
💻 JAVA
字号:
package gr.osmosis.rcpsamples.contact.actions;

import gr.osmosis.rcpsamples.contact.View;
import gr.osmosis.rcpsamples.contact.db.DAOFactory;
import gr.osmosis.rcpsamples.contact.model.Contact;

import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;

public class AddDemoDataViewActionDelegate implements IViewActionDelegate {

	private IViewPart view;
	
	public void init(IViewPart view) {
		// TODO Auto-generated method stub
		this.view = view;
	}

	public void run(IAction action) {
		// TODO Auto-generated method stub
		DAOFactory f = DAOFactory.getDAOFactory(DAOFactory.DERBY);
		f.getContactsDAO().dropTable();
		f.getContactsDAO().createTable();
		Contact c = new Contact("Stavros", "Kounis", "6973216110");
		f.getContactsDAO().createContact(c);
		
		((View) view).update();
	}

	public void selectionChanged(IAction action, ISelection selection) {
		// TODO Auto-generated method stub

	}

}

⌨️ 快捷键说明

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