use of com.ramussoft.database.common.Row in project ramus by Vitaliy-Yakovchuk.
the class ChartsView method createChartElement.
public Element createChartElement(String name) {
Row row = component.getRowSet().createRow(null);
row.setName(name);
return row.getElement();
}
use of com.ramussoft.database.common.Row in project ramus by Vitaliy-Yakovchuk.
the class ChartsView method deleteDiagram.
public void deleteDiagram() {
List<Row> rows = new ArrayList<Row>();
int[] sels = table.getSelectedRows();
for (int i : sels) {
TreePath path = table.getPathForRow(i);
if (path != null) {
TreeTableNode node = (TreeTableNode) path.getLastPathComponent();
if (node != null) {
Row row = node.getRow();
if (row != null)
rows.add(row);
}
}
}
if (rows.size() > 0) {
if (JOptionPane.showConfirmDialog(component, GlobalResourcesManager.getString("DeleteActiveElementsDialog.Warning"), GlobalResourcesManager.getString("ConfirmMessage.Title"), JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION)
return;
Engine engine = framework.getEngine();
((Journaled) engine).startUserTransaction();
for (Row row : rows) ChartPlugin.deleteChart(engine, row.getElement());
((Journaled) engine).commitUserTransaction();
}
}
use of com.ramussoft.database.common.Row in project ramus by Vitaliy-Yakovchuk.
the class QualifierSourceSelectPanel method save.
public void save() {
List<ElementSource> elementSources = qualifierSource.getElementSources();
elementSources.clear();
for (Row row : view.getSelectedRows()) {
ElementSource e = qualifierSource.getChartSource().createElementSource();
e.setElement(row.getElement());
elementSources.add(e);
}
qualifierSource.getChartSource().fireAttributeListChanged();
}
use of com.ramussoft.database.common.Row in project ramus by Vitaliy-Yakovchuk.
the class ModelPropertiesDialog method refreshActions.
protected void refreshActions() {
RowTreeTable table = component.getTable();
createAttributeAction.setEnabled(rules.canCreateAttribute());
if (table.getTreeSelectionModel().getSelectionPath() == null) {
deleteAttributeAction.setEnabled(false);
attributePreferencesAction.setEnabled(false);
} else {
attributePreferencesAction.setEnabled(true);
boolean e = true;
TreePath[] paths = table.getTreeSelectionModel().getSelectionPaths();
for (TreePath path : paths) {
Row row = ((TreeTableNode) path.getLastPathComponent()).getRow();
if (row == null) {
e = false;
break;
}
if (row.getChildCount() > 0) {
e = false;
break;
}
Long long1 = (Long) row.getAttribute(attributeId);
if (long1 == null)
break;
long attrId = long1;
if (!rules.canDeleteAttribute(attrId)) {
e = false;
break;
}
}
deleteAttributeAction.setEnabled(e);
}
}
use of com.ramussoft.database.common.Row in project ramus by Vitaliy-Yakovchuk.
the class ModelPropertiesDialog method setupAttribute.
public void setupAttribute() {
TreeTableNode node = component.getTable().getSelectedNode();
if (node == null)
return;
Row row = node.getRow();
if (row == null)
return;
AttributePreferenciesDialog d = new AttributePreferenciesDialog(framework, this);
Attribute attribute = engine.getAttribute((Long) row.getAttribute(attributeId));
d.setAttribute(attribute);
d.getOKButton().setEnabled(rules.canUpdateAttribute(attribute.getId()));
d.setVisible(true);
}
Aggregations