use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project OpenOLAT by OpenOLAT.
the class EPMapRunController method event.
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source == createMapLink) {
// if only normal maps can be created, show popup immediately, else present selection in callout
if (option.equals(EPMapRunViewOption.MY_DEFAULTS_MAPS)) {
VelocityContainer mapCreateVC = createVelocityContainer("createMapCallout");
createMapCalloutLink = LinkFactory.createLink("create.map.default", mapCreateVC, this);
createMapCalloutLink.setElementCssClass("o_sel_create_default_map");
createMapFromTemplateLink = LinkFactory.createLink("create.map.fromTemplate", mapCreateVC, this);
createMapFromTemplateLink.setElementCssClass("o_sel_create_template_map");
String title = translate("create.map");
removeAsListenerAndDispose(mapCreateCalloutCtrl);
mapCreateCalloutCtrl = new CloseableCalloutWindowController(ureq, getWindowControl(), mapCreateVC, createMapLink, title, true, null);
listenTo(mapCreateCalloutCtrl);
mapCreateCalloutCtrl.activate();
} else {
popUpCreateMapBox(ureq);
}
} else if (source == createMapFromTemplateLink) {
closeCreateMapCallout();
popUpCreateMapFromTemplateBox(ureq);
} else if (source == createMapCalloutLink) {
closeCreateMapCallout();
popUpCreateMapBox(ureq);
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project OpenOLAT by OpenOLAT.
the class GuiDemoFlexiFormSubworkflow method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source == choose) {
// choose link clicked
// show a subworkflow in a modal dialog without loosing fromdata
//
// work around to disable orange button and alert box of "unsubmitted form onscreen"
// this will change within the next release.
this.flc.getRootForm().setDirtyMarking(false);
//
//
subworkflowTheChooser = new GuiDemoFlexiFormSubworkflowTheChooser(ureq, getWindowControl(), values, institution.getValue());
// get informed if subworkflow has submitted =>
listenTo(subworkflowTheChooser);
calloutWindowCtr = new CloseableCalloutWindowController(ureq, getWindowControl(), subworkflowTheChooser.getInitialComponent(), choose, null, true, null);
// get informed if modal dialog is closed => this means canceling the workflow
listenTo(calloutWindowCtr);
// open callout window now
calloutWindowCtr.activate();
return;
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project OpenOLAT by OpenOLAT.
the class LDAPAdminController method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
* org.olat.core.gui.components.Component,
* org.olat.core.gui.control.Event)
*/
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source == syncStartLink) {
// Start sync job
// Disable start link during sync
syncStartLink.setEnabled(false);
LDAPEvent ldapEvent = new LDAPEvent(LDAPEvent.DO_SYNCHING);
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(ldapEvent, LDAPLoginManager.ldapSyncLockOres);
showInfo("admin.synchronize.started");
} else if (source == syncOneUserLink) {
userSearchCtrl = new UserSearchController(ureq, getWindowControl(), false);
listenTo(userSearchCtrl);
calloutCtr = new CloseableCalloutWindowController(ureq, getWindowControl(), userSearchCtrl.getInitialComponent(), syncOneUserLink, null, true, null);
calloutCtr.addDisposableChildController(userSearchCtrl);
calloutCtr.activate();
listenTo(calloutCtr);
} else if (source == deletStartLink) {
// cancel if some one else is making sync or delete job
if (!ldapLoginManager.acquireSyncLock()) {
showError("delete.error.lock");
} else {
deletStartLink.setEnabled(false);
// check and get LDAP connection
LdapContext ctx = ldapLoginManager.bindSystem();
if (ctx == null) {
showError("delete.error.connection");
return;
}
// get deleted users
identitiesToDelete = ldapLoginManager.getIdentitysDeletedInLdap(ctx);
try {
ctx.close();
} catch (NamingException e) {
showError("delete.error.connection.close");
logError("Could not close LDAP connection on manual delete sync", e);
}
if (identitiesToDelete != null && identitiesToDelete.size() != 0) {
hasIdentitiesToDelete = true;
/*
* start step which spawns the whole wizard
*/
Step start = new DeletStep00(ureq, hasIdentitiesToDelete, identitiesToDelete);
/*
* wizard finish callback called after "finish" is called
*/
StepRunnerCallback finishCallback = new StepRunnerCallback() {
public Step execute(UserRequest uureq, WindowControl control, StepsRunContext runContext) {
hasIdentitiesToDeleteAfterRun = ((Boolean) runContext.get("hasIdentitiesToDelete")).booleanValue();
if (hasIdentitiesToDeleteAfterRun) {
@SuppressWarnings("unchecked") List<Identity> idToDelete = (List<Identity>) runContext.get("identitiesToDelete");
amountUsersToDelete = idToDelete.size();
// Delete all identities now and tell everybody that
// we are finished
ldapLoginManager.deletIdentities(idToDelete);
return StepsMainRunController.DONE_MODIFIED;
} else {
return StepsMainRunController.DONE_UNCHANGED;
}
// otherwise return without deleting anything
}
};
deleteStepController = new StepsMainRunController(ureq, getWindowControl(), start, finishCallback, null, translate("admin.deleteUser.title"), "o_sel_ldap_delete_user_wizard");
listenTo(deleteStepController);
getWindowControl().pushAsModalDialog(deleteStepController.getInitialComponent());
} else {
hasIdentitiesToDelete = false;
showInfo("delete.step.noUsers");
deletStartLink.setEnabled(true);
ldapLoginManager.freeSyncLock();
}
}
} else if (source == removeFallBackAuthsLink) {
removeFallBackAuthsLink.setEnabled(false);
ldapLoginManager.removeFallBackAuthentications();
showInfo("opsuccess");
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project OpenOLAT by OpenOLAT.
the class RepositorySearchController method doOpenInfos.
private void doOpenInfos(UserRequest ureq, RepositoryEntry repositoryEntry, int rowId) {
removeAsListenerAndDispose(calloutCtrl);
removeAsListenerAndDispose(infosCtrl);
infosCtrl = new RepositoryEntrySmallDetailsController(ureq, getWindowControl(), repositoryEntry);
listenTo(infosCtrl);
calloutCtrl = new CloseableCalloutWindowController(ureq, getWindowControl(), infosCtrl.getInitialComponent(), "ore" + rowId + "ref", null, true, null);
listenTo(calloutCtrl);
calloutCtrl.activate();
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project OpenOLAT by OpenOLAT.
the class BusinessGroupEditResourceController method doOpenInfos.
private void doOpenInfos(UserRequest ureq, RepositoryEntry repositoryEntry, int rowId) {
removeAsListenerAndDispose(calloutCtrl);
removeAsListenerAndDispose(infosCtrl);
infosCtrl = new RepositoryEntrySmallDetailsController(ureq, getWindowControl(), repositoryEntry);
listenTo(infosCtrl);
calloutCtrl = new CloseableCalloutWindowController(ureq, getWindowControl(), infosCtrl.getInitialComponent(), "ore" + rowId + "ref", null, true, null);
listenTo(calloutCtrl);
calloutCtrl.activate();
}
Aggregations