use of com.ramussoft.core.attribute.simple.LongPersistent in project ramus by Vitaliy-Yakovchuk.
the class StandardAttributesPlugin method canDeleteElements.
@Override
public boolean canDeleteElements(long[] elementIds, IEngine engine) {
Vector<Long> vector = new Vector<Long>();
for (long elementId : elementIds) {
long qualifierId = engine.getQualifierIdForElement(elementId);
Long l = new Long(qualifierId);
if (vector.indexOf(l) < 0) {
vector.add(l);
if (qualifierId == qualifiers.getId()) {
List<Persistent>[] lists = engine.getBinaryAttribute(elementId, aQualifierId.getId());
Long long1;
if (lists[0].size() == 0)
long1 = null;
else
long1 = ((LongPersistent) lists[0].get(0)).getValue();
if (long1 == null)
continue;
if (!rules.canDeleteQualifier(long1)) {
DeleteStatus status = new DeleteStatus();
status.setDelete(Delete.CAN_NOT);
return false;
}
continue;
}
}
}
return true;
}
Aggregations