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

📄 newcontactwizard.java

📁 基于RCP实现的CRM系统, 数据库使用mysql数据库, 是学习RCP应用和插件的很好的例子
💻 JAVA
字号:
package superCRM.dialog;

import org.eclipse.jface.wizard.Wizard;

import superCRM.model.IContactSerivce;
import superCRM.model.SuperFactory;
import superCRM.pojos.ContactEO;
import superCRM.pojos.CustomerEO;

public class NewContactWizard extends Wizard {
	/** 选择客户页面 */
	private SelectCustomerPage selectCustomerPage;

	/** 新建联系人页面 */
	private NewContactWizardPage newContactPage;

	/** 构造方法,初始化页面 */
	public NewContactWizard() {
		selectCustomerPage = new SelectCustomerPage();
		this.addPage(selectCustomerPage);
		newContactPage = new NewContactWizardPage();
		this.addPage(newContactPage);
		this.setWindowTitle("新建联系人向导");
	}

	/** 单击完成按钮时 */
	public boolean performFinish() {
		/** 获得新建联系人页面的联系人对象 */
		ContactEO contact = newContactPage.getContact();
		/** 如果联系人对象为null */
		if (contact == null)
			return true;
		/** 获得选择客户页面所选择的客户对象 */
		CustomerEO customer = selectCustomerPage.getCusotmer();
		/** 设置联系人的客户ID */
		contact.setCustomerId(customer.getId());
		/** 调用业务层,保存联系人信息 */
		IContactSerivce contactSerivce = SuperFactory.getSuperApplication().getContactSerivce();
		contactSerivce.addContact(contact);
		return true;
	}

}

⌨️ 快捷键说明

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