use of com.ramussoft.database.common.Row in project ramus by Vitaliy-Yakovchuk.
the class TableView method tableSelectedValueChanged.
protected void tableSelectedValueChanged() {
int column = table.getSelectedColumn();
TreeTableNode node = table.getSelectedNode();
if ((column < 0) && (node != null)) {
column = table.getHierarchicalColumn();
}
if ((column >= 0) && (node != null)) {
Row row = node.getRow();
column = table.convertColumnIndexToModel(column);
if (row != null) {
long id = row.getElementId();
Attribute attribute = component.getRowSet().getAttributes()[column];
elementAttribute.setFindAction(component.getTable().isFindSelectionChanged());
if ((elementAttribute.element == null) || (elementAttribute.element.getId() != id)) {
framework.propertyChanged(ACTIVATE_ELEMENT, row.getElement());
this.activeElement = row.getElement();
}
elementAttribute = new AttributeEditorView.ElementAttribute(row.getElement(), attribute);
elementAttribute.setFindAction(component.getTable().isFindSelectionChanged());
framework.propertyChanged(ACTIVATE_ATTRIBUTE, elementAttribute);
activeAttribute = elementAttribute;
} else {
activeAttribute = null;
elementAttribute = new AttributeEditorView.ElementAttribute();
this.activeElement = null;
if ((table.getSelectedRow() >= 0) && (table.getSelectedColumn() >= 0)) {
framework.propertyChanged(ACTIVATE_ELEMENT, null);
framework.propertyChanged(ACTIVATE_ATTRIBUTE, null);
}
}
}
}
use of com.ramussoft.database.common.Row in project ramus by Vitaliy-Yakovchuk.
the class QualifierView method setChildTable.
private void setChildTable(Row sRow, StringBuffer sb) {
for (Row row : sRow.getChildren()) {
sb.append("<tr>");
sb.append("<td>");
sb.append(row.getCode());
sb.append("</td>");
sb.append("<td>");
sb.append(row.getName());
sb.append("</td>");
sb.append("</tr>");
setChildTable(row, sb);
}
}
use of com.ramussoft.database.common.Row in project ramus by Vitaliy-Yakovchuk.
the class QualifierView method createInnerComponent.
@Override
protected void createInnerComponent() {
super.createInnerComponent();
((AbstractTableModel) component.getTable().getModel()).fireTableStructureChanged();
component.getTable().setLeafIcon(new ImageIcon(getClass().getResource("/com/ramussoft/gui/table/qualifier.png")));
getComponent().getRowSet().addRowChildListener(new RowChildAdapter() {
@Override
public void added(Row parent, Row row, int index) {
if (parent.getParent() == null)
return;
framework.propertyChanged("CloseQualifier", StandardAttributesPlugin.getQualifierId(engine, parent.getElementId()));
}
});
}
use of com.ramussoft.database.common.Row in project ramus by Vitaliy-Yakovchuk.
the class QualifierView method convertToElements.
public void convertToElements(Row sRow) {
Qualifier dest = StandardAttributesPlugin.getQualifier(engine, sRow.getElement());
Attribute nameAttribute = null;
for (Row row : toArray(sRow.getChildren())) {
nameAttribute = addArrributes(dest.getAttributes(), row, nameAttribute);
}
if (nameAttribute == null) {
for (Attribute attribute : dest.getAttributes()) if (attribute.getAttributeType().toString().equals("Core.Text"))
nameAttribute = attribute;
}
if (nameAttribute != null)
dest.setAttributeForName(nameAttribute.getId());
engine.updateQualifier(dest);
long prevId = -1l;
for (Row row : sRow.getChildren().toArray(new Row[sRow.getChildren().size()])) {
moveElements(row, -1l, prevId, dest);
prevId = row.getElementId();
}
}
use of com.ramussoft.database.common.Row in project ramus by Vitaliy-Yakovchuk.
the class SelectableTableView method componentRefresh.
@Override
protected void componentRefresh() {
List<Row> list = getSelectedRows();
super.componentRefresh();
for (Row row : list) {
component.getModel().setSelectedRow(row, true);
}
setSelectType(selectType);
}
Aggregations