- .replace("[", "'").replace("]", "'").replace(", ", "', '")
- EAS系统菜单表 T_BAS_SysMenuItem
- //java次方算法i的n次方
- Math.pow(i, n);
- //校验菜单存在与校验表存在
- if not exists (select * from T_BAS_ParamValueRange where fid ='yh9pCZ0xTNGP8dxwAJDrWxsoUZM=')
- if not exists (select * from KSQL_USERTABLES where KSQL_TABNAME='CT_INV_InviteApplyNotice')
- //HR与组织范围的交集过滤
- String userID = ((UserInfo) (SysContext.getSysContext().getCurrentUser())).getId().toString();
- String hrOrgUnitId = SysContext.getSysContext().getCurrentHRUnit().getId().toString();
- StringBuffer sql = new StringBuffer();
- sql.append("SELECT FFromUnitID FROM T_ORG_UnitRelation WHERE FToUnitID = ");
- sql.append("'");
- sql.append(hrOrgUnitId);
- sql.append("'");
- sql.append(" AND ");
- sql.append(" FTypeRelationID = ");
- sql.append("'00000000-0000-0000-0000-0000000000100FE9F8B5'");
- sql.append(" AND ");
- sql.append("FFromUnitID IN (");
- sql.append("SELECT FOrgID FROM T_PM_OrgRange WHERE FUserID = ");
- sql.append("'");
- sql.append(userID);
- sql.append("'");
- sql.append(" AND ");
- sql.append("FType = ");
- sql.append(OrgRangeType.ADMIN_ORG_TYPE_VALUE);
- sql.append(")");
- EntityViewInfo filter = new EntityViewInfo();
- FilterInfo filterInfo = new FilterInfo();
- filterInfo.getFilterItems().add(new FilterItemInfo("usedStatus", "1", CompareType.EQUALS));
- filterInfo.getFilterItems().add(new FilterItemInfo("internalCompany.id in ("+sql.toString()+")"));
- filter.setFilter(filterInfo);
- // 查看是否有相关操作权限
- boolean hasAllotPermission = true;
- try {
- hasAllotPermission = PermissionFactory.getRemoteInstance()
- .hasFunctionPermission(new ObjectUuidPK(userId),
- new ObjectUuidPK(orgId),
- "jc_persale_contract_Allot");
- } catch (EASBizException e1) {
- e1.printStackTrace();
- } catch (BOSException e1) {
- e1.printStackTrace();
- }
- //客户端sql查询代码
- IRowSet set = SQLExecutorFactory.getRemoteInstance("select FIP from CT_SM_Config").executeSQL();
- //去掉关闭eas页面时校验是否修改的提示
- 页面重写checkBeforeWindowClosing()方法返回true值。
- //eas代码中数据绑定
- dataBinder.registerBinding("entry.alterDate", java.util.Date.class, this.kdtEntry, "alterDate.text");
- dataBinder.registerBinding("comChangeRecord", String.class, this.txtcomChangeRecord, "text");
- //eas中Action的创建
- protected KDWorkButton btnFileManage;
- protected ActionFileManage actionFileManage = null;
- public void onLoad() throws Exception {
- super.onLoad();
- this.actionFileManage = new ActionFileManage(this);
- getActionManager().registerAction("actionFileManage", actionFileManage);
- this.actionFileManage.addService(new com.kingdee.eas.framework.client.service.PermissionService());
- this.btnFileManage = new KDWorkButton();
- this.btnFileManage.setEnabled(true);
- this.btnFileManage.setName("btnFileManage");
- this.btnFileManage.setAction((IItemAction)ActionProxyFactory.getProxy(actionFileManage, new Class[] { IItemAction.class }, getServiceContext()));
- this.btnFileManage.setText("档案管理");
- this.btnFileManage.setIcon(com.kingdee.eas.util.client.EASResource.getIcon("imgTree_layoutproject"));
- this.toolBar.add(btnFileManage);
- this.btnFileManage.setEnabled(true);
- }
- protected class ActionFileManage extends ItemAction {
- public ActionFileManage() {
- this(null);
- }
- public ActionFileManage(IUIObject uiObject) {
- super(uiObject);
- String _tempStr = null;
- this.setEnabled(false);
- _tempStr = "档案管理";
- this.putValue(ItemAction.SHORT_DESCRIPTION, _tempStr);
- _tempStr = "档案管理";
- this.putValue(ItemAction.LONG_DESCRIPTION, _tempStr);
- _tempStr = "档案管理";
- this.putValue(ItemAction.NAME, _tempStr);
- }
- public void actionPerformed(ActionEvent e) {
- getUIContext().put("ORG.PK", getOrgPK(this));
- innerActionPerformed("eas", ComFileAssoUI.this, "ActionFileManage", "actionFileManage_actionPerformed", e);
- }
- }
- public void actionFileManage_actionPerformed(ActionEvent e) throws Exception {
- ComUnitInfo comUnitInfo = this.getComUnit();
- Map params = new UIContext(this);
- params.put("comUnit", comUnitInfo);
- params.put("operate", "manage");
- if(comUnitInfo != null)
- params.put("mainId", comUnitInfo.getMainId());
- uiWindow = UIFactory.createUIFactory(UIFactoryName.MODEL).create(
- "com.kingdee.eas.zsj.propertymanagementend.client.ComFileManageUI", params, null, OprtState.ADDNEW);
- uiWindow.show();
- }
- //设置kDContainer显示模式默认为0,可向下展开收缩;1,固定;2?
- kDContainer1.setContainerType(1);
- //在EAS查询分析器中查看对应的服务器端脚本
- geninsert +sql语句 再选中点击‘运行服务器端脚本’
- //在EAS里Confirm2为2按钮提示框(确定、取消),确定返回0,取消返回2
- if (MsgBox.showConfirm2("您选中的第"+(i+1)+"条数据是未归档数据,如果继续,该数据的附件将不会下载,是否继续?") == 0) {
- continue;
- } else {
- SysUtil.abort();
- }
- //在EAS里Confirm3为3按钮提示框(是、否、取消),是返回0,否返回1,取消返回2
- if (MsgBox.showConfirm3("您选中的第"+(i+1)+"条数据是未归档数据,如果继续,该数据的附件将不会下载,是否继续?") == 0) {
- continue;
- } else {
- SysUtil.abort();
- }
- //EAS单据转换转换之前方法接口,用于实现单据转换自定义控制
- public void beforeTransform(IObjectCollection srcObjCols,
- String destBillBosType) {
- super.beforeTransform(srcObjCols, destBillBosType);
- }
- //EAS单据转换目标单据后台事务方法,用于实现单据转换自定义控制
- public void handleAfterTransform(Context ctx, String action,
- IObjectCollection collection) throws BOSException, EASBizException {
- super.handleAfterTransform(ctx, action, collection);
- }
- //EAS通过单据ID获得单据实体BOSTYPE
- BOSUuid.getBOSObjectType(billID, true);
- //修改EAS编辑界面中分录默认携带的标题栏
- this.kdtEntrys_detailPanel.setTitle("物件内容");
- KDContainer kdtEntrys_Container = (KDContainer) ((KDPanel) this.kdtEntrys_detailPanel.getComponent(0)).getComponent(0);
- ((KDPanel) this.kdtEntrys_detailPanel.getComponent(0)).remove(0);
- ((KDPanel) this.kdtEntrys_detailPanel.getComponent(0)).add(kdtEntrys_Container, new KDLayout.Constraints(0, 5, 983, 19, KDLayout.Constraints.ANCHOR_TOP | KDLayout.Constraints.ANCHOR_LEFT | KDLayout.Constraints.ANCHOR_RIGHT));
- age:
- this.kdtEntry_detailPanel.setTitle("分支机构");
- this.kdtEntry.getStyleAttributes().setLocked(true);
- this.kdtEntry.getSelectManager().setSelectMode(2);
- if (((KDPanel) this.kdtEntry_detailPanel.getComponent(0)).getComponent(0) instanceof KDContainer) {
- KDContainer kdtEntrys_Container = (KDContainer) ((KDPanel) this.kdtEntry_detailPanel.getComponent(0)).getComponent(0);
- ((KDPanel) this.kdtEntry_detailPanel.getComponent(0)).remove(0);
- ((KDPanel) this.kdtEntry_detailPanel.getComponent(0)).add(kdtEntrys_Container, new KDLayout.Constraints(0, 5, 749, 19, KDLayout.Constraints.ANCHOR_TOP | KDLayout.Constraints.ANCHOR_LEFT | KDLayout.Constraints.ANCHOR_RIGHT));
- }
- if (((KDPanel) this.kdtEntry_detailPanel.getComponent(0)).getComponent(0) instanceof KDWorkButton && ((KDWorkButton) ((KDPanel) this.kdtEntry_detailPanel.getComponent(0)).getComponent(0)).getName().equals("btnAddnewLine")) {
- KDWorkButton btnAddnewLine = ((KDWorkButton) ((KDPanel) this.kdtEntry_detailPanel.getComponent(0)).getComponent(0));
- btnAddnewLine.setIcon(null);
- btnAddnewLine.setText("新增分支机构");
- btnAddnewLine.setToolTipText("新增分支机构");
- btnAddnewLine.removeActionListener(btnAddnewLine.getActionListeners() [0]);
- btnAddnewLine.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- try {
- BranchAddNew(e);
- } catch (Exception e1) {
- e1.printStackTrace();
- }
- }
- });
- ((KDPanel) this.kdtEntry_detailPanel.getComponent(0)).remove(0);
- ((KDPanel) this.kdtEntry_detailPanel.getComponent(0)).add(btnAddnewLine, new KDLayout.Constraints(399, 5, 110, 19, KDLayout.Constraints.ANCHOR_TOP | KDLayout.Constraints.ANCHOR_RIGHT), 0);
- }
- if (((KDPanel) this.kdtEntry_detailPanel.getComponent(0)).getComponent(1) instanceof KDWorkButton && ((KDWorkButton) ((KDPanel) this.kdtEntry_detailPanel.getComponent(0)).getComponent(1)).getName().equals("btnInsertLine")) {
- KDWorkButton btnInsertLine = ((KDWorkButton) ((KDPanel) this.kdtEntry_detailPanel.getComponent(0)).getComponent(1));
- btnInsertLine.setIcon(null);
- btnInsertLine.setText("修改分支机构");
- btnInsertLine.setToolTipText("修改分支机构");
- btnInsertLine.removeActionListener(btnInsertLine.getActionListeners() [0]);
- btnInsertLine.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- try {
- BranchEdit(e);
- } catch (Exception e1) {
- e1.printStackTrace();
- }
- }
- });
- ((KDPanel) this.kdtEntry_detailPanel.getComponent(0)).remove(1);
- ((KDPanel) this.kdtEntry_detailPanel.getComponent(0)).add(btnInsertLine, new KDLayout.Constraints(514, 5, 110, 19, KDLayout.Constraints.ANCHOR_TOP | KDLayout.Constraints.ANCHOR_RIGHT), 1);
- }
- if (((KDPanel) this.kdtEntry_detailPanel.getComponent(0)).getComponent(2) instanceof KDWorkButton && ((KDWorkButton) ((KDPanel) this.kdtEntry_detailPanel.getComponent(0)).getComponent(2)).getName().equals("btnRemoveLines")) {
- KDWorkButton btnRemoveLines = ((KDWorkButton) ((KDPanel) this.kdtEntry_detailPanel.getComponent(0)).getComponent(2));
- btnRemoveLines.setIcon(null);
- btnRemoveLines.setText("删除分支机构");
- btnRemoveLines.setToolTipText("删除分支机构");
- ((KDPanel) this.kdtEntry_detailPanel.getComponent(0)).remove(2);
- ((KDPanel) this.kdtEntry_detailPanel.getComponent(0)).add(btnRemoveLines, new KDLayout.Constraints(629, 5, 110, 19, KDLayout.Constraints.ANCHOR_TOP | KDLayout.Constraints.ANCHOR_RIGHT), 2);
- }
- //EAS检查单据是否在流程中
- import com.kingdee.bos.ui.face.CoreUIObject;
- import com.kingdee.bos.workflow.ProcessInstInfo;
- import com.kingdee.bos.workflow.service.ormrpc.EnactmentServiceFactory;
- import com.kingdee.bos.workflow.service.ormrpc.IEnactmentService;
- public static boolean checkBillInWorkflow(CoreUIObject ui, String id) {
- ProcessInstInfo instInfo = null;
- ProcessInstInfo procInsts[] = null;
- try {
- IEnactmentService service2 = EnactmentServiceFactory.createRemoteEnactService();
- procInsts = service2.getProcessInstanceByHoldedObjectId(id);
- } catch(BOSException e) {
- ExceptionHandler.handle(e);
- return false;
- }
- int i = 0;
- for (int n = procInsts.length; i < n; i++)
- if("open.running".equals(procInsts[i].getState()) || "open.not_running.suspended".equals(procInsts[i].getState()))
- instInfo = procInsts[i];
- if (instInfo != null) {
- return true;
- }
- return false;
- }
- //EASList界面设置打开的Edit界面模式
- import com.kingdee.eas.common.client.UIFactoryName;
- import com.kingdee.eas.framework.util.UIConfigUtility;
- protected String getEditUIModal() {
- String openModel = UIConfigUtility.getOpenModel();
- if (openModel != null) {
- return openModel;
- }
- return UIFactoryName.MODEL;
- }
- //EASEdit界面关闭提交以后继续新增(提交并新增、提交并打印)
- protected boolean isSubmitLoad() {
- return false;
- }
- protected boolean isContinueAddNew() {
- return false;
- }
- chkMenuItemSubmitAndAddNew.setSelected(false);
- chkMenuItemSubmitAndPrint.setSelected(false);
- //EAS创建一个UI界面并对其操作
- age:
- private void BranchAddNew(ActionEvent e) {
- UIContext uiContext = new UIContext(this);
- uiContext.put(UIContext.ID, null);
- uiContext.put(UIContext.OWNER, this);
- uiContext.put("parent", editData);
- IUIWindow uiWindow = null;
- try {
- uiWindow = UIFactory.createUIFactory(UIFactoryName.NEWWIN).create(BranchShowUI.class.getName(), uiContext, null, OprtState.ADDNEW);
- uiWindow.show();
- } catch (UIException e1) {
- e1.printStackTrace();
- }
- }
- //EAS中获得任何一个KDTable的选中行
- import com.kingdee.bos.ctrl.kdf.table.util.KDTableUtil;
- int[] selectRows = KDTableUtil.getSelectedRows(this.kdtEntry);
- age:
- int[] selectRows = KDTableUtil.getSelectedRows(this.kdtEntry);
- if (selectRows.length <= 0) {
- MsgBox.showInfo("请选择要修改的数据");
- SysUtil.abort();
- }
- //去掉EAS单据新增时单据组织与当前组织不一致的校验
- protected void checkIsOUSealUp() throws Exception {
- // super.checkIsOUSealUp();
- }
- //把EAS左树右表基础资料界面引用为左树右表F7的简单方法
- age:
- /**
- * 加载配件F7(左树右表)
- * @param F7Filed 要加载的F7控件
- * @param ctx 界面上下文
- * @单据中用法示例
- * final KDBizPromptBox kdtEntrys_accessories_PromptBox = new KDBizPromptBox();
- * CommonUtil.loadAccessoriesF7PromptBox(kdtEntrys_accessories_PromptBox, this.getUIContext());
- * @throws Exception
- */
- public static void loadAccessoriesF7PromptBox(final KDBizPromptBox F7Filed, Map ctx) throws Exception {
- F7Filed.setQueryInfo("com.kingdee.eas.mydep.assetmanage.database.app.AccessoriesQuery");
- F7Filed.setEntityViewInfo(new EntityViewInfo("where state=1"));
- F7Filed.setDisplayFormat("$name$");
- F7Filed.setEditFormat("$number$");
- F7Filed.setCommitFormat("$number$");
- F7Filed.addSelectorListener(new SelectorListener() {
- AccessoriesListUI accessoriesF7UI = null;
- public void willShow(SelectorEvent e) {
- if (accessoriesF7UI == null) {
- try {
- accessoriesF7UI = new AccessoriesListUI();
- HashMap ctx = new HashMap();
- ctx.put("bizUIOwner", javax.swing.SwingUtilities.getWindowAncestor(accessoriesF7UI));
- accessoriesF7UI.setF7Use(true, ctx);
- accessoriesF7UI.setFilterForQuery(new FilterInfo("state=1"));
- } catch (ParserException e1) {
- e1.printStackTrace();
- } catch (Exception e2) {
- e2.printStackTrace();
- }
- F7Filed.setSelector(accessoriesF7UI);
- }
- }
- });
- }
- //获取EAS中的指定系统参数
- IParamControl ipc = ParamControlFactory.getLocalInstance(ctx);
- String level = ipc.getParamValue(new ObjectUuidPK(ContextUtil.getCurrentHRUnit(ctx).getId().toString()), "IS_CONTRAL_SHOW_DEPT_LEVEL");
- //EAS序事薄界面过滤示例
- protected FilterInfo getDefaultFilterForQuery() {
- FilterInfo filter = super.getDefaultFilterForQuery();
- try {
- boolean haspermission = PermissionFactory.getRemoteInstance().hasFunctionPermission(getUserPk(), getOrgPK(),"SSSCC_HR_Workovertime_showall");
- if (!haspermission) {
- UserInfo userInfo = SysContext.getSysContext().getCurrentUserInfo();
- if (filter == null) {
- filter = new FilterInfo();
- filter.getFilterItems().add(new FilterItemInfo("creator.id", userInfo==null?" ":userInfo.getId().toString()));
- filter.getFilterItems().add(new FilterItemInfo("auditor.id", userInfo==null?" ":userInfo.getId().toString()));
- filter.getFilterItems().add(new FilterItemInfo("applier.id", userInfo==null?" ":(userInfo.getPerson()==null?" ":userInfo.getPerson().getId().toString())));
- filter.setMaskString(" #0 or #1 or #2 ");
- } else {
- FilterInfo _filter = new FilterInfo();
- _filter.getFilterItems().add(new FilterItemInfo("creator.id", userInfo==null?" ":userInfo.getId().toString()));
- _filter.getFilterItems().add(new FilterItemInfo("auditor.id", userInfo==null?" ":userInfo.getId().toString()));
- _filter.getFilterItems().add(new FilterItemInfo("applier.id", userInfo==null?" ":(userInfo.getPerson()==null?" ":userInfo.getPerson().getId().toString())));
- _filter.setMaskString(" #0 or #1 or #2 ");
- filter.mergeFilter(_filter, "and");
- }
- List billIDList = ZQHRUtils.getAuditorInBillID("加班申请单");
- if (billIDList != null) {
- FilterInfo _filter = new FilterInfo();
- _filter.getFilterItems().add(new FilterItemInfo("id", billIDList.toString().replace("[", "'").replace("]", "'").replace(", ", "', '"), CompareType.INNER));
- filter.mergeFilter(_filter, "or");
- }
- }
- } catch (EASBizException e) {
- e.printStackTrace();
- } catch (BOSException e) {
- e.printStackTrace();
- } catch (Exception e) {
- e.printStackTrace();
- }
- SorterItemInfo sii = new SorterItemInfo("createTime");
- sii.setSortType(SortType.DESCEND);
- mainQuery.getSorter().add(sii);
- return filter;
- }
- protected IQueryExecutor getQueryExecutor(IMetaDataPK pk, EntityViewInfo viewInfo) {
- FilterInfo filter = null;
- if (viewInfo == null) {
- viewInfo = new EntityViewInfo();
- filter = new FilterInfo();
- } else {
- filter = viewInfo.getFilter();
- FilterItemCollection filterColl = filter.getFilterItems();
- for (int i=0; i<filterColl.size(); i++) {
- filter.getMaskString();
- FilterItemInfo itemInfo = filterColl.get(i);
- if (itemInfo.toString().indexOf("id IN") != -1) {
- try {
- List billIDList = ZQHRUtils.getAuditorInBillID("加班申请单");
- if (billIDList != null) {
- filter.getFilterItems().removeObject(itemInfo);
- filter.getFilterItems().addObject(i, new FilterItemInfo("id", billIDList.toString().replace("[", "'").replace("]", "'").replace(", ", "', '"), CompareType.INNER));
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
- }
- return super.getQueryExecutor(pk, viewInfo);
- }
- //EAS编辑界面重新加载数据
- this.loadData();
- //EAS中设定table选择模式
- tblMain.getSelectManager().setSelectMode(0);--不能选择
- tblMain.getSelectManager().setSelectMode(1);--选择单元格
- tblMain.getSelectManager().setSelectMode(2);--单选行
- tblMain.getSelectManager().setSelectMode(3);--选择单元格
- tblMain.getSelectManager().setSelectMode(4);--单选列
- //EAS中删除原来的监听事件添加新的监听事件
- kdtEntrys.removeKDTEditListener(kdtEntrys.getListeners(KDTEditListener.class)[0]);
- kdtEntrys.addKDTEditListener(new KDTEditAdapter() {
- public void editStopped(KDTEditEvent e) {
- try {
- kdtEntrys_Changed(e);
- }
- catch (Exception exc) {
- handUIException(exc);
- }
- }
- });
- //EAS序事薄界面更改显示过滤条件和排序
- protected FilterInfo getDefaultFilterForQuery() {
- FilterInfo filter = super.getDefaultFilterForQuery();
- try {
- boolean haspermission = PermissionFactory.getRemoteInstance().hasFunctionPermission(getUserPk(), getOrgPK(),"SSSCC_HR_Workovertime_showall");
- if (!haspermission) {
- UserInfo userInfo = SysContext.getSysContext().getCurrentUserInfo();
- if (filter == null) {
- filter = new FilterInfo();
- filter.getFilterItems().add(new FilterItemInfo("creator.id", userInfo==null?" ":userInfo.getId().toString()));
- filter.getFilterItems().add(new FilterItemInfo("auditor.id", userInfo==null?" ":userInfo.getId().toString()));
- filter.getFilterItems().add(new FilterItemInfo("applier.id", userInfo==null?" ":(userInfo.getPerson()==null?" ":userInfo.getPerson().getId().toString())));
- filter.setMaskString(" #0 or #1 or #2 ");
- } else {
- FilterInfo _filter = new FilterInfo();
- _filter.getFilterItems().add(new FilterItemInfo("creator.id", userInfo==null?" ":userInfo.getId().toString()));
- _filter.getFilterItems().add(new FilterItemInfo("auditor.id", userInfo==null?" ":userInfo.getId().toString()));
- _filter.getFilterItems().add(new FilterItemInfo("applier.id", userInfo==null?" ":(userInfo.getPerson()==null?" ":userInfo.getPerson().getId().toString())));
- _filter.setMaskString(" #0 or #1 or #2 ");
- filter.mergeFilter(_filter, "and");
- }
- List billIDList = ZQHRUtils.getAuditorInBillID("加班申请单");
- if (billIDList != null) {
- FilterInfo _filter = new FilterInfo();
- _filter.getFilterItems().add(new FilterItemInfo("id", billIDList.toString().replace("[", "'").replace("]", "'").replace(", ", "', '"), CompareType.INNER));
- filter.mergeFilter(_filter, "or");
- }
- }
- } catch (EASBizException e) {
- e.printStackTrace();
- } catch (BOSException e) {
- e.printStackTrace();
- } catch (Exception e) {
- e.printStackTrace();
- }
- SorterItemInfo sii = new SorterItemInfo("createTime");
- sii.setSortType(SortType.DESCEND);
- mainQuery.getSorter().add(sii);
- return filter;
- }
- //获取单据编码规则
- /**
- * @Title: getNumber
- * @Description: TODO(获取单据编码规则)
- * <p>
- * @date 2010-11-12
- * @param dataBaseInfo model.put("number", JCBillUtil.getNumber(model, null));
- * @return
- */
- public static String getNumber(IObjectValue objectValue, String companyId)
- {
- // 设置编码规则
- if(null == companyId)
- {
- companyId = getCurCompanyOrgUnit().getId().toString();
- }
- try
- {
- ICodingRuleManager rule = CodingRuleManagerFactory.getRemoteInstance();
- if(rule.isExist(objectValue, companyId))
- {
- return rule.getNumber(objectValue, companyId);
- }
- }catch(Exception e)
- {
- e.printStackTrace();
- return null;
- }
- return null;
- }
- //java创建文件
- import java.io.RandomAccessFile;
- RandomAccessFile inOut = new RandomAccessFile("C:\\Documents and Settings\\Administrator\\桌面\\天健\\patch\\edit\\"+contentColl.get(i).getFileName(), "rw");
- inOut.write(contentColl.get(i).getContentFile());
- inOut.close();
- //流程审批界面保存按钮Action绑定改为当前单据saveAction
- if(this.getUIContext().get("Owner") instanceof MultiApproveUI) {
- MultiApproveUI wfUI = (MultiApproveUI)this.getUIContext().get("Owner");
- KDToolBar wfToolBar = wfUI.getUIToolBar();
- Component[] components = wfToolBar.getComponents();
- KDWorkButton wfBtnSave = null;
- for (int i=0; i<(components.length-1); i++) {
- if (components[i] instanceof KDWorkButton && components[i].getName().equals("btnSave")) {
- wfBtnSave = (KDWorkButton) components[i];
- wfBtnSave.removeActionListener(wfBtnSave.getAction());
- wfBtnSave.setAction(actionSave);
- break;
- }
- }
- }
- //清除分录删除事件
- int n = kdtEntrys_detailPanel.getRemoveLinesButton().getActionListeners().length;
- if (n > 0) {
- for (int i=0; i<n; i++) {
- kdtEntrys_detailPanel.getRemoveLinesButton().removeActionListener(kdtEntrys_detailPanel.getRemoveLinesButton().getActionListeners() [i]);
- }
- }
- kdtEntrys_detailPanel.getRemoveLinesButton().addActionListener(actionRemoveLine);
- //清除分录插入事件
- n = kdtEntrys_detailPanel.getInsertLineButton().getActionListeners().length;
- if (n > 0) {
- for (int i=0; i<n; i++) {
- kdtEntrys_detailPanel.getInsertLineButton().removeActionListener(kdtEntrys_detailPanel.getInsertLineButton().getActionListeners() [i]);
- }
- }
- kdtEntrys_detailPanel.getInsertLineButton().addActionListener(actionInsertLine);
- //清除分录新增事件
- n = kdtEntrys_detailPanel.getAddNewLineButton().getActionListeners().length;
- if (n > 0) {
- for (int i=0; i<n; i++) {
- kdtEntrys_detailPanel.getAddNewLineButton().removeActionListener(kdtEntrys_detailPanel.getAddNewLineButton().getActionListeners() [i]);
- }
- }
- kdtEntrys_detailPanel.getAddNewLineButton().addActionListener(actionAddLine);
eas bos 常用代码
最新推荐文章于 2024-03-25 14:24:29 发布