use of com.servoy.j2db.IApplication in project servoy-client by Servoy.
the class SwingFoundSet method fireSelectionAdjusting.
@Override
protected void fireSelectionAdjusting() {
if (selectionModel == null)
createSelectionModel();
Runnable runner = new Runnable() {
public void run() {
selectionModel.fireAdjusting();
}
};
IApplication app = fsm.getApplication();
if (app.isEventDispatchThread()) {
runner.run();
} else {
app.invokeLater(runner);
}
}
use of com.servoy.j2db.IApplication in project servoy-client by Servoy.
the class SwingForm method print.
/**
* @see com.servoy.j2db.IFormUIInternal#print(boolean, boolean, boolean, java.awt.print.PrinterJob)
*/
public void print(boolean showDialogs, boolean printCurrentRecordOnly, boolean showPrinterSelectDialog, PrinterJob printerJob) {
IFoundSetInternal fs = formController.getFoundSet();
if (!printCurrentRecordOnly) {
if (showDialogs) {
int option = willingToPrint(fs);
if (option == 2) {
printCurrentRecordOnly = true;
} else if (option == 1) {
// cancel
return;
}
}
}
IApplication application = formController.getApplication();
try {
// $NON-NLS-1$
application.blockGUI(Messages.getString("servoy.formPanel.status.printProgress"));
if (printCurrentRecordOnly) {
fs = fs.copyCurrentRecordFoundSet();
}
FormPreviewPanel fpp = new FormPreviewPanel(application, formController, fs);
fpp.process();
PrintPreview.startPrinting(application, fpp.getPageable(), printerJob, formController.getPreferredPrinterName(), showPrinterSelectDialog, false);
fpp.destroy();
} catch (Exception ex) {
// $NON-NLS-1$
application.reportError(Messages.getString("servoy.formPanel.error.printDocument"), ex);
} finally {
application.releaseGUI();
}
}
use of com.servoy.j2db.IApplication in project servoy-client by Servoy.
the class SwingForm method printXML.
/**
* @see com.servoy.j2db.IFormUIInternal#printXML(boolean)
*/
public String printXML(boolean printCurrentRecordOnly) {
IApplication application = formController.getApplication();
IFoundSetInternal fs = formController.getFoundSet();
try {
// $NON-NLS-1$
application.blockGUI(Messages.getString("servoy.formPanel.status.xmlPrinting"));
if (printCurrentRecordOnly) {
fs = fs.copyCurrentRecordFoundSet();
}
FormPreviewPanel fpp = new FormPreviewPanel(application, formController, fs);
fpp.process();
StringWriter w = new StringWriter();
((PageList) fpp.getPageable()).toXML(w);
fpp.destroy();
return w.toString();
} catch (Throwable ex) {
// $NON-NLS-1$
application.reportError(Messages.getString("servoy.formPanel.error.printDocument"), ex);
} finally {
application.releaseGUI();
}
return null;
}
use of com.servoy.j2db.IApplication in project servoy-client by Servoy.
the class ViewFoundSet method getQuery.
/**
* Get the cloned query that created this ViewFoundSset (modifying this QBSelect will not change the foundset).
* The ViewFoundSets main query can't be altered after creation; you need to make a new ViewFoundSet for that (it can have the same datasource name).
*
* @sample
* var q = foundset.getQuery()
* q.where.add(q.columns.x.eq(100))
* var newVF = databaseManager.getViewFoundset("name", q);
*
* @return query.
*/
@JSFunction
public QBSelect getQuery() {
QuerySelect query = AbstractBaseQuery.deepClone(this.select, true);
IApplication application = manager.getApplication();
return new QBSelect(manager, manager.getScopesScopeProvider(), application.getFlattenedSolution(), application.getScriptEngine().getSolutionScope(), select.getTable().getDataSource(), null, query);
}
use of com.servoy.j2db.IApplication in project servoy-client by Servoy.
the class SwingRelatedFoundSet method fireSelectionAdjusting.
@Override
protected void fireSelectionAdjusting() {
if (selectionModel == null)
createSelectionModel();
Runnable runner = new Runnable() {
public void run() {
selectionModel.fireAdjusting();
}
};
IApplication app = fsm.getApplication();
if (app.isEventDispatchThread()) {
runner.run();
} else {
app.invokeLater(runner);
}
}
Aggregations