Search in sources :

Example 1 with Qualifier

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;
}
Also used : Qualifier(com.ramussoft.common.Qualifier)

Example 2 with Qualifier

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());
}
Also used : Qualifier(com.ramussoft.common.Qualifier)

Example 3 with Qualifier

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;
}
Also used : BaseDialog(com.ramussoft.gui.common.BaseDialog) JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) ArrayList(java.util.ArrayList) Qualifier(com.ramussoft.common.Qualifier)

Example 4 with Qualifier

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();
}
Also used : Attribute(com.ramussoft.common.Attribute) Element(com.ramussoft.common.Element) Qualifier(com.ramussoft.common.Qualifier) Engine(com.ramussoft.common.Engine)

Example 5 with Qualifier

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);
}
Also used : Qualifier(com.ramussoft.common.Qualifier)

Aggregations

Qualifier (com.ramussoft.common.Qualifier)157 Attribute (com.ramussoft.common.Attribute)72 Element (com.ramussoft.common.Element)59 ArrayList (java.util.ArrayList)45 Engine (com.ramussoft.common.Engine)22 Row (com.ramussoft.database.common.Row)17 Row (com.ramussoft.pb.Row)14 List (java.util.List)12 Hashtable (java.util.Hashtable)11 QualifierEvent (com.ramussoft.common.event.QualifierEvent)10 ResultSet (java.sql.ResultSet)9 SQLException (java.sql.SQLException)9 AttributeType (com.ramussoft.common.AttributeType)8 RowSet (com.ramussoft.database.common.RowSet)8 DataPlugin (com.ramussoft.pb.DataPlugin)8 NFunction (com.ramussoft.pb.data.negine.NFunction)8 AttributeEvent (com.ramussoft.common.event.AttributeEvent)7 Journaled (com.ramussoft.common.journal.Journaled)7 RowMapper (com.ramussoft.jdbc.RowMapper)7 IEngine (com.ramussoft.common.IEngine)6