use of com.servoy.j2db.dataprocessing.EditRecordList in project servoy-client by Servoy.
the class BasicFormManager method canBeDeleted.
protected boolean canBeDeleted(IFormController fp) {
if (fp.isFormVisible()) {
if (Debug.tracing())
Debug.trace("Couldn't destroy form " + fp.getName() + " instance because it is still visible");
return false;
}
// cannot be deleted if a global var has a ref
ScopesScope scopesScope = application.getScriptEngine().getScopesScope();
if (hasReferenceInScriptable(scopesScope, fp, new HashSet<Scriptable>())) {
if (Debug.tracing())
Debug.trace("Couldn't destroy form " + fp.getName() + " instance because it has references in scripting");
return false;
}
if (fp.isFormExecutingFunction()) {
if (Debug.tracing())
Debug.trace("Couldn't destroy form " + fp.getName() + " instance because it is executing a function");
return false;
}
// if this controller uses a separate foundset
if (fp.getForm().getUseSeparateFoundSet()) {
// test if that foundset has edited records that can't be saved
EditRecordList editRecordList = application.getFoundSetManager().getEditRecordList();
if (editRecordList.stopIfEditing(fp.getFoundSet()) != ISaveConstants.STOPPED) {
if (Debug.tracing())
Debug.trace("Couldn't destroy form " + fp.getName() + " instance because it has a seperate foundset that has editing records");
return false;
}
}
// the cached currentcontroller may not be destroyed
SolutionScope ss = application.getScriptEngine().getSolutionScope();
// $NON-NLS-1$
return ss == null || fp.initForJSUsage() != ss.get("currentcontroller", ss);
}
use of com.servoy.j2db.dataprocessing.EditRecordList in project servoy-client by Servoy.
the class AlwaysRowSelectedSelectionModel method testStopUIEditing.
private boolean testStopUIEditing() {
for (IFormController fco : formControllers.toArray(new IFormController[formControllers.size()])) {
if (fco.isFormVisible()) {
EditRecordList editRecordList = fco.getApplication().getFoundSetManager().getEditRecordList();
IRecord[] editedRecords = editRecordList.getEditedRecords(fco.getFoundSet());
if (editedRecords.length > 0) {
int stopEditing = editRecordList.stopEditing(false, Arrays.asList(editedRecords));
return stopEditing == ISaveConstants.STOPPED || stopEditing == ISaveConstants.AUTO_SAVE_BLOCKED;
}
}
}
return true;
}
Aggregations