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

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


      List<PolymorphLink> polyList = ipe.getPolymorphLinks();
      if (polyList != null && polyList.size() > 0) {
        int i = 0;
        for (PolymorphLink polymorphLink : polyList) {
          if ((polymorphLink.hasConditions() && (polymorphLink.getResultIDForUser(ureq) != null)) || !(polymorphLink.hasConditions())) {
            Link polyLink = LinkFactory.createCustomLink("institutionPortlet.polymorphLink." + i, "none", polymorphLink.getLinkText(),
                Link.TOOLENTRY_DEFAULT + Link.NONTRANSLATED, portletVC, this);
            polyLink.setCustomEnabledLinkCSS(polymorphLink.getLinkType().equals("course") ? "o_institutionportlet_course" : "o_institutionportlet_coursefolder");
            polyLink.setCustomDisabledLinkCSS(polymorphLink.getLinkType().equals("course") ? "o_institutionportlet_course" : "o_institutionportlet_coursefolder");
            polyLinks.add(polyLink.getComponentName());
            mapLinks.put(polyLink, polymorphLink);
            i++;
          }
        }
        if (polyLinks.size() > 0) {
View Full Code Here


   *      org.olat.gui.components.Component, org.olat.gui.control.Event)
   */
  public void event(UserRequest ureq, Component source, Event event) {
    // nothing to catch
    if (source instanceof Link) {
      Link link = (Link) source;
      PolymorphLink polyLink = mapLinks.get(link);

      Long resultIDForUser = null;
      Long defaultID = null;
      String resultIDForUserS = polyLink.getResultIDForUser(ureq);
View Full Code Here

      StringBuilder projectLeaderString = new StringBuilder();
      projectLeaderString.append(first);
      projectLeaderString.append(" ");
      projectLeaderString.append(last);
      String linkName = "projectLeaderLink_" + i;
      Link projectLeaderLink = LinkFactory.createCustomLink(linkName, CMD_OPEN_PROJECT_LEADER_DETAIL, projectLeaderString.toString() , Link.NONTRANSLATED, myContent, this);
      projectLeaderLink.setUserObject(identity);
      projectLeaderLink.setTarget("_blank");
      projectLeaderLinkNameList.add(linkName);
      i++;
    }
    myContent.contextPut("projectLeaderLinkNameList", projectLeaderLinkNameList);
View Full Code Here

        this.showInfo("info.project.already.edit", project.getTitle());
      }
      return;
    } else if (event.getCommand().equals(CMD_OPEN_PROJECT_LEADER_DETAIL)){
      if (source instanceof Link) {
        Link projectLeaderLink = (Link)source;
        final Identity identity = (Identity)projectLeaderLink.getUserObject();
        ControllerCreator ctrlCreator = new ControllerCreator() {
          public Controller createController(UserRequest lureq, WindowControl lwControl) {
            return new UserInfoMainController(lureq, lwControl, identity);
          }
        };
View Full Code Here

    mainVC.put("ajaxtest", pFirstInvisible);
   
    buttonSmall = LinkFactory.createButtonSmall("button.small", mainVC, this);
    button = LinkFactory.createButton("button", mainVC, this);

    Link buttonDisabled = LinkFactory.createCustomLink("button.disabled", "button.disabled", "button.disabled", Link.BUTTON, mainVC, this);
    buttonDisabled.setEnabled(false);
   
    iconButton = LinkFactory.createCustomLink("sonne", "cmd.sonne", "", Link.NONTRANSLATED, mainVC, this);
    iconButton.setCustomEnabledLinkCSS("demoext_bild");
    iconButton.setCustomDisabledLinkCSS("demoext_bild");
   
View Full Code Here

  private Link link4;
 
  public GuiDemoTooltipsController(UserRequest ureq, WindowControl wControl) {
    super(ureq, wControl);
   
    Link button = LinkFactory.createButton("button", content, this);
    button.setTooltip("tooltip.content", false);
    Link linkT = LinkFactory.createLink("linkT", content, this);
    linkT.setTooltip("tooltip.content", true);
    Link link1 = LinkFactory.createLink("link1", content, this);
    link1.setTooltip("tooltip.content", false);
    Link link2 = LinkFactory.createLink("link2", content, this);
    link2.setTooltip("tooltip.content", true);
   
    //link with component content
   
    /**
     * works when passing a custom html id like id="blalala"
     * and then fetching the content from this id with getElementById("id").innerHTML
     * but with the component the component is not invisible and gets renderer somewhere
     * and somehow not
     */
   
    Link link3 = LinkFactory.createLink("link3", content, this);
    link3.setTooltip(tooltipContent, true);
    content.put("tooltipContent", tooltipContent);
    link4 = LinkFactory.createLink("link4", tooltipContent, this);
   
    //add source view control
    Controller sourceview = new SourceViewController(ureq, wControl, this.getClass(), content);
View Full Code Here

    // either sites is null or contains at least one SiteInstance.
    if (sites != null) {
      // create the links for the sites
      for (Iterator<SiteInstance> iterator = sites.iterator(); iterator.hasNext();) {
        SiteInstance si = iterator.next();
        Link link = LinkFactory.createCustomLink("t" + navLinkCounter, "t", "", Link.NONTRANSLATED, navVc, this);
        link.setCustomDisplayText(si.getNavElement().getTitle());
        link.setTitle(si.getNavElement().getDescription());
        link.setUserObject(si);
        Character accessKey = si.getNavElement().getAccessKey();
        if (accessKey != null && StringHelper.containsNonWhitespace(accessKey.toString())) {
          link.setAccessKey(accessKey.toString());         
        }
        navLinkCounter++;
      }
    }
View Full Code Here

}

  @Override
  protected void event(UserRequest ureq, Component source, Event event) {
    if (source instanceof Link) {
      Link link = (Link) source;
      String mC = link.getCommand().substring(0, 1);
      if (mC.equals("t")) { // activate normal tab
        SiteInstance s = (SiteInstance) link.getUserObject();
        activateSite(s, ureq, null);
      } else if (mC.equals("a")) { // activate dyntab
        DTab dt = (DTab) link.getUserObject();
        doActivateDTab((DTabImpl) dt);
      } else if (mC.equals("u")) { // undock dyntab
        // TODO:fj:c look at undock feature
      } else if (mC.equals("c")) { // close dyntab
        DTab dt = (DTab) link.getUserObject();
        requestCloseTab(dt);
      }
    } else if (source == getWindowControl().getWindowBackOffice().getWindow()) {
      //OLAT BACK-FORWARD Handling -> Prevent any back forward until 80% handles back-forward as defined
      //see adjustState
View Full Code Here

    // add to tabs list
    synchronized (dtabs) {
      // make dtabs and dtabsControllers access synchronized
      dtabs.add(dt);
      dtabsLinkNames.add(Integer.toString(dtabCreateCounter));
      Link link = LinkFactory.createCustomLink("a" + dtabCreateCounter, "a" + dtabCreateCounter, "", Link.NONTRANSLATED, navVc, this);
      link.setCustomDisplayText(((DTabImpl) dt).getNavElement().getTitle());
      link.setTitle(dt.getTitle());
      link.setUserObject(dt);
      // Set accessibility access key. Only 9 tabs can be created. All tabs
      // opened after that will have no access keys
      if (dtabCreateCounter < 9) {
        link.setAccessKey(dtabCreateCounter + 1 + "");
      }     
      // add close links
      Link calink = LinkFactory.createCustomLink("ca" + dtabCreateCounter, "ca" + dtabCreateCounter, "", Link.NONTRANSLATED, navVc, this);
      calink.setCustomEnabledLinkCSS("b_nav_tab_close");
      calink.setTitle(translate("close"));
      calink.setTooltip(translate("close"), false);
      calink.setUserObject(dt);
      Link cplink = LinkFactory.createCustomLink("cp" + dtabCreateCounter, "cp" + dtabCreateCounter, "", Link.NONTRANSLATED, navVc, this);
      cplink.setCustomEnabledLinkCSS("b_nav_tab_close");
      cplink.setTitle(translate("close"));
      cplink.setTooltip(translate("close"), false);
      cplink.setUserObject(dt);

      Controller dtabCtr = ((DTabImpl) dt).getController();
      dtabCtr.addControllerListener(this);
      // add to tabs controller lookup table for later event dispatching
      dtabsControllers.add(dtabCtr);
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.