use of org.olat.core.gui.control.VetoableCloseController in project openolat by klemens.
the class BaseFullWebappController method requestCloseTab.
/**
* @param dt
*/
private void requestCloseTab(UserRequest ureq, DTab delt) {
Controller c = delt.getController();
if (c instanceof VetoableCloseController) {
VetoableCloseController vcc = (VetoableCloseController) c;
// rembember current dtab, and swap to the temporary one
DTab reTab = curDTab;
doActivateDTab(delt);
boolean immediateClose = vcc.requestForClose(ureq);
if (!immediateClose) {
return;
} else {
if (reTab != null) {
doActivateDTab(reTab);
}
removeDTab(ureq, delt);
}
} else {
removeDTab(ureq, delt);
}
}
use of org.olat.core.gui.control.VetoableCloseController in project OpenOLAT by OpenOLAT.
the class BreadcrumbedStackedPanel method dispatchEvent.
@Override
public void dispatchEvent(UserRequest ureq, Component source, Event event) {
boolean closeEvent = source.equals(closeLink);
boolean backEvent = source.equals(backLink);
if (backEvent || closeEvent) {
if (stack.size() > 1) {
// back means to one level down, change source to the stack item one below current
source = stack.get(stack.size() - 2);
// now continue as if user manually pressed a stack item in the list
} else {
// notify listeners that back or link beyond breadcrumb has been called
fireEvent(ureq, Event.CLOSE_EVENT);
}
}
if (stack.contains(source)) {
Controller controllerToPop = getControllerToPop(source);
// part of a hack for QTI editor
if (controllerToPop instanceof VetoableCloseController && !((VetoableCloseController) controllerToPop).requestForClose(ureq)) {
// not my problem anymore, I have done what I can
fireEvent(ureq, new VetoPopEvent());
return;
}
BreadCrumb popedCrumb = popController(source);
if (popedCrumb != null) {
Controller last = getLastController();
if (last != null) {
addToHistory(ureq, last);
}
if (popedCrumb.getController() != null) {
fireEvent(ureq, new PopEvent(popedCrumb.getController(), popedCrumb.getUserObject(), closeEvent));
} else if (popedCrumb.getUserObject() != null) {
fireEvent(ureq, new PopEvent(popedCrumb.getUserObject(), closeEvent));
}
} else if (stack.indexOf(source) == 0) {
fireEvent(ureq, new RootEvent());
}
}
}
use of org.olat.core.gui.control.VetoableCloseController in project OpenOLAT by OpenOLAT.
the class BaseFullWebappController method requestCloseTab.
/**
* @param dt
*/
private void requestCloseTab(UserRequest ureq, DTab delt) {
Controller c = delt.getController();
if (c instanceof VetoableCloseController) {
VetoableCloseController vcc = (VetoableCloseController) c;
// rembember current dtab, and swap to the temporary one
DTab reTab = curDTab;
doActivateDTab(delt);
boolean immediateClose = vcc.requestForClose(ureq);
if (!immediateClose) {
return;
} else {
if (reTab != null) {
doActivateDTab(reTab);
}
removeDTab(ureq, delt);
}
} else {
removeDTab(ureq, delt);
}
}
use of org.olat.core.gui.control.VetoableCloseController in project openolat by klemens.
the class BreadcrumbedStackedPanel method dispatchEvent.
@Override
public void dispatchEvent(UserRequest ureq, Component source, Event event) {
boolean closeEvent = source.equals(closeLink);
boolean backEvent = source.equals(backLink);
if (backEvent || closeEvent) {
if (stack.size() > 1) {
// back means to one level down, change source to the stack item one below current
source = stack.get(stack.size() - 2);
// now continue as if user manually pressed a stack item in the list
} else {
// notify listeners that back or link beyond breadcrumb has been called
fireEvent(ureq, Event.CLOSE_EVENT);
}
}
if (stack.contains(source)) {
Controller controllerToPop = getControllerToPop(source);
// part of a hack for QTI editor
if (controllerToPop instanceof VetoableCloseController && !((VetoableCloseController) controllerToPop).requestForClose(ureq)) {
// not my problem anymore, I have done what I can
fireEvent(ureq, new VetoPopEvent());
return;
}
BreadCrumb popedCrumb = popController(source);
if (popedCrumb != null) {
Controller last = getLastController();
if (last != null) {
addToHistory(ureq, last);
}
if (popedCrumb.getController() != null) {
fireEvent(ureq, new PopEvent(popedCrumb.getController(), popedCrumb.getUserObject(), closeEvent));
} else if (popedCrumb.getUserObject() != null) {
fireEvent(ureq, new PopEvent(popedCrumb.getUserObject(), closeEvent));
}
} else if (stack.indexOf(source) == 0) {
fireEvent(ureq, new RootEvent());
}
}
}
Aggregations