use of net.sourceforge.processdash.log.defects.DefectLogID in project processdash by dtuma.
the class DefectButton method setPaths.
private void setPaths(PropertyKey activeTask) {
taskPath = activeTask;
DefectLogID defectLog = parent.getHierarchy().defectLog(taskPath, parent.getDirectory());
if (defectLog == null) {
defectLogFileName = null;
defectPath = null;
} else {
defectLogFileName = defectLog.filename;
defectPath = defectLog.path;
}
boolean enabled = shouldAllowDefectLogging();
setEnabled(enabled);
setToolTipText(enabled ? tooltip : disabledTooltip);
}
use of net.sourceforge.processdash.log.defects.DefectLogID in project processdash by dtuma.
the class OpenDefectDialog method writeContents.
@Override
protected void writeContents() throws IOException {
DashController.checkIP(env.get("REMOTE_ADDR"));
String path = getPath();
DefectLogID defectLog = getDefectLog(path);
if (defectLog == null)
throw new TinyCGIException(404, "No defect log found for " + path);
String id = getParameter("id");
if (StringUtils.hasValue(id))
openExistingDefectDialog(defectLog, id);
else
openNewDefectDialog(defectLog, path);
DashController.printNullDocument(out);
}
use of net.sourceforge.processdash.log.defects.DefectLogID in project processdash by dtuma.
the class DefectLogEditor method rename.
public static void rename(DashHierarchy oldProps, DashHierarchy newProps, String oldPrefix, String newPrefix, ProcessDashboard dashboard) {
PropertyKey oldKey = PropertyKey.fromPath(oldPrefix);
String oldLogName = oldProps.pget(oldKey).getDefectLog();
if (oldLogName != null && oldLogName.length() > 0) {
// don't need to worry.
return;
}
DefectLogID oldLog = oldProps.defectLog(oldKey, dashboard.getDirectory());
if (oldLog == null) {
// we don't need to worry.
return;
}
String logPath = oldLog.path.path();
oldPrefix = oldPrefix.substring(logPath.length() + 1);
PropertyKey newKey = PropertyKey.fromPath(newPrefix);
DefectLogID newLog = newProps.defectLog(newKey, dashboard.getDirectory());
if (newLog == null) {
// Should this ever happen???
return;
}
String newLogPath = newLog.path.path();
newPrefix = newPrefix.substring(newLogPath.length() + 1);
if (oldPrefix.equals(newPrefix)) {
// the node owning the defect log, we don't need to worry.
return;
}
if (!oldLog.filename.equals(newLog.filename)) {
// Should this ever happen???
return;
}
DefectLog log = new DefectLog(newLog.filename, newLogPath, null);
log.performInternalRename(oldPrefix, newPrefix);
}
use of net.sourceforge.processdash.log.defects.DefectLogID in project processdash by dtuma.
the class DefectLogEditor method applyFilter.
void applyFilter() {
PropertyKey selectedKey = null, defectLogKey = null;
PropertyKey key = null;
DefaultMutableTreeNode selected = getSelectedNode();
String extraPathFilter = null;
if (selected != null) {
key = selectedKey = treeModel.getPropKey(useProps, selected.getPath());
if (key != null) {
String selectedPath = key.path();
DefectLogID logid = useProps.defectLog(key, "unimportant");
if (logid != null) {
defectLogKey = logid.path;
if (logid.path != key) {
key = logid.path;
String defectLogPath = key.path();
extraPathFilter = selectedPath.substring(defectLogPath.length() + 1);
} else {
PropertyKey currPhase = dashboard.getCurrentPhase();
if (currPhase != null && currPhase.getParent().equals(selectedKey))
selectedKey = currPhase;
}
}
}
}
updateImportActions(selectedKey, defectLogKey);
// apply the filter and load the vector (and the table)
VTableModel model = (VTableModel) table.table.getModel();
Object[] row = new Object[11];
DefectListID dli;
DefectListEntry dle;
PropertyKey pk;
currentLog.removeAllElements();
model.setNumRows(0);
Enumeration dlList = defectLogs.keys();
while (dlList.hasMoreElements()) {
pk = (PropertyKey) dlList.nextElement();
if (key != null) {
if (!pk.key().equals(key.key()) && (!pk.isChildOf(key)))
// this one filtered
continue;
}
dli = (DefectListID) defectLogs.get(pk);
for (int ii = 0; ii < dli.defects.length; ii++) {
dle = new DefectListEntry(dli, ii);
if (extraPathFilter != null && !matchesExtraPath(dle.defect.phase_injected, extraPathFilter) && !matchesExtraPath(dle.defect.phase_removed, extraPathFilter))
continue;
currentLog.addElement(dle);
row[0] = dle.pk.path();
row[1] = dle.defect.number;
row[2] = dle.defect.defect_type;
row[3] = dle.defect.injected.phaseName;
row[4] = dle.defect.removed.phaseName;
row[5] = dle.defect.getLocalizedFixTime();
row[6] = Integer.toString(dle.defect.fix_count);
row[7] = dle.defect.fix_defect;
row[8] = dle.defect.fix_pending ? "*" : "";
row[9] = dle.defect.description;
row[10] = FormatUtil.formatDate(dle.defect.date);
model.addRow(row);
}
}
table.doResizeRepaint();
maybeEnableButtons();
}
use of net.sourceforge.processdash.log.defects.DefectLogID in project processdash by dtuma.
the class OpenDefectDialog method getDefectLog.
private DefectLogID getDefectLog(String path) {
DashHierarchy hier = getPSPProperties();
PropertyKey key = hier.findExistingKey(path);
if (key == null)
return null;
ProcessDashboard dash = getDash();
DefectLogID defectLog = hier.defectLog(key, dash.getDirectory());
if (defectLog == null)
return null;
if (Filter.matchesFilter(dash.getBrokenDataPaths(), defectLog.path.path()))
return null;
return defectLog;
}
Aggregations