use of org.olat.core.gui.components.panel.Panel in project OpenOLAT by OpenOLAT.
the class BusinessGroupMainRunController method doChat.
private void doChat(UserRequest ureq) {
ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(ORES_TOOLCHAT);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, getWindowControl());
addToHistory(ureq, bwControl);
CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(businessGroup);
collabToolCtr = collabTools.createChatController(ureq, bwControl, businessGroup, isAdmin);
if (collabToolCtr == null) {
showWarning("groupchat.not.available");
mainPanel.setContent(new Panel("empty"));
} else {
mainPanel.setContent(collabToolCtr.getInitialComponent());
}
}
use of org.olat.core.gui.components.panel.Panel in project OpenOLAT by OpenOLAT.
the class QTI21RuntimeStatisticsController method doSelectNode.
private void doSelectNode(UserRequest ureq, TreeNode selectedNode) {
removeAsListenerAndDispose(currentCtrl);
WindowControl swControl = addToHistory(ureq, OresHelper.createOLATResourceableInstance(selectedNode.getIdent(), 0l), null);
currentCtrl = resourceResult.getController(ureq, swControl, stackPanel, selectedNode, false);
if (currentCtrl != null) {
listenTo(currentCtrl);
layoutCtr.setCol3(currentCtrl.getInitialComponent());
} else {
layoutCtr.setCol3(new Panel("empty"));
}
}
use of org.olat.core.gui.components.panel.Panel in project OpenOLAT by OpenOLAT.
the class EPMultipleArtefactSmallReadOnlyPreviewController method init.
private void init(UserRequest ureq) {
if (artefactCtrls != null)
disposeArtefactControllers();
if (optionLinkCtrls != null)
disposeOptionLinkControllers();
optionLinkCtrls = new ArrayList<Controller>();
artefactCtrls = new ArrayList<Controller>();
List<List<Panel>> artefactCtrlCompLines = new ArrayList<List<Panel>>();
List<Panel> artefactCtrlCompLine = new ArrayList<Panel>();
int i = 1;
for (AbstractArtefact artefact : artefacts) {
EPArtefactHandler<?> artHandler = portfolioModule.getArtefactHandler(artefact.getResourceableTypeName());
Controller artCtrl;
// check for special art-display:
boolean special = artHandler.isProvidingSpecialMapViewController();
if (special) {
artCtrl = artHandler.getSpecialMapViewController(ureq, getWindowControl(), artefact);
if (artCtrl != null) {
// add the optionsLink to the artefact
EPArtefactViewOptionsLinkController optionsLinkCtrl = new EPArtefactViewOptionsLinkController(ureq, getWindowControl(), artefact, secCallback, struct);
vC.put("optionsLink" + i, optionsLinkCtrl.getInitialComponent());
listenTo(optionsLinkCtrl);
optionLinkCtrls.add(optionsLinkCtrl);
}
} else {
artCtrl = new EPArtefactViewReadOnlyController(ureq, getWindowControl(), artefact, struct, secCallback, true);
}
if (artCtrl != null) {
artefactCtrls.add(artCtrl);
Component artefactCtrlComponent = artCtrl.getInitialComponent();
listenTo(artCtrl);
Panel namedPanel = new Panel("artCtrl" + i);
namedPanel.setContent(artefactCtrlComponent);
if (special) {
if (!artefactCtrlCompLine.isEmpty()) {
artefactCtrlCompLines.add(artefactCtrlCompLine);
}
artefactCtrlCompLines.add(Collections.singletonList(namedPanel));
artefactCtrlCompLine = new ArrayList<Panel>();
} else {
if (artefactCtrlCompLine.size() == 3) {
if (!artefactCtrlCompLine.isEmpty()) {
artefactCtrlCompLines.add(artefactCtrlCompLine);
}
artefactCtrlCompLine = new ArrayList<Panel>();
}
artefactCtrlCompLine.add(namedPanel);
}
vC.put("artCtrl" + i, namedPanel);
if (special) {
// need a flag in a lopp for the velociy template
vC.put("specialartCtrl" + i, artefactCtrlComponent);
}
i++;
}
}
if (!artefactCtrlCompLine.isEmpty()) {
artefactCtrlCompLines.add(artefactCtrlCompLine);
}
vC.contextPut("artefactCtrlCompLines", artefactCtrlCompLines);
}
use of org.olat.core.gui.components.panel.Panel in project openolat by klemens.
the class GenericMainController method init.
/**
* use after optional addChildNodeToAppend() or addChildNodeToPrepend() calls
* to initialize MainController and set Panel
*
* @param ureq
*/
public void init(UserRequest ureq) {
olatMenuTree = new MenuTree("olatMenuTree");
TreeModel tm = buildTreeModel(ureq);
olatMenuTree.setTreeModel(tm);
content = new Panel("content");
TreeNode firstNode = tm.getRootNode();
TreeNode nodeToSelect = getLastDelegate(firstNode);
olatMenuTree.setSelectedNodeId(nodeToSelect.getIdent());
olatMenuTree.addListener(this);
// default is to not display the root element and to let user open/close sub elements
olatMenuTree.setRootVisible(false);
olatMenuTree.setExpandSelectedNode(false);
Object uobject = nodeToSelect.getUserObject();
contentCtr = getContentCtr(uobject, ureq);
// auto dispose later
listenTo(contentCtr);
Component resComp = contentCtr.getInitialComponent();
content.setContent(resComp);
columnLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), olatMenuTree, content, className);
// auto dispose later
listenTo(columnLayoutCtr);
// create the stack
stackVC = new BreadcrumbedStackedPanel("genericStack", getTranslator(), this);
stackVC.pushController("content", columnLayoutCtr);
putInitialPanel(stackVC);
}
use of org.olat.core.gui.components.panel.Panel in project openolat by klemens.
the class ScormRunController method init.
private void init(UserRequest ureq) {
startPage = createVelocityContainer("run");
// show browse mode option only if not assessable, hide it if in
// "real test mode"
isAssessable = config.getBooleanSafe(ScormEditController.CONFIG_ISASSESSABLE, true);
if (isAssessable) {
assessableType = config.getStringValue(ScormEditController.CONFIG_ASSESSABLE_TYPE, ScormEditController.CONFIG_ASSESSABLE_TYPE_SCORE);
}
// set start button if max attempts are not reached
if (!maxAttemptsReached()) {
chooseScormRunMode = new ChooseScormRunModeForm(ureq, getWindowControl(), !isAssessable, userCourseEnv.isCourseReadOnly());
listenTo(chooseScormRunMode);
startPage.put("chooseScormRunMode", chooseScormRunMode.getInitialComponent());
startPage.contextPut("maxAttemptsReached", Boolean.FALSE);
} else {
startPage.contextPut("maxAttemptsReached", Boolean.TRUE);
}
// </OLATCE-289>
main = new Panel("scormrunmain");
doStartPage(ureq);
putInitialPanel(main);
boolean doSkip = config.getBooleanSafe(ScormEditController.CONFIG_SKIPLAUNCHPAGE, false);
if (doSkip && !maxAttemptsReached()) {
doLaunch(ureq, true);
getWindowControl().getWindowBackOffice().addCycleListener(this);
}
}
Aggregations