use of com.ramussoft.common.Qualifier in project ramus by Vitaliy-Yakovchuk.
the class CachedEngine method getSystemQualifier.
@Override
public Qualifier getSystemQualifier(String qualifierName) {
Qualifier q = systemQualifiers.get(qualifierName);
if (q == null) {
q = deligate.getSystemQualifier(qualifierName);
if (q == null)
return null;
systemQualifiers.put(qualifierName, q);
}
return q;
}
use of com.ramussoft.common.Qualifier in project ramus by Vitaliy-Yakovchuk.
the class FormulaEditor method createUserValue.
private String createUserValue(ElementAttribute value) {
if (value.element.getId() == element.getId()) {
if (value.attribute.getId() == calculateInfo.getAttributeId())
return null;
return addSlashes(value.attribute.getName());
}
String name = addSlashes(value.element.getName());
if (name.equals("")) {
name = Util.ELEMENT_PREFIX + value.element.getId();
return name + "." + addSlashes(value.attribute.getName());
}
if (value.element.getQualifierId() == element.getQualifierId()) {
return name + "." + addSlashes(value.attribute.getName());
}
Qualifier qualifier = engine.getQualifier(value.element.getQualifierId());
return addSlashes(qualifier.getName()) + "." + name + "." + addSlashes(value.attribute.getName());
}
use of com.ramussoft.common.Qualifier in project ramus by Vitaliy-Yakovchuk.
the class QualifierSelectComponent method showDialog.
public List<Qualifier> showDialog(JFrame frame, JPanel jPanel, Object constraints) {
final List<Qualifier> result = new ArrayList<Qualifier>();
BaseDialog dialog = new BaseDialog(frame, true) {
/**
*/
private static final long serialVersionUID = -2166014042175217388L;
@Override
protected void onOk() {
result.addAll(getSelected());
super.onOk();
}
};
dialog.setTitle(GlobalResourcesManager.getString("QualifierView"));
JPanel panel = new JPanel(new BorderLayout());
panel.add(this, BorderLayout.CENTER);
if (jPanel != null) {
panel.add(jPanel, constraints);
}
dialog.setMainPane(panel);
dialog.pack();
dialog.setLocationRelativeTo(frame);
dialog.setMinimumSize(dialog.getSize());
Options.loadOptions(dialog);
dialog.setVisible(true);
Options.saveOptions(dialog);
return result;
}
use of com.ramussoft.common.Qualifier 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.Qualifier in project ramus by Vitaliy-Yakovchuk.
the class QualifierView method openQualifier.
private void openQualifier(Row row) {
Long l = (Long) row.getAttribute(qAttribute);
if (l == null)
return;
Qualifier qualifier = engine.getQualifier(l);
framework.propertyChanged(QualifierPlugin.OPEN_QUALIFIER, qualifier);
}
Aggregations