List of usage examples for org.eclipse.jface.dialogs MessageDialog openInformation
public static void openInformation(Shell parent, String title, String message)
From source file:com.casmall.common.dialog.MessageConfig.java
License:Open Source License
/** * Save button click//from ww w . ja v a2 s .co m * @param evt */ private void btnSaveMouseDown(MouseEvent evt) { // validation check. if (!validate()) { return; } // process save // set data CmMsgDTO dto = getMsgDtoFromView(); try { // update data int cnt = sem.setMsgEnv(dto); if (cnt != 1) { throw new IOException("Update MsgEnv fail."); } if (!reopenPort()) { return; } MessageDialog.openInformation(dialogShell, "Update Success", "?? ?."); } catch (IOException e) { e.printStackTrace(); } // callback try { CmSerialManager.getInstance().setCallbackWork(true); } catch (IOException e) { e.printStackTrace(); } dialogShell.close(); }
From source file:com.casmall.common.dialog.SerialConfig.java
License:Open Source License
/** * Save button click/* w w w .jav a 2 s . co m*/ * @param evt */ private void btnSaveMouseDown(MouseEvent evt) { CmOsMcDTO dto; try { dto = sem.getOsMcEnv(); dto.setPort_nm(cboPortName.getText()); dto.setBaud_rate(Integer.parseInt(cboBaudRate.getText().replaceAll(",", ""))); dto.setData_bits(Integer.parseInt(cboDataBits.getText())); Object[] keys = mParity.keySet().toArray(); for (int i = 0; i < keys.length; i++) { if (cboParityBits.getText().equals(mParity.get(keys[i]))) { dto.setParity_bits((Integer) keys[i]); break; } } dto.setStop_bits(Integer.parseInt(cboStopBits.getText())); dto.setPort_open_wait_time(Integer.parseInt(txtDelayTime.getText())); dto.setRead_buff_size(Integer.parseInt(txtBufferSize.getText())); dto.setRead_wait_time(Integer.parseInt(txtWaitTime.getText())); dto.setRead_retry_cnt(Integer.parseInt(txtRetryCounts.getText())); sem.setOsMcEnv(dto); if (!reopenPort()) { return; } MessageDialog.openInformation(dialogShell, "Update Success", "?? ?."); } catch (IOException e) { e.printStackTrace(); } dialogShell.close(); }
From source file:com.casmall.dts.manage.ui.auth.AuthMgtEditComposite.java
License:Open Source License
private void btnSaveMouseDown(SelectionEvent evt) { if (!validate()) return;// w ww. j a v a 2 s . c o m if (MessageDialog.openConfirm(getShell(), "", " ?")) { try { // TsAuthMgtDTO pdto = (TsAuthMgtDTO) ObjectUtil.getDefaultObject(TsAuthMgtDTO.class.getName()); pdto.setAuth_key(txtAuthKey.getText()); pdto.setAuth_num(txtAuthNum.getText()); pdto.setCst_nm(txtCustNm.getText()); pdto.setCst_tel(txtCustTel.getText()); pdto.setNt(txtNt.getText().trim()); // if (dto == null) { pdto.setAuth_seq(mgr.selectTsAuthMgtKey()); mgr.insertTsAuthMgt(pdto); } else { // pdto.setAuth_seq(dto.getAuth_seq()); pdto.setRgn_dt(null); pdto.setRgn_id(null); mgr.updateTsAuthMgt(pdto); } callback.callback(CallbackIF.CMD_LIST, null); MessageDialog.openInformation(getShell(), "", " ."); btnClearMouseDown(null); } catch (Exception e) { MessageDialog.openError(getShell(), " Error", e.getMessage()); e.printStackTrace(); log.error(e.getMessage()); } } }
From source file:com.casmall.dts.manage.ui.auth.AuthMgtEditComposite.java
License:Open Source License
private void btnDeleteMouseDown(MouseEvent evt) { try {/*w ww . ja va 2s .com*/ if (dto == null) { this.btnClearMouseDown(null); return; } if (MessageDialog.openConfirm(getShell(), "", " ?")) { dto = (TsAuthMgtDTO) ObjectUtil.getUpdateObject(dto); mgr.deleteTsAuthMgt(dto); callback.callback(CallbackIF.CMD_LIST, null); btnClearMouseDown(null); MessageDialog.openInformation(getShell(), "", " ."); } } catch (Exception e) { MessageDialog.openError(getShell(), " Error", e.getMessage()); log.error(e.getMessage()); } }
From source file:com.casmall.dts.manage.ui.auth.AuthMgtListComposite.java
License:Open Source License
/** * //from w ww. jav a 2 s .c o m * @param evt */ private void btnSelectMouseDown(MouseEvent evt) { selectData(); if (listData == null || listData.size() == 0) { MessageDialog.openInformation(getShell(), " ", " .."); } }
From source file:com.casmall.dts.manage.ui.auth.AuthMgtListComposite.java
License:Open Source License
private void btnExportMouseDown(MouseEvent evt) { if (listData == null) { MessageDialog.openInformation(this.getShell(), "", " ?"); return;/*from w w w . ja va 2s. c om*/ } FileDialog dialog = new FileDialog(this.getShell(), SWT.SAVE); dialog.setFilterNames(new String[] { "Excel Files", "All Files (*.*)" }); dialog.setFilterExtensions(new String[] { "*.xls", "*.*" }); dialog.setFileName("AuthMgt.xls"); String saveFile = dialog.open(); if (saveFile == null) { return; } saveExport(saveFile, " "); }
From source file:com.casmall.dts.manage.ui.auth.AuthMgtListComposite.java
License:Open Source License
/** * Excel //from www.ja v a2 s . c o m * @param saveFile */ private void saveExport(String saveFile, String... str) { RvExcelWriter w = new RvExcelWriter(saveFile); ExportVO export = new ExportVO(); export.setWidth(colWidth); export.setTitle(str[0]); export.setHeader(colName); if (str.length > 1) export.setCond(str[1]); export.setData(listData.toArray(), colProp); try { w.write(export); MessageDialog.openInformation(this.getShell(), "", " ."); } catch (IOException e) { MessageDialog.openError(this.getShell(), "Export Fail", "[Error] .\n\n" + e.getMessage()); } }
From source file:com.casmall.dts.ui.master.CarEditComposite.java
License:Open Source License
private void btnSaveMouseDown(SelectionEvent evt) { if (!validate()) return;/* w w w. j a va2 s . com*/ if (MessageDialog.openConfirm(getShell(), "", "?")) { try { // TsCarMstDTO pdto = (TsCarMstDTO) ObjectUtil.getDefaultObject(TsCarMstDTO.class.getName()); pdto.setCar_num(txtCarNum.getText().trim()); pdto.setCar_mgt_cd(txtCarMgtCd.getText().trim()); pdto.setNt(txtNt.getText().trim()); if (btnCheck.getSelection()) pdto.setMgt_yn(DTSConstants.FLAG_Y); else pdto.setMgt_yn(DTSConstants.FLAG_N); // if (dto == null) { pdto.setCar_cd(mgr.selectTsCarMstKey()); mgr.insertTsCarMst(pdto); } else { // pdto.setCar_cd(dto.getCar_cd()); pdto.setRgn_dt(null); pdto.setRgn_id(null); mgr.updateTsCarMst(pdto); } callback.callback(CallbackIF.CMD_LIST, null); MessageDialog.openInformation(getShell(), "", " ."); btnClearMouseDown(null); } catch (Exception e) { MessageDialog.openError(getShell(), " Error", e.getMessage()); e.printStackTrace(); log.error(e.getMessage()); } } }
From source file:com.casmall.dts.ui.master.CarEditComposite.java
License:Open Source License
private void btnDeleteMouseDown(MouseEvent evt) { try {/* w w w.j a va 2s .c o m*/ if (dto == null) { this.btnClearMouseDown(null); return; } if (MessageDialog.openConfirm(getShell(), "", " ?")) { dto = (TsCarMstDTO) ObjectUtil.getUpdateObject(dto); mgr.deleteTsCarMst(dto); callback.callback(CallbackIF.CMD_LIST, null); btnClearMouseDown(null); MessageDialog.openInformation(getShell(), "", " ."); } } catch (Exception e) { MessageDialog.openError(getShell(), " Error", e.getMessage()); log.error(e.getMessage()); } }
From source file:com.casmall.dts.ui.master.CarListComposite.java
License:Open Source License
/** * // ww w . j a v a 2 s . co m * @param evt */ private void btnSelectMouseDown(MouseEvent evt) { selectData(); if (listData == null || listData.size() == 0) { MessageDialog.openInformation(getShell(), " ", " ."); } }