/** @see com.ixora.rms.ui.artefacts.ArtefactSelectorPanel#handleRemoveArtefact() */ protected void handleRemoveArtefact() { try { JTable table = getJTableArtefacts(); int[] sel = table.getSelectedRows(); if (Utils.isEmptyArray(sel)) { return; } for (int idx : sel) { DashboardInfo gi = (DashboardInfo) table.getModel().getValueAt(idx, 1); DashboardMap map = fDashboardRepository.getDashboardMap(fContext); if (map == null) { logger.error("Couldn't find query gruop map for context: " + this.fContext); return; } // ask for confitmation if (!UIUtils.getBooleanOkCancelInput( this.fViewContainer.getAppFrame(), MessageRepository.get(Msg.TITLE_CONFIRM_REMOVE_DASHBOARD), MessageRepository.get( Msg.TEXT_CONFIRM_REMOVE_DASHBOARD, new String[] {gi.getTranslatedName()}))) { return; } // remove the dashboard only for the current fSUOVersion map.remove(gi.getDashboard().getName(), fSUOVersion); fDashboardRepository.setDashboardMap(fContext, map); fDashboardRepository.save(); // update model fSessionData.getDashboardHelper().removeDashboard(fContext, gi.getDashboard().getName()); // refresh table model refreshTableModel(); } } catch (Exception ex) { UIExceptionMgr.userException(ex); } }
/** @see com.ixora.rms.ui.artefacts.ArtefactSelectorPanel#handleAddArtefact() */ protected void handleAddArtefact() { try { DashboardEditorDialog editor = new DashboardEditorDialog( fViewContainer, fTreeExplorer, fDashboardRepository, fEventHandlef); editor.setModal(true); editor.edit(fSessionData, fContext, fAllSUOVersions, null); UIUtils.centerDialogAndShow(fViewContainer.getAppFrame(), editor); } catch (Exception ex) { UIExceptionMgr.userException(ex); } }
private void showTimeIntervalSelectorDialog(final String logName) { if (fLogOne.equals(logName)) { if (fTimeIntervalOne != null) { TimeIntervalSelectorDialog dlg = new TimeIntervalSelectorDialog(fViewContainer, fTimeIntervalOne); UIUtils.centerDialogAndShow(fViewContainer.getAppFrame(), dlg); BoundedTimeInterval ti = dlg.getResult(); if (ti != null) { fTimeIntervalOne = ti; } } } }
/** @see com.ixora.rms.ui.artefacts.ArtefactSelectorPanel#handleEditArtefact() */ protected void handleEditArtefact() { try { JTable table = getJTableArtefacts(); int sel = table.getSelectedRow(); if (sel < 0) { return; } DashboardInfo cd = (DashboardInfo) table.getModel().getValueAt(sel, 1); DashboardEditorDialog editor = new DashboardEditorDialog( fViewContainer, fTreeExplorer, fDashboardRepository, fEventHandlef); editor.setModal(true); editor.edit(fSessionData, fContext, fAllSUOVersions, cd.getDashboard()); UIUtils.centerDialogAndShow(fViewContainer.getAppFrame(), editor); } catch (Exception ex) { UIExceptionMgr.userException(ex); } }
/** @see com.ixora.common.ui.filter.FilterEditorDialog#handleOk() */ protected void handleOk() { try { boolean regex = fCheckIsRegex.isSelected(); String filterText = fTextFieldFilter.getText(); if (filterText == null || filterText.trim().length() == 0) { UIUtils.showError( this, // TODO localize "Invalid Filter", "Filter will not be set."); return; } if (regex) { fFilter = createRegexFilter(filterText.trim(), fCheckIsNegative.isSelected()); } else { fFilter = createStringFilter(filterText.trim(), fCheckIsNegative.isSelected()); } dispose(); } catch (Exception e) { UIExceptionMgr.userException(e); } }