use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class TimeLogMessageHandler method saveModification.
private void saveModification(MessageEvent message, TimeLogEntry mod) {
// if the mod specifies a node ID, resolve it to an actual path
String path = mod.getPath();
if (path != null && !path.startsWith("/")) {
PropertyKey key = ctx.getHierarchy().findKeyByNodeID(path);
if (key != null) {
TimeLogEntry setPath = new TimeLogEntryVO(mod.getID(), key.path(), null, 0, 0, null);
mod = TimeLogEntryVO.applyChanges(mod, setPath, true);
} else {
logger.warning("When handling message with ID '" + message.getMessageId() + "', could not find any node with ID '" + path + "'. Discarding time log entry.");
return;
}
}
// add the modification to the dashboard time log
DashboardTimeLog timeLog = (DashboardTimeLog) ctx.getTimeLog();
ChangeFlaggedTimeLogEntry cftle = (ChangeFlaggedTimeLogEntry) mod;
timeLog.addModification(cftle);
// notify the time logging model about external additions
if (cftle.getChangeFlag() == ChangeFlagged.ADDED)
timeLog.getTimeLoggingModel().handleExternalAddition(mod);
}
use of net.sourceforge.processdash.hier.PropertyKey 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.hier.PropertyKey in project processdash by dtuma.
the class DefectLogEditor method reload.
protected void reload() {
PropertyKey pKey;
Prop prop;
DefectLog dl;
String defLogName;
Defect[] defects;
defectLogs.clear();
Enumeration pKeys = useProps.keys();
while (pKeys.hasMoreElements()) {
pKey = (PropertyKey) pKeys.nextElement();
prop = useProps.pget(pKey);
defLogName = prop.getDefectLog();
if (defLogName != null && defLogName.length() != 0) {
dl = new DefectLog(dashboard.getDirectory() + defLogName, pKey.path(), data);
defects = dl.readDefects();
defectLogs.put(pKey, new DefectListID(pKey, dl, defects));
}
}
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class DefectLogEditor method reupdateImportActions.
private void reupdateImportActions() {
DefaultMutableTreeNode selectedTreeNode = getSelectedNode();
if (selectedTreeNode == null)
return;
PropertyKey selectedKey = treeModel.getPropKey(useProps, selectedTreeNode.getPath());
if (selectedKey == null || hasDefLog(selectedKey) == false)
return;
PropertyKey currPhase = dashboard.getCurrentPhase();
if (currPhase == null)
return;
if (currPhase.path().startsWith(selectedKey.path() + "/"))
updateImportActions(currPhase, selectedKey);
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class DefectButton method updateAll.
private void updateAll() {
PropertyKey currentPhase = parent.getActiveTaskModel().getNode();
setPaths(currentPhase);
}
Aggregations