use of com.ramussoft.database.common.Row in project ramus by Vitaliy-Yakovchuk.
the class ChartsView method openDiagram.
private void openDiagram() {
TreeTableNode selectedNode = table.getSelectedNode();
if (selectedNode == null)
return;
Row row = selectedNode.getRow();
if (row != null) {
framework.propertyChanged(ChartGUIPlugin.OPEN_CHART, row.getElement());
}
}
use of com.ramussoft.database.common.Row in project ramus by Vitaliy-Yakovchuk.
the class TableChartAttributePlugin method getAttributePreferenciesEditor.
@Override
public AttributePreferenciesEditor getAttributePreferenciesEditor() {
return new AttributePreferenciesEditor() {
private RowTreeTableComponent component;
@Override
public JComponent createComponent(Attribute attribute, Engine engine, AccessRules accessRules) {
component = new RowTreeTableComponent(engine, ChartPlugin.getCharts(engine), accessRules, new RowRootCreater(), new Attribute[] { StandardAttributesPlugin.getAttributeNameAttribute(engine) }, framework);
component.setSelectType(SelectType.RADIO);
return component;
}
@Override
public boolean canApply() {
return component.getModel().getSelectedRows().size() > 0;
}
@Override
public void apply(Attribute attribute, Engine engine, AccessRules accessRules) {
Row row = component.getModel().getSelectedRows().get(0);
TableChartPersistent tcp = new TableChartPersistent();
tcp.setOtherElementId(row.getElementId());
engine.setAttribute(null, attribute, tcp);
}
};
}
use of com.ramussoft.database.common.Row in project ramus by Vitaliy-Yakovchuk.
the class ChartSetsView method openChartSet.
protected void openChartSet() {
TreeTableNode selectedNode = table.getSelectedNode();
if (selectedNode == null)
return;
Row row = selectedNode.getRow();
if (row != null) {
framework.propertyChanged(ChartGUIPlugin.OPEN_CHART_SET, row.getElement());
}
}
use of com.ramussoft.database.common.Row in project ramus by Vitaliy-Yakovchuk.
the class QualifierImporterImpl method createQualifier.
private Qualifier createQualifier(Qualifier sourceQualifier, Row row) {
Qualifier res = engine.getQualifierByName(sourceQualifier.getName());
if (res == null) {
Qualifier q = StandardAttributesPlugin.getQualifiersQualifier(engine);
RowSet rs = new RowSet(engine, q, new Attribute[] {});
Row parent = findParent(rs, row.getParent());
if ((parent != null) && (parent.getElement() == null))
parent = null;
if ((parent != null) && (engine.getElements(StandardAttributesPlugin.getQualifier(engine, parent.getElement()).getId()).size() > 0))
parent = null;
Element element = rs.createRow(parent).getElement();
res = StandardAttributesPlugin.getQualifier(engine, element);
res.setName(sourceQualifier.getName());
engine.updateQualifier(res);
rs.close();
}
return res;
}
use of com.ramussoft.database.common.Row in project ramus by Vitaliy-Yakovchuk.
the class QualifierImporterImpl method findParent.
private Row findParent(RowSet rs, Row row) {
if (row.getParent() == null)
return rs.getRoot();
Row parent = row.getParent();
Row parent2 = findParent(rs, parent);
if (parent2 != null) {
for (Row row2 : parent2.getChildren()) if (row2.getName().equals(row.getName()))
return row2;
}
return null;
}
Aggregations