📄 newcustomeraction.java
字号:
package superCRM.action;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
import superCRM.SuperCRMPlugin;
import superCRM.dialog.NewCustomerWizard;
public class NewCustomerAction extends Action implements IWorkbenchAction {
/** 操作所对应的ID */
public static final String ID = "superCRM.action.NewCustomerAction";
private IWorkbenchWindow workbenchWindow;
public NewCustomerAction(IWorkbenchWindow window) {
if (window == null) {
throw new IllegalArgumentException();
}
this.workbenchWindow = window;
/** 设置ID */
setId(ID);
setActionDefinitionId(ID);
setText("新建客户");
setImageDescriptor(SuperCRMPlugin.getImageDescriptor("icons/customer.gif"));
}
public void run() {
if (workbenchWindow == null) {
return;
}
/** 打开新建客户对话框 */
WizardDialog dlg = new WizardDialog(workbenchWindow.getShell(), new NewCustomerWizard(workbenchWindow));
dlg.open();
}
public void dispose() {
workbenchWindow = null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -