use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project openolat by klemens.
the class UsrPropCfgTableController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
UserPropertyHandler handler = (UserPropertyHandler) source.getUserObject();
if (source instanceof FormToggle) {
FormToggle toggle = (FormToggle) source;
if (toggle.isOn()) {
usrPropCfgMng.getUserPropertiesConfigObject().setHandlerAsActive(handler, true);
usrPropCfgMng.saveUserPropertiesConfig();
} else {
deactPropertyYesNoCtrl = activateYesNoDialog(ureq, translate("upc.deact_confirmationtitle"), translate("upc.deact_confirmationtext"), deactPropertyYesNoCtrl);
deactPropertyYesNoCtrl.setUserObject(handler);
}
} else if (source instanceof SingleSelection) {
SingleSelection groupSel = (SingleSelection) source;
handler.setGroup(groupSel.getSelectedKey());
usrPropCfgMng.saveUserPropertiesConfig();
} else if (source instanceof FormLink) {
String itemname = source.getName();
if (itemname.startsWith(FT_NAME_PREFIX_TRANSL)) {
// open the singlekeyTranslator-controller callout
String key2Translate1 = handler.i18nFormElementLabelKey();
String key2Translate2 = handler.i18nColumnDescriptorLabelKey();
String[] keys2Translate = { key2Translate1, key2Translate2 };
singleKeyTrnsCtrl = new SingleKeyTranslatorController(ureq, getWindowControl(), keys2Translate, UserPropertyHandler.class);
listenTo(singleKeyTrnsCtrl);
removeAsListenerAndDispose(translatorCallout);
translatorCallout = new CloseableCalloutWindowController(ureq, getWindowControl(), singleKeyTrnsCtrl.getInitialComponent(), (FormLink) source, "Translate:: " + key2Translate1, false, null);
listenTo(translatorCallout);
translatorCallout.activate();
} else if (itemname.startsWith(FT_NAME_PREFIX_HDNL)) {
handlerConfigCtrl = handlerConfigCtrlFactory.getConfigController(ureq, getWindowControl(), handler);
listenTo(handlerConfigCtrl);
if (handlerConfigCtrl.getInitialComponent() != null) {
handlerPopupCtr = new CloseableModalController(getWindowControl(), "Save", handlerConfigCtrl.getInitialComponent(), true, translate("upc.handlerconfigtitle"), false);
handlerPopupCtr.activate();
}
}
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project openolat by klemens.
the class TaxonomyLevelOverviewController method doOpenActions.
private void doOpenActions(UserRequest ureq) {
actionsCtrl = new ActionsController(ureq, getWindowControl());
listenTo(actionsCtrl);
actionsCalloutCtrl = new CloseableCalloutWindowController(ureq, getWindowControl(), actionsCtrl.getInitialComponent(), actionButton.getDispatchID(), "", true, "");
listenTo(actionsCalloutCtrl);
actionsCalloutCtrl.activate();
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project openolat by klemens.
the class TaxonomyTreeTableController method doOpenTools.
private void doOpenTools(UserRequest ureq, TaxonomyLevelRow row, FormLink link) {
removeAsListenerAndDispose(toolsCtrl);
removeAsListenerAndDispose(toolsCalloutCtrl);
TaxonomyLevel level = taxonomyService.getTaxonomyLevel(row);
if (level == null) {
tableEl.reloadData();
showWarning("warning.taxonomy.level.deleted");
} else {
toolsCtrl = new ToolsController(ureq, getWindowControl(), row, level);
listenTo(toolsCtrl);
toolsCalloutCtrl = new CloseableCalloutWindowController(ureq, getWindowControl(), toolsCtrl.getInitialComponent(), link.getFormDispatchId(), "", true, "");
listenTo(toolsCalloutCtrl);
toolsCalloutCtrl.activate();
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project openolat by klemens.
the class WikiMainController method event.
@Override
public void event(UserRequest ureq, Component source, Event event) {
String command = event.getCommand();
setTabsEnabled(true);
// to make shure we use the lateste page, reload from cache
Wiki wiki = getWiki();
if (wiki == null) {
mainPanel.setContent(createVelocityContainer("deleted"));
return;
}
WikiPage page = null;
// FIXME:gs images and media should also be wiki pages -> see jamwiki
if (!(event instanceof RequestNewPageEvent) && !(event instanceof RequestMediaEvent) && !(event instanceof RequestImageEvent)) {
page = wiki.getPage(pageId, true);
// set recent page id to the page currently used
if (page != null) {
pageId = page.getPageId();
}
}
if (source == content) {
// noting yet
} else if (source == tabs) {
/**
***********************************************************************
* tabbed pane events
***********************************************************************
*/
TabbedPaneChangedEvent tabEvent = (TabbedPaneChangedEvent) event;
Component comp = tabEvent.getNewComponent();
String compName = comp.getComponentName();
selectTab(ureq, command, compName, page, wiki);
} else if (source == wikiArticleComp) {
/**
***********************************************************************
* wiki component events
***********************************************************************
*/
if (event instanceof RequestPageEvent) {
RequestPageEvent pageEvent = (RequestPageEvent) event;
page = openPage(ureq, pageEvent.getCommand(), wiki);
} else if (event instanceof RequestNewPageEvent) {
page = handleRequestNewPageEvent(ureq, (RequestNewPageEvent) event, wiki);
} else if (event instanceof ErrorEvent) {
showWarning(event.getCommand());
} else if (event instanceof RequestMediaEvent) {
deliverMediaFile(ureq, event.getCommand());
} else if (event instanceof RequestImageEvent) {
// instead of linking to the image-view-page itself
if (isImageDetailView) {
page = wiki.getPage(pageId, true);
updatePageContext(ureq, page);
isImageDetailView = false;
} else {
final WikiPage imagePage = new WikiPage(event.getCommand());
imagePage.setContent("[[Image:" + event.getCommand() + "]]");
articleContent.contextPut("page", imagePage);
wikiArticleComp.setWikiContent(imagePage.getContent());
setTabsEnabled(false);
isImageDetailView = true;
}
}
} else if (source == navigationContent) {
/**
***********************************************************************
* article container events
***********************************************************************
*/
if (command.equals(ACTION_EDIT_MENU)) {
page = wiki.getPage(WikiPage.WIKI_MENU_PAGE);
updateFileAndLinkList(wiki);
tryToSetEditLock(page, ureq, ores);
updatePageContext(ureq, page);
tabs.setSelectedPane(ureq, 2);
}
} else if (source == toMainPageLink) {
// home link
page = openIndexPage(ureq, wiki);
} else if (source == a2zLink) {
openAtoZPage(ureq, wiki);
} else if (source == changesLink) {
openLastChangesPage(ureq, wiki);
} else if (source == editMenuButton) {
page = wiki.getPage(WikiPage.WIKI_MENU_PAGE);
updateFileAndLinkList(wiki);
tryToSetEditLock(page, ureq, ores);
updatePageContext(ureq, page);
// wikiEditForm.setPage(page);
tabs.setSelectedPane(ureq, 2);
} else if (source == archiveLink) {
// archive a snapshot of the wiki in the users personal folder
archiveWikiDialogCtr = activateOkCancelDialog(ureq, null, translate("archive.question"), archiveWikiDialogCtr);
return;
} else if (source == createLink) {
removeAsListenerAndDispose(calloutCtrl);
removeAsListenerAndDispose(createArticleForm);
createArticleForm = new WikiArticleSearchForm(ureq, getWindowControl());
listenTo(createArticleForm);
calloutCtrl = new CloseableCalloutWindowController(ureq, getWindowControl(), createArticleForm.getInitialComponent(), createLink, "", true, null);
listenTo(calloutCtrl);
calloutCtrl.activate();
} else if (source == versioningContent) {
// nothing to do
} else if (source == editContent) {
// nothing to do
} else if (source == closePreviewButton) {
editContent.remove(wikiVersionDisplayComp);
} else if (source == revertVersionButton) {
wikiEditForm.setPage(selectedPage);
tabs.setSelectedPane(ureq, 2);
tryToSetEditLock(page, ureq, ores);
} else if (source instanceof Link && "select-page".equals(command)) {
String name = source.getComponentName();
page = openPage(ureq, name, wiki);
}
// set recent page id to the page currently used
if (page != null) {
this.pageId = page.getPageId();
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project openolat by klemens.
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);
}
}
Aggregations