use of org.olat.core.gui.components.segmentedview.SegmentViewEvent in project OpenOLAT by OpenOLAT.
the class ReferencableEntriesSearchController method event.
@Override
public void event(UserRequest ureq, Component source, Event event) {
if (source == segmentView) {
if (event instanceof SegmentViewEvent) {
SegmentViewEvent sve = (SegmentViewEvent) event;
String segmentCName = sve.getComponentName();
Component clickedLink = mainVC.getComponent(segmentCName);
if (clickedLink == myEntriesLink) {
searchCtr.doSearchByOwnerLimitType(ureq.getIdentity(), limitTypes);
} else if (clickedLink == allEntriesLink) {
switch(canBe) {
case referenceable:
searchCtr.doSearchForReferencableResourcesLimitType(ureq.getIdentity(), limitTypes, ureq.getUserSession().getRoles());
break;
case copyable:
searchCtr.doSearchForCopyableResourcesLimitType(ureq.getIdentity(), limitTypes, ureq.getUserSession().getRoles());
break;
case all:
searchCtr.doSearchByTypeLimitAccess(limitTypes, ureq);
break;
}
} else if (clickedLink == searchEntriesLink) {
searchCtr.displaySearchForm();
} else if (clickedLink == adminEntriesLink) {
searchCtr.displayAdminSearchForm();
}
mainVC.setDirty(true);
}
} else if (source == createRessourceCmp || (source instanceof Link && ((Link) source).getUserObject() instanceof RepositoryHandler)) {
removeAsListenerAndDispose(cmc);
removeAsListenerAndDispose(createController);
RepositoryHandler handler = (RepositoryHandler) ((Link) source).getUserObject();
createController = handler.createCreateRepositoryEntryController(ureq, getWindowControl());
listenTo(createController);
String title = translate(handler.getCreateLabelI18nKey());
cmc = new CloseableModalController(getWindowControl(), translate("close"), createController.getInitialComponent(), true, title);
cmc.setCustomWindowCSS("o_sel_author_create_popup");
listenTo(cmc);
cmc.activate();
} else if (source == importRessourceButton) {
removeAsListenerAndDispose(importController);
importController = new ImportRepositoryEntryController(ureq, getWindowControl(), limitTypes);
listenTo(importController);
removeAsListenerAndDispose(cmc);
cmc = new CloseableModalController(getWindowControl(), translate("close"), importController.getInitialComponent(), true, "");
listenTo(cmc);
cmc.activate();
}
}
use of org.olat.core.gui.components.segmentedview.SegmentViewEvent in project OpenOLAT by OpenOLAT.
the class GTARunController method event.
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source == segmentView) {
if (event instanceof SegmentViewEvent) {
SegmentViewEvent sve = (SegmentViewEvent) event;
String segmentCName = sve.getComponentName();
Component clickedLink = mainVC.getComponent(segmentCName);
if (clickedLink == runLink) {
doOpenRun(ureq);
} else if (clickedLink == coachLink) {
doOpenCoach(ureq);
} else if (clickedLink == markedLink) {
doOpenMarked(ureq);
} else if (clickedLink == manageLink) {
doManage(ureq);
}
}
}
}
use of org.olat.core.gui.components.segmentedview.SegmentViewEvent in project OpenOLAT by OpenOLAT.
the class ProfileAndHomePageEditController method event.
@Override
public void event(UserRequest ureq, Component source, Event event) {
if (source == segmentView) {
if (event instanceof SegmentViewEvent) {
SegmentViewEvent sve = (SegmentViewEvent) event;
String segmentCName = sve.getComponentName();
Component clickedLink = myContent.getComponent(segmentCName);
Controller selectedController = null;
if (clickedLink == profilLink) {
selectedController = doOpenProfile(ureq);
} else if (clickedLink == homePageLink) {
selectedController = doOpenHomePageSettings(ureq);
}
addToHistory(ureq, selectedController);
}
}
}
use of org.olat.core.gui.components.segmentedview.SegmentViewEvent in project openolat by klemens.
the class SitesAdminController method event.
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source == segmentView) {
if (event instanceof SegmentViewEvent) {
SegmentViewEvent sve = (SegmentViewEvent) event;
String segmentCName = sve.getComponentName();
Component clickedLink = mainVC.getComponent(segmentCName);
if (clickedLink == orderLink) {
doOpenAccountSettings(ureq);
} else if (clickedLink == courseSite1Link) {
doCourseSite1Settings(ureq);
} else if (clickedLink == courseSite2Link) {
doCourseSite2Settings(ureq);
} else if (clickedLink == courseSite3Link) {
doCourseSite3Settings(ureq);
} else if (clickedLink == courseSite4Link) {
doCourseSite4Settings(ureq);
}
}
}
}
use of org.olat.core.gui.components.segmentedview.SegmentViewEvent in project openolat by klemens.
the class DatabaseController method event.
@Override
protected void event(UserRequest ureq, Component source, Event event) {
Statistics statistics = dbInstance.getStatistics();
if (source == enableLink) {
statistics.setStatisticsEnabled(true);
mainVC.contextPut("isStatisticsEnabled", statistics.isStatisticsEnabled());
getWindowControl().setInfo("Hibernate statistics enabled.");
} else if (source == disableLink) {
statistics.setStatisticsEnabled(false);
mainVC.contextPut("isStatisticsEnabled", statistics.isStatisticsEnabled());
getWindowControl().setInfo("Hibernate statistics disabled.");
} else if (source == clearLink) {
statistics.clear();
getWindowControl().setInfo("Hibernate statistics clear done.");
} else if (source == segmentView) {
if (event instanceof SegmentViewEvent) {
SegmentViewEvent sve = (SegmentViewEvent) event;
String segmentCName = sve.getComponentName();
Component clickedLink = mainVC.getComponent(segmentCName);
if (clickedLink == statisticsLink) {
doOpenStatistics(ureq);
} else if (clickedLink == queriesLink) {
doOpenQueries(ureq);
} else if (clickedLink == entitiesLink) {
doOpenEntities(ureq);
}
}
}
}
Aggregations