Package org.olat.core.gui.components.link

Examples of org.olat.core.gui.components.link.Link


  void putToBreadCrumbStack(CrumbController crumbController) {
    // re-enable last link
    if (breadCrumbLinks.size() > 0) breadCrumbLinks.get(breadCrumbLinks.size() - 1).setEnabled(true);
    // create new link for this crumb and add it to data model
    String cmd = "crumb-" + breadCrumbLinks.size();
    Link link = LinkFactory.createCustomLink(cmd, cmd, cmd, Link.NONTRANSLATED, breadCrumbVC, this);
    link.setCustomDisplayText(crumbController.getCrumbLinkText());     
    link.setTitle(crumbController.getCrumbLinkHooverText());
    link.setUserObject(crumbController);
    link.setEnabled(false);
    breadCrumbLinks.add(link);
    breadCrumbVC.put("content", crumbController.getInitialComponent());
    // set bread crumb navigation controller
    crumbController.setBreadCrumbController(this);
  }
View Full Code Here


    if (activateLinkPos > 0) {
      // remove children elements from list and reput to hibernate
      breadCrumbLinks = breadCrumbLinks.subList(0, activateLinkPos);
      breadCrumbVC.contextPut("breadCrumbs", breadCrumbLinks);
      // disable current link and update content view from current controller
      Link parentLink = breadCrumbLinks.get(activateLinkPos - 1);
      parentLink.setEnabled(false);
      CrumbController parentController = (CrumbController) parentLink.getUserObject();
      breadCrumbVC.put("content", parentController.getInitialComponent());
    }
  }
View Full Code Here

      yearLink.setUserObject(year);
      mainVC.contextPut("year", year);
      // Reestablish month links
      monthLinks = new ArrayList<Link>();
      for (Month month : year.getMonths()) {
        Link monthLink = LinkFactory.createLink("month_" + month.getName(), mainVC, this);
        monthLink.setCustomDisplayText(model.getMonthName(month));
        monthLink.setUserObject(month);
        monthLinks.add(monthLink);
      }
      // enable/disable the navigation links
      next.setEnabled(model.hasNext());
      previous.setEnabled(model.hasPrevious());
View Full Code Here

      Year year = (Year) yearLink.getUserObject();
      Event navEvent = new NavigationEvent(year.getItems());
      fireEvent(ureq, navEvent);

    } else if (monthLinks.contains(source)) {
      Link monthLink = (Link) source;
      Month month = (Month) monthLink.getUserObject();
      Event navEvent = new NavigationEvent(month.getItems());
      fireEvent(ureq, navEvent);
    }
  }
View Full Code Here

      PortletContainer pc = PortletFactory.getPortletContainerFor(portletConfiguration, getWindowControl(), ureq);     
      pc.addControllerListener(this);
      // remember this portlet container
      this.portletContainers.put(portletName, pc);
      String addLinkName = "command.add." + portletName;
      Link tmp = LinkFactory.createCustomLink(addLinkName, addLinkName, "add", Link.BUTTON_XSMALL, portalVC, this);
      tmp.setUserObject(portletName);
      // and add to velocity
      this.portalVC.put(portletName, pc.getInitialComponent());
     
      // check if portlet is active for this user
      Iterator colIter = this.portalColumns.iterator();
View Full Code Here

  /**
   * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
   */
  public void event(UserRequest ureq, Component source, Event event) {
    if (source instanceof Link && portalVC.getComponents().containsValue(source)) {
      Link tmp = (Link)source;
      String portletName = (String)tmp.getUserObject();
      List<String> firstColumn = this.portalColumns.get(0);
      PortletContainer pc = this.portletContainers.get(portletName);
      if (pc == null) throw new AssertException("trying to add portlet with name::" + portletName + " to portal, but portlet container did not exist. Could be a user modifying the URL...");
      // add to users portlet list
      firstColumn.add(portletName);
View Full Code Here

      //TODO:pb remove quickfix -> recorder is also removed
      //FIXME:as:pb: quickfix, all components must have names for recorder
      linkCmpName = action;
    }
    if (cssClass == null){
      Link linkCmp = LinkFactory.createCustomLink(linkCmpName, action, text, Link.TOOLENTRY_DEFAULT + Link.NONTRANSLATED, null, this);
      if(markAsDownloadLink){
        LinkFactory.markDownloadLink(linkCmp);
      }
      myLinks.add(linkCmp);
      addComponent(linkCmp, ident);
    }
    else if (cssClass.equals("b_toolbox_close")){
      Link linkCmp = LinkFactory.createCustomLink(linkCmpName, action, text, Link.TOOLENTRY_CLOSE + Link.NONTRANSLATED, null, this);
      if(markAsDownloadLink){
        LinkFactory.markDownloadLink(linkCmp);
      }
      myLinks.add(linkCmp);
      addComponent(linkCmp, ident);
View Full Code Here

    entry.setEnabled(enabled);

    if (wasEnabled ^ enabled) {
      content.setDirty(true);
      if(entry.getComponent() instanceof Link){
        Link lnk = (Link) entry.getComponent();
        lnk.setEnabled(enabled);
      }
    }
  }
View Full Code Here

    List buttons = new ArrayList();
    if (buttonLabels != null) {
      for (int i = 0; i < buttonLabels.size(); i++) {
        String buttonText = buttonLabels.get(i);
        String linkName = "link_" + i;
        Link link = LinkFactory.createButton(linkName, dialogBoxVC, this);
        link.setCustomDisplayText(buttonText);
        // Within a dialog all 'you will loose form data' messages should be
        // supporesse. this is obvious to a user and leads to impossible
        // workflows. See OLAT-4257
        link.setSuppressDirtyFormWarning(true);
        buttons.add(linkName);
      }
    }
    dialogBoxVC.contextPut("buttons", buttons);
   
View Full Code Here

      int splitPos = pageIdentifyer.indexOf(":");
      String bundleName = pageIdentifyer.substring(0, splitPos);
      String page = pageIdentifyer.substring(splitPos+1);
      PackageTranslator pageTans = new PackageTranslator(bundleName, getLocale());
      String pageTitle = pageTans.translate("chelp." + page.split("\\.")[0] + ".title");
      Link link = LinkFactory.createLink(i+"", tocVC, this);
      link.setCustomDisplayText(pageTitle);
      link.setUserObject(pageIdentifyer);
      // add to list of links and names
      tocVC.put(i+"", link);
      pageLinks.add(link);
    }
    tocVC.contextPut("pageIdentifyers", pageIdentifyers);
View Full Code Here

TOP

Related Classes of org.olat.core.gui.components.link.Link

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.