use of com.ramussoft.common.Element in project ramus by Vitaliy-Yakovchuk.
the class QualifierHistoryPlugin method showHistory.
@SuppressWarnings("unchecked")
protected void showHistory(TableTabView tableView, Element element, Attribute attribute) {
GUIFramework framework = tableView.getFramework();
Hashtable<Element, Hashtable<Attribute, HistoryDialog>> h = (Hashtable<Element, Hashtable<Attribute, HistoryDialog>>) framework.get("HistoryDialogs");
if (h == null) {
h = new Hashtable<Element, Hashtable<Attribute, HistoryDialog>>();
framework.put("HistoryDialogs", h);
}
Hashtable<Attribute, HistoryDialog> h1 = h.get(element);
if (h1 == null) {
h1 = new Hashtable<Attribute, HistoryDialog>();
h.put(element, h1);
}
HistoryDialog hd = h1.get(attribute);
if (hd == null) {
hd = new HistoryDialog(framework, this, element, attribute);
h1.put(attribute, hd);
}
hd.setVisible(true);
}
use of com.ramussoft.common.Element in project ramus by Vitaliy-Yakovchuk.
the class RowTreeTableModel method setValueAt.
@Override
public void setValueAt(Object value, Object node, int column) {
if (!saveValues[column])
return;
TreeTableNode row = (TreeTableNode) node;
if (row.getRow() == null)
return;
Attribute a = row.getRow().getRowAttributes()[column + 1];
Engine engine = row.getRow().getRowSet().getEngine();
Qualifier q = engine.getQualifier(row.getRow().getElement().getQualifierId());
if ((q.getAttributeForName() == a.getId()) && (value instanceof String)) {
List<Element> list = engine.findElements(q.getId(), a, value);
for (Element element : list) {
if (element.getId() != row.getRow().getElementId()) {
if (JOptionPane.showConfirmDialog(table, GlobalResourcesManager.getString("Warning.ElementsExists"), GlobalResourcesManager.getString("ConfirmMessage.Title"), JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION)
return;
break;
}
}
}
row.getRow().startUserTransaction();
row.getRow().setAttribute(column, value);
row.getRow().endUserTransaction();
}
use of com.ramussoft.common.Element in project ramus by Vitaliy-Yakovchuk.
the class Data method getBaseRowByQualifier.
public Row getBaseRowByQualifier(String baseQualifierName) {
if (baseRows == null) {
baseRows = getRows(baseQualifierName);
if (query != null) {
List<Element> elements = query.getElements();
if (elements != null) {
for (int i = baseRows.size() - 1; i >= 0; i--) {
Row row = baseRows.get(i);
if (elements.indexOf(row.getElement()) < 0)
baseRows.remove(i);
}
}
}
if (baseRows.size() == 0)
throw new NoRowsException();
baseRows.next();
} else {
if (!baseQualifierName.equals(baseRows.getQualifierName())) {
throw new DataException("Error.differentBaseQualifiers", "Report contains diffetents base qualifiers in queries", baseQualifierName, baseRows.getQualifierName());
}
}
return baseRows.getCurrent();
}
use of com.ramussoft.common.Element in project ramus by Vitaliy-Yakovchuk.
the class Data method getReport.
public Source getReport(String name, Query query) {
Element element = engine.getElement(name, ReportPlugin.getReportsQualifier(engine).getId());
if (element == null)
throw new DataException("Error.reportNotFound", "Report " + name + " not found", name);
HashMap<String, Object> map = new HashMap<String, Object>();
if (query != null)
map.put("query", query);
String htmlReport = reportQuery.getHTMLReport(element, map);
Source source = new Source(htmlReport);
source.fullSequentialParse();
return source;
}
use of com.ramussoft.common.Element in project ramus by Vitaliy-Yakovchuk.
the class ReportQueryImpl method getHTMLReports.
@Override
public List<Element> getHTMLReports() {
RowSet rowSet = new RowSet(engine, ReportPlugin.getReportsQualifier(engine), new Attribute[] {}, null, true);
List<Row> rows = rowSet.getAllRows();
List<Element> elements = new ArrayList<Element>(rows.size());
for (Row row : rows) elements.add(row.getElement());
return elements;
}
Aggregations