use of com.servoy.j2db.IForm in project servoy-client by Servoy.
the class CmdReduceFind method doIt.
/*
* _____________________________________________________________ The methods below override methods from superclass AbstractCmd
*/
@Override
public UndoableEdit doIt(java.util.EventObject ae) {
IFormManager fm = application.getFormManager();
IForm cf = fm.getCurrentForm();
if (cf != null && !cf.isInFindMode()) {
cf = null;
}
if (cf == null) {
IForm[] rfif = ((FormManager) fm).getVisibleRootFormsInFind();
cf = rfif.length > 0 ? rfif[0] : null;
// rfif.length > 1 would be a strange case where more than one visible form relation hierarchy is in find mode;
// we choose the first one - I or should we use all of them?! this is an ansupported case anyway
}
if (cf != null) {
cf.performFind(false, true, true);
}
return null;
}
use of com.servoy.j2db.IForm in project servoy-client by Servoy.
the class CmdShowOmitRecords method doIt.
/*
* _____________________________________________________________ The methods below override methods from superclass AbstractCmd
*/
@Override
public UndoableEdit doIt(java.util.EventObject ae) {
try {
// $NON-NLS-1$
application.blockGUI(application.getI18NMessage("servoy.menuitem.showOmitted.status.text"));
IFormManager fm = application.getFormManager();
IForm dm = fm.getCurrentForm();
dm.showOmittedRecords();
} finally {
application.releaseGUI();
}
return null;
}
use of com.servoy.j2db.IForm in project servoy-client by Servoy.
the class CmdSort method doIt.
@Override
public UndoableEdit doIt(java.util.EventObject ae) {
try {
// $NON-NLS-1$
application.blockGUI(application.getI18NMessage("servoy.menuitem.sort.status.text"));
IFormManager fm = application.getFormManager();
IForm dm = fm.getCurrentForm();
dm.showSortDialog();
} catch (Exception ex) {
Debug.error(ex);
} finally {
application.releaseGUI();
}
return null;
}
use of com.servoy.j2db.IForm in project servoy-client by Servoy.
the class CmdStopSearchFindAll method doIt.
@Override
public UndoableEdit doIt(java.util.EventObject ae) {
try {
// $NON-NLS-1$
application.blockGUI(application.getI18NMessage("servoy.menuitem.showAll.status.text"));
FormManager fm = (FormManager) application.getFormManager();
IForm[] rootFindModeForms = fm.getVisibleRootFormsInFind();
for (IForm fc : rootFindModeForms) {
fc.loadAllRecords();
}
} finally {
application.releaseGUI();
}
return null;
}
use of com.servoy.j2db.IForm in project servoy-client by Servoy.
the class AbstractRuntimeTabPaneAlike method js_addTab.
@SuppressWarnings("nls")
public boolean js_addTab(Object[] vargs) {
if (vargs.length < 1)
return false;
int index = 0;
Object form = vargs[index++];
IForm formController = null;
String formName = null;
if (form instanceof IForm) {
formController = (IForm) form;
}
if (form instanceof BasicFormController.JSForm) {
formController = ((BasicFormController.JSForm) form).getFormPanel();
}
if (formController != null)
formName = formController.getName();
if (form instanceof String)
formName = (String) form;
if (formName == null) {
return false;
}
String tabName = formName;
if (vargs.length >= 2) {
tabName = (String) vargs[index++];
}
String tabText = tabName;
if (vargs.length >= 3) {
tabText = (String) vargs[index++];
}
String tooltip = "";
if (vargs.length >= 4) {
tooltip = (String) vargs[index++];
}
String iconURL = "";
if (vargs.length >= 5) {
iconURL = (String) vargs[index++];
}
String fg = null;
if (vargs.length >= 6) {
fg = (String) vargs[index++];
}
String bg = null;
if (vargs.length >= 7) {
bg = (String) vargs[index++];
}
RelatedFoundSet relatedFs = null;
String relationName = null;
int tabIndex = -1;
if (vargs.length > 7) {
Object object = vargs[index++];
if (object instanceof RelatedFoundSet) {
relatedFs = (RelatedFoundSet) object;
relationName = relatedFs.getRelationName();
if (formController != null && !relatedFs.getDataSource().equals(formController.getDataSource())) {
return false;
}
// TODO do this check to check if the parent table has this relation? How to get the parent table
// Table parentTable = null;
// application.getSolution().getRelations(Solution.SOLUTION+Solution.MODULES, parentTable, true, false);
} else if (object instanceof String) {
relationName = (String) object;
} else if (object instanceof Number) {
tabIndex = ((Number) object).intValue();
}
}
if (vargs.length > 8) {
tabIndex = Utils.getAsInteger(vargs[index++]);
}
testTabName(tabName);
return getComponent().addTab(formController, formName, tabName, tabText, tooltip, iconURL, fg, bg, relationName, relatedFs, tabIndex);
}
Aggregations