use of com.ramussoft.gui.qualifier.table.TreeTableNode in project ramus by Vitaliy-Yakovchuk.
the class QualifierPreferencesPanel method refreshActions.
protected void refreshActions() {
RowTreeTable table = attributeEditor.getRowTreeTableComponent().getTable();
createAttributeAction.setEnabled(rules.canCreateAttribute());
if (table.getTreeSelectionModel().getSelectionPath() == null) {
deleteAttributeAction.setEnabled(false);
} else {
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.gui.qualifier.table.TreeTableNode in project ramus by Vitaliy-Yakovchuk.
the class QualifierView method openQualifier.
protected void openQualifier() {
for (int i : table.getSelectedRows()) {
if (i >= 0) {
TreePath path = table.getPathForRow(i);
if (path != null) {
TreeTableNode node = (TreeTableNode) path.getLastPathComponent();
if (node != null) {
Row row = node.getRow();
if (row != null) {
if (row.getChildCount() == 0) {
table.setEditable(false);
openQualifier(row);
table.setEditable(true);
}
}
}
}
}
}
}
use of com.ramussoft.gui.qualifier.table.TreeTableNode 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.gui.qualifier.table.TreeTableNode 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.gui.qualifier.table.TreeTableNode in project ramus by Vitaliy-Yakovchuk.
the class ModelsPanel method canOpen.
public boolean canOpen() {
RowTreeTable table = tree.getTable();
final List<OpenDiagram> models = new ArrayList<OpenDiagram>();
Qualifier modelTree = IDEF0Plugin.getModelTree(engine);
for (int i : table.getSelectedRows()) {
if (i >= 0) {
TreePath path = table.getPathForRow(i);
if (path != null) {
TreeTableNode node = (TreeTableNode) path.getLastPathComponent();
if (node != null) {
Row row = node.getRow();
if (row != null) {
if (row.getElement().getQualifierId() == modelTree.getId()) {
Long id = (Long) row.getAttribute(StandardAttributesPlugin.getAttributeQualifierId(engine));
if (id != null) {
Qualifier model = engine.getQualifier(id);
if (model != null) {
OpenDiagram openDiagram = new OpenDiagram(model, -1l);
models.add(openDiagram);
}
}
} else {
if (row.getChildCount() <= 0)
row = row.getParent();
OpenDiagram openDiagram = new OpenDiagram(row.getRowSet().getQualifier(), row.getElementId());
models.add(openDiagram);
}
}
}
}
}
}
return models.size() > 0;
}
Aggregations