Search in sources :

Example 6 with Qualifier

use of com.ramussoft.common.Qualifier 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()]);
}
Also used : Attribute(com.ramussoft.common.Attribute) ArrayList(java.util.ArrayList) Qualifier(com.ramussoft.common.Qualifier)

Example 7 with Qualifier

use of com.ramussoft.common.Qualifier in project ramus by Vitaliy-Yakovchuk.

the class SelectRowPanel method initialize.

/**
 * This method initializes this
 *
 * @return void
 */
private void initialize() {
    this.add(splitPane, BorderLayout.CENTER);
    splitPane.setDividerLocation(250);
    ResourceLoader.setJComponentsText(this);
    final Qualifier q1 = qualifier;
    selectedRows.clear();
    createComponents();
    if (q1 != null) {
        qualifierView.setSelectedQualifier(q1);
    }
}
Also used : Qualifier(com.ramussoft.common.Qualifier)

Example 8 with Qualifier

use of com.ramussoft.common.Qualifier in project ramus by Vitaliy-Yakovchuk.

the class SelectRowPanel method selectRows.

public void selectRows(List<Row> rows) {
    selectedRows.clear();
    if (selectableTableView != null)
        selectableTableView.clearSelection();
    List<Long> ss = new ArrayList<Long>();
    for (Row row : rows) {
        Qualifier qualifier = row.getRowSet().getQualifier();
        List<Row> sels = getSelectedRows(qualifier);
        sels.add(row);
        if (this.qualifier != null && this.selectableTableView != null && this.qualifier.equals(qualifier))
            ss.add(row.getElementId());
    }
    if (selectableTableView != null)
        selectableTableView.selectRows(ss);
    repaint();
}
Also used : ArrayList(java.util.ArrayList) Qualifier(com.ramussoft.common.Qualifier) Row(com.ramussoft.database.common.Row)

Example 9 with Qualifier

use of com.ramussoft.common.Qualifier in project ramus by Vitaliy-Yakovchuk.

the class OwnerClasificators method updateOuners.

public void updateOuners() {
    List<Qualifier> cls = dataPlugin.getEngine().getQualifiers();
    for (int i = cls.size() - 1; i >= 0; i--) {
        if (IDEF0Plugin.isFunction(cls.get(i)))
            cls.remove(i);
    }
    Collections.sort(cls, new Comparator<Qualifier>() {

        Collator collator = Collator.getInstance();

        @Override
        public int compare(Qualifier o1, Qualifier o2) {
            return collator.compare(o1.getName(), o2.getName());
        }
    });
    cls.remove(dataPlugin.getBaseFunction());
    clasificators = cls.toArray(new Qualifier[cls.size()]);
    String s = dataPlugin.getProperty(DataPlugin.PROPERTY_OUNERS);
    if (s == null)
        s = "";
    final StringTokenizer st = new StringTokenizer(s, " ");
    while (st.hasMoreElements()) {
        owners.add(Long.parseLong(st.nextToken()));
    }
    model.fireTableDataChanged();
}
Also used : StringTokenizer(java.util.StringTokenizer) Qualifier(com.ramussoft.common.Qualifier) Collator(java.text.Collator)

Example 10 with Qualifier

use of com.ramussoft.common.Qualifier in project ramus by Vitaliy-Yakovchuk.

the class XMLReportEngine method checkReportAttributes.

public void checkReportAttributes() {
    if (processReportAttributes) {
        processReportAttributes = false;
        String br = attributes.get("BaseRow");
        if (br != null) {
            long id = Long.parseLong(br);
            Qualifier qualifier = data.getQualifier(id);
            if (qualifier == null)
                attributes.remove("BaseRow");
        }
    /*String model = attributes.get("ReportFunction");
            if (model != null) {
				Qualifier qualifier = data.getEngine()
						.getQualifierByName(model);
				if (qualifier == null)
					attributes.remove("ReportFunction");
			}*/
    }
}
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