Search in sources :

Example 11 with CloseableCalloutWindowController

use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project OpenOLAT by OpenOLAT.

the class LectureListRepositoryController method doOpenTools.

private void doOpenTools(UserRequest ureq, LectureBlockRow row, FormLink link) {
    removeAsListenerAndDispose(toolsCtrl);
    removeAsListenerAndDispose(toolsCalloutCtrl);
    toolsCtrl = new ToolsController(ureq, getWindowControl(), row);
    listenTo(toolsCtrl);
    toolsCalloutCtrl = new CloseableCalloutWindowController(ureq, getWindowControl(), toolsCtrl.getInitialComponent(), link.getFormDispatchId(), "", true, "");
    listenTo(toolsCalloutCtrl);
    toolsCalloutCtrl.activate();
}
Also used : CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController)

Example 12 with CloseableCalloutWindowController

use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project OpenOLAT by OpenOLAT.

the class ReasonAdminController method doOpenTools.

private void doOpenTools(UserRequest ureq, Reason row, FormLink link) {
    removeAsListenerAndDispose(toolsCtrl);
    removeAsListenerAndDispose(toolsCalloutCtrl);
    toolsCtrl = new ToolsController(ureq, getWindowControl(), row);
    listenTo(toolsCtrl);
    toolsCalloutCtrl = new CloseableCalloutWindowController(ureq, getWindowControl(), toolsCtrl.getInitialComponent(), link.getFormDispatchId(), "", true, "");
    listenTo(toolsCalloutCtrl);
    toolsCalloutCtrl.activate();
}
Also used : CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController)

Example 13 with CloseableCalloutWindowController

use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project OpenOLAT by OpenOLAT.

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();
    }
}
Also used : RequestPageEvent(org.olat.modules.wiki.gui.components.wikiToHtml.RequestPageEvent) TabbedPaneChangedEvent(org.olat.core.gui.components.tabbedpane.TabbedPaneChangedEvent) CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) RequestNewPageEvent(org.olat.modules.wiki.gui.components.wikiToHtml.RequestNewPageEvent) RequestMediaEvent(org.olat.modules.wiki.gui.components.wikiToHtml.RequestMediaEvent) ErrorEvent(org.olat.modules.wiki.gui.components.wikiToHtml.ErrorEvent) Component(org.olat.core.gui.components.Component) WikiMarkupComponent(org.olat.modules.wiki.gui.components.wikiToHtml.WikiMarkupComponent) JSAndCSSComponent(org.olat.core.gui.components.htmlheader.jscss.JSAndCSSComponent) MediaCollectorComponent(org.olat.modules.portfolio.ui.component.MediaCollectorComponent) Link(org.olat.core.gui.components.link.Link) RequestImageEvent(org.olat.modules.wiki.gui.components.wikiToHtml.RequestImageEvent)

Example 14 with CloseableCalloutWindowController

use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project OpenOLAT by OpenOLAT.

the class GroupAssessmentController method doEditComment.

private void doEditComment(UserRequest ureq, AssessmentRow row) {
    removeAsListenerAndDispose(commentCalloutCtrl);
    OLATResource courseOres = courseEntry.getOlatResource();
    editCommentCtrl = new EditCommentController(ureq, getWindowControl(), courseOres, gtaNode, row);
    listenTo(editCommentCtrl);
    commentCalloutCtrl = new CloseableCalloutWindowController(ureq, getWindowControl(), editCommentCtrl.getInitialComponent(), row.getCommentEditLink().getFormDispatchId(), "", true, "");
    listenTo(commentCalloutCtrl);
    commentCalloutCtrl.activate();
}
Also used : CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) OLATResource(org.olat.resource.OLATResource)

Example 15 with CloseableCalloutWindowController

use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project OpenOLAT by OpenOLAT.

the class PortfolioResultDetailsController method popupDeadlineBox.

/**
 * @param ureq
 */
private void popupDeadlineBox(UserRequest ureq, EPStructuredMap map) {
    String title = translate("map.deadline.change");
    removeAsListenerAndDispose(deadlineCtr);
    deadlineCtr = new DeadlineController(ureq, getWindowControl(), map);
    listenTo(deadlineCtr);
    removeAsListenerAndDispose(deadlineCalloutCtr);
    FormLink changeDeadlineLink = mapToElements.get(map).changeDeadlineLink;
    deadlineCalloutCtr = new CloseableCalloutWindowController(ureq, getWindowControl(), deadlineCtr.getInitialComponent(), changeDeadlineLink, title, true, "o_ep_deadline_callout");
    listenTo(deadlineCalloutCtr);
    deadlineCalloutCtr.activate();
}
Also used : CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Aggregations

CloseableCalloutWindowController (org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController)122 VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)12 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)8 ArrayList (java.util.ArrayList)6 List (java.util.List)6 Component (org.olat.core.gui.components.Component)6 Link (org.olat.core.gui.components.link.Link)6 Identity (org.olat.core.id.Identity)6 RepositoryEntry (org.olat.repository.RepositoryEntry)6 RepositoryEntrySmallDetailsController (org.olat.repository.ui.author.RepositoryEntrySmallDetailsController)6 UserSearchController (org.olat.admin.user.UserSearchController)4 CalloutSettings (org.olat.core.gui.control.generic.closablewrapper.CalloutSettings)4 NamingException (javax.naming.NamingException)2 LdapContext (javax.naming.ldap.LdapContext)2 KalendarRenderWrapper (org.olat.commons.calendar.ui.components.KalendarRenderWrapper)2 UserRequest (org.olat.core.gui.UserRequest)2 Choice (org.olat.core.gui.components.choice.Choice)2 FormToggle (org.olat.core.gui.components.form.flexible.elements.FormToggle)2 SingleSelection (org.olat.core.gui.components.form.flexible.elements.SingleSelection)2 JSAndCSSComponent (org.olat.core.gui.components.htmlheader.jscss.JSAndCSSComponent)2