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.dts.ui.master.CarListComposite.java
License:Open Source License
private void btnExportMouseDown(MouseEvent evt) { if (listData == null) { MessageDialog.openInformation(this.getShell(), "", " ."); return;//from w ww. ja v a2 s . c o m } FileDialog dialog = new FileDialog(this.getShell(), SWT.SAVE); dialog.setFilterNames(new String[] { "Excel Files", "All Files (*.*)" }); dialog.setFilterExtensions(new String[] { "*.xls", "*.*" }); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); dialog.setFileName(" " + sdf.format(new Date()) + ".xls"); String saveFile = dialog.open(); if (saveFile == null) { return; } saveExport(saveFile, " "); }
From source file:com.casmall.dts.ui.master.CarListComposite.java
License:Open Source License
/** * Excel //from w w w . j ava 2 s. c om * @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(), "", "Excel ."); } catch (IOException e) { MessageDialog.openError(this.getShell(), "Export Fail", "[Error] .\n\n" + e.getMessage()); } }
From source file:com.casmall.dts.ui.master.CstEditComposite.java
License:Open Source License
private void btnSaveMouseDown(SelectionEvent evt) { if (!validate()) return;/* w w w. j a v a 2s. c o m*/ if (MessageDialog.openConfirm(getShell(), "", "?")) { try { // TsCstMstDTO pdto = (TsCstMstDTO) ObjectUtil.getDefaultObject(TsCstMstDTO.class.getName()); pdto.setCst_nm(txtCstNm.getText().trim()); pdto.setCst_mgt_cd(txtCstMgtCd.getText().trim()); pdto.setNt(txtNt.getText().trim()); pdto.setRpr_nm(txtRprNm.getText().trim()); pdto.setTel(txtTel.getText().trim()); if (btnCheck.getSelection()) pdto.setMgt_yn(DTSConstants.FLAG_Y); else pdto.setMgt_yn(DTSConstants.FLAG_N); // if (dto == null) { pdto.setCst_cd(mgr.selectTsCstMstKey()); mgr.insertTsCstMst(pdto); } else { // pdto.setCst_cd(dto.getCst_cd()); pdto.setRgn_dt(null); pdto.setRgn_id(null); mgr.updateTsCstMst(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.CstEditComposite.java
License:Open Source License
private void btnDeleteMouseDown(MouseEvent evt) { try {//from w w w . j av a 2s . c o m if (dto == null) { this.btnClearMouseDown(null); return; } if (MessageDialog.openConfirm(getShell(), "", " ?")) { dto = (TsCstMstDTO) ObjectUtil.getUpdateObject(dto); mgr.deleteTsCstMst(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.CstListComposite.java
License:Open Source License
private void btnExportMouseDown(MouseEvent evt) { if (listData == null) { MessageDialog.openInformation(this.getShell(), "", " ."); return;//from www .ja v a 2 s. c o m } FileDialog dialog = new FileDialog(this.getShell(), SWT.SAVE); dialog.setFilterNames(new String[] { "Excel Files", "All Files (*.*)" }); dialog.setFilterExtensions(new String[] { "*.xls", "*.*" }); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); dialog.setFileName(" " + sdf.format(new Date()) + ".xls"); String saveFile = dialog.open(); if (saveFile == null) { return; } saveExport(saveFile, " "); }
From source file:com.casmall.dts.ui.master.PrdtEditComposite.java
License:Open Source License
private void btnSaveMouseDown(SelectionEvent evt) { if (!validate()) return;//from www . ja va2 s. c o m if (MessageDialog.openConfirm(getShell(), "", "?")) { try { // TsPrdtMstDTO pdto = (TsPrdtMstDTO) ObjectUtil.getDefaultObject(TsPrdtMstDTO.class.getName()); pdto.setPrdt_nm(txtPrdtNm.getText().trim()); pdto.setPrdt_mgt_cd(txtPrdtMgtCd.getText().trim()); if ("".equals(txtUnitPrice.getControl().getText())) { pdto.setUnt_prc(0); } else { pdto.setUnt_prc(Integer.parseInt(txtUnitPrice.getControl().getText().replaceAll(",", ""))); } 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.setPrdt_cd(mgr.selectTsPrdtMstKey()); mgr.insertTsPrdtMst(pdto); } else { // pdto.setPrdt_cd(dto.getPrdt_cd()); pdto.setRgn_dt(null); pdto.setRgn_id(null); mgr.updateTsPrdtMst(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.PrdtEditComposite.java
License:Open Source License
private void btnDeleteMouseDown(MouseEvent evt) { try {/*from w w w . ja v a 2 s. c o m*/ if (dto == null) { this.btnClearMouseDown(null); return; } if (MessageDialog.openConfirm(getShell(), "", " ?")) { dto = (TsPrdtMstDTO) ObjectUtil.getUpdateObject(dto); mgr.deleteTsPrdtMst(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.PrdtListComposite.java
License:Open Source License
private void btnExportMouseDown(MouseEvent evt) { if (listData == null) { MessageDialog.openInformation(this.getShell(), "", " ."); return;// ww w . j av a 2 s . c om } FileDialog dialog = new FileDialog(this.getShell(), SWT.SAVE); dialog.setFilterNames(new String[] { "Excel Files", "All Files (*.*)" }); dialog.setFilterExtensions(new String[] { "*.xls", "*.*" }); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); dialog.setFileName(" " + sdf.format(new Date()) + ".xls"); String saveFile = dialog.open(); if (saveFile == null) { return; } saveExport(saveFile, " "); }
From source file:com.casmall.dts.ui.usr.UsrInfEditComposite.java
License:Open Source License
private void btnSaveMouseDown(SelectionEvent evt) { if (DTSConstants.CD_USR_GRD_USER.equals(usr.getAth_grd()) && dto.getUsr_seq() != usr.getUsr_seq()) { MessageDialog.openError(getShell(), " ", " . \n\n ."); return;/*from www . j a v a2 s . c o m*/ } if (!validate()) return; if (MessageDialog.openConfirm(getShell(), "", "?")) { try { // CmUsrInfDTO pdto = (CmUsrInfDTO) ObjectUtil.getDefaultObject(CmUsrInfDTO.class.getName()); pdto.setLgn_id(txtLgnId.getText().trim()); pdto.setLgn_pw(txtLgnPw.getText().trim()); pdto.setUsr_nm(txtUsrNm.getText().trim()); pdto.setAth_grd(cboAthGrd.getText().trim()); int auth = 0; for (int i = 0; i < btnAuth.length; i++) { if (btnAuth[i].getSelection()) auth |= (Integer) btnAuth[i].getData(); } pdto.setAth_cd(auth); pdto.setNt(txtNt.getText().trim()); pdto.setTel(txtTel.getText().trim()); // if (dto == null) { pdto.setUsr_seq(Integer.parseInt(mgr.selectCmUsrInfKey())); mgr.insertCmUsrInf(pdto); } else { // pdto.setUsr_seq(dto.getUsr_seq()); pdto.setRgn_dt(null); pdto.setRgn_id(null); mgr.updateCmUsrInf(pdto); } if (pdto.getLgn_id().equals(SessionManager.getInstance().getUsr().getLgn_id())) { SessionManager.getInstance().getUsr().setAth_cd(pdto.getAth_cd()); SessionManager.getInstance().getUsr().setAth_grd(pdto.getAth_grd()); } 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.usr.UsrInfEditComposite.java
License:Open Source License
private void btnDeleteMouseDown(MouseEvent evt) { try {//from ww w .ja v a 2 s. c o m if (DTSConstants.CD_USR_GRD_USER.equals(usr.getAth_grd())) { MessageDialog.openError(getShell(), " ", " . \n\n ."); return; } if (dto == null) { this.btnClearMouseDown(null); return; } if (MessageDialog.openConfirm(getShell(), "", " ?")) { dto = (CmUsrInfDTO) ObjectUtil.getUpdateObject(dto); mgr.deleteCmUsrInf(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()); } }