public Color getForeground(Object element, int columnIndex) { TsWgtInfDTO data = (TsWgtInfDTO) element; if (data.getNo() % 2 == 0) { return Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE); } return null; }
public Color getBackground(Object element, int columnIndex) { TsWgtInfDTO data = (TsWgtInfDTO) element; if (data.getNo() % 2 == 0) { return ColorRepository.getColor(ColorRepository.GRID_ODD_BG); } return null; }
private void select() { TsCarMstDTO item = car.getSelectionItem(); if (item.getCar_num().length() == 0) { TsWgtInfManager wim = new TsWgtInfManager(); TsWgtInfDTO param = new TsWgtInfDTO(); param.setWgt_stat_cd(DTSConstants.WGT_STAT_FST); ArrayList<TsWgtInfDTO> fstList = wim.selectTsWgtInf(param); for (int i = 0; i < fstList.size(); i++) fstList.get(i).setNo(i + 1); listData = fstList.toArray(new TsWgtInfDTO[0]); gridViewer.setInput(listData); } else { filter(); } }
protected void onClickDelete() { Grid g = gridViewer.getGrid(); if (g.getSelectionIndex() == -1) { MessageDialog.openInformation(shell, "데이터 선택 필요", "선택된 데이터가 없습니다. \n\n목록에서 선택 후 작업하세요."); return; } else { if (listData != null && listData.length > g.getSelectionIndex()) { boolean rtn = MessageDialog.openConfirm( shell, "삭제 확인", "1차 계량 정보를 삭제하시겠습니까?\n\n차량번호-" + listData[g.getSelectionIndex()].getCar_num()); if (!rtn) { return; } try { TsWgtInfManager wim = new TsWgtInfManager(); TsWgtInfDTO dto = (TsWgtInfDTO) ObjectUtil.getDefaultObject(TsWgtInfDTO.class.getName()); dto.setDel_yn(DTSConstants.FLAG_Y); dto.setWgt_cd(listData[g.getSelectionIndex()].getWgt_cd()); wim.updateTsWgtInf(dto); // 목록 재조회 select(); // HomeView refresh HomeView hv = (HomeView) PlatformUI.getWorkbench() .getActiveWorkbenchWindow() .getActivePage() .findView(HomeView.ID); hv.refreshData(); } catch (IOException e) { MessageDialog.openError(shell, "삭제 오류", "데이터 삭제 중 오류가 발생하였습니다. \n\n" + e.getMessage()); return; } } } }