use of com.ramussoft.common.Attribute 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.Attribute in project ramus by Vitaliy-Yakovchuk.
the class RowTreeTableModel method getColumnName.
@Override
public String getColumnName(int column) {
Attribute attribute = rowSet.getAttributes()[column];
String name = framework.getSystemAttributeName(attribute);
if (name != null)
return name;
return "<html><body><center>" + attribute.getName() + "</center></body></html>";
}
use of com.ramussoft.common.Attribute in project ramus by Vitaliy-Yakovchuk.
the class TableView method getAttributes.
@Override
protected Attribute[] getAttributes() {
Attribute[] attributes = super.getAttributes();
List<Attribute> attrs = new ArrayList<Attribute>(attributes.length);
TableViewProperties properties = getProperties();
Qualifier q = getQualifier();
int index = -1;
for (int i = 0; i < attributes.length; i++) {
if (attributes[i].getId() == q.getAttributeForName()) {
index = i;
break;
}
}
if (index > 0) {
Attribute a = attributes[index];
attributes[index] = attributes[0];
attributes[0] = a;
}
for (Attribute attribute : attributes) {
if ((!properties.isPresent(attribute)) || (attribute.getId() == q.getAttributeForName())) {
attrs.add(attribute);
}
}
return attrs.toArray(new Attribute[attrs.size()]);
}
use of com.ramussoft.common.Attribute in project ramus by Vitaliy-Yakovchuk.
the class Hierarchy method toString.
public String toString(List<Attribute> list, GUIFramework framework) {
Attribute[] attributes = getAttributes(list);
StringBuffer sb = new StringBuffer("(");
for (Attribute attribute : attributes) {
if ((attributes.length > 0) && (attribute != attributes[0])) {
sb.append("->");
}
String name = framework.getSystemAttributeName(attribute);
if (name == null)
name = attribute.getName();
sb.append(name);
}
sb.append(")");
return sb.toString();
}
use of com.ramussoft.common.Attribute in project ramus by Vitaliy-Yakovchuk.
the class ReportPlugin method setReportQualifierElementId.
public static void setReportQualifierElementId(Engine engine, Element element, long id) {
Attribute attribute = getReportQualifierElementIdAttribute(engine);
engine.setAttribute(element, attribute, id);
}
Aggregations