use of com.servoy.j2db.FormManager in project servoy-client by Servoy.
the class CmdExtendFind 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, false, true);
}
return null;
}
use of com.servoy.j2db.FormManager 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.FormManager 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.FormManager in project servoy-client by Servoy.
the class JSSolutionModel method removeGlobalMethod.
/**
* Removes the specified global method.
*
* @sample
* var m1 = solutionModel.newGlobalMethod('globals', 'function myglobalmethod1(){application.output("Global Method 1");}');
* var m2 = solutionModel.newGlobalMethod('globals', 'function myglobalmethod2(){application.output("Global Method 2");}');
*
* var success = solutionModel.removeGlobalMethod('globals', 'myglobalmethod1');
* if (success == false) application.output('!!! myglobalmethod1 could not be removed !!!');
*
* var list = solutionModel.getGlobalMethods('globals');
* for (var i = 0; i < list.length; i++) {
* application.output(list[i].code);
* }
*
* @param scopeName the scope in which the method is declared
* @param name the name of the global method to be removed
* @return true if the removal was successful, false otherwise
*/
@JSFunction
public boolean removeGlobalMethod(String scopeName, String name) {
FlattenedSolution fs = application.getFlattenedSolution();
ScriptMethod sm = fs.getScriptMethod(scopeName, name);
if (sm != null) {
fs.deletePersistCopy(sm, false);
if (application.getFormManager() instanceof FormManager)
((FormManager) application.getFormManager()).fillScriptMenu();
return true;
}
return false;
}
use of com.servoy.j2db.FormManager in project servoy-client by Servoy.
the class FormDialog method closeWindow.
public void closeWindow() {
if (!isModal()) {
GraphicsDevice device = getGraphicsConfiguration().getDevice();
if (device.getFullScreenWindow() == this) {
// reset fullscreen window when dialog closes
device.setFullScreenWindow(null);
dispose();
setUndecorated(false);
}
}
storeBounds();
boolean wasVisible = isVisible();
setVisible(false);
if (wasVisible) {
FormManager fm = (FormManager) application.getFormManager();
if (isModal()) {
fm.setModalDialogContainer(previousModalContainer);
fm.setCurrentContainer(previousMainContainer, previousMainContainer.getContainerName());
} else {
Window owner = getOwner();
if (owner instanceof FormWindow) {
// called from another dialog/window
((FormWindow) owner).setAsCurrentContainer();
} else {
// called from main panel
((FormManager) application.getFormManager()).setCurrentContainer(null, null);
}
}
fm.fillScriptMenu();
}
}
Aggregations