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

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


   * @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)
   */
  @Override
  protected void event(UserRequest ureq, Component source, Event event) {
    if (source instanceof Link) {
      Link link = (Link) source;
      // Get requested page from link
      String pageIdentifyer = (String) link.getUserObject();
      activate(ureq, pageIdentifyer);
    }
  }
View Full Code Here


    if (!registerEnabled) {
      filterIndex = "all";
    }   
    updateRegisterAndGlossaryItems();
   
    Link showAllLink = LinkFactory.createCustomLink(REGISTER_LINK + "all", REGISTER_LINK + "all", "glossary.list.showall", Link.LINK,
        glistVC, this);
    glistVC.contextPut("showAllLink", showAllLink);

    // add javascript and css file
    JSAndCSSComponent tmJs = new JSAndCSSComponent("glossaryJS", this.getClass(), null, "glossary.css", true);
View Full Code Here

    //build register, first found should be used later on
    char alpha;
    boolean firstIndexFound = false;
    for (alpha='A'; alpha <= 'Z'; alpha++){
      String indexChar = String.valueOf(alpha);
      Link indexLink = LinkFactory.createCustomLink(REGISTER_LINK + indexChar, REGISTER_LINK + indexChar, indexChar, Link.NONTRANSLATED,  glistVC, this);
      if (!addedKeys.contains(indexChar)){
        indexLink.setEnabled(false);
      } else if (!filterIndex.equals("all") && !firstIndexFound && !addedKeys.contains(filterIndex)){
        filterIndex = indexChar;
        firstIndexFound = true;
      }
      indexLinkList.add(indexLink);
View Full Code Here

      removeAsListenerAndDispose(cmc);
      cmc = new CloseableModalController(getWindowControl(), "close", glossEditCtrl.getInitialComponent());
      cmc.activate();
      listenTo(cmc);
    } else if (source instanceof Link) {
      Link button = (Link) source;
      String cmd = button.getCommand();
      if (button.getUserObject() instanceof GlossaryItem){
        GlossaryItem currentGlossaryItem = (GlossaryItem) button.getUserObject();
        if (cmd.startsWith(CMD_EDIT)) {
          removeAsListenerAndDispose(glossEditCtrl);
          glossEditCtrl = new GlossaryItemEditorController(ureq, getWindowControl(), glossaryFolder, glossaryItemList, currentGlossaryItem);
          listenTo(glossEditCtrl);
          removeAsListenerAndDispose(cmc);
          cmc = new CloseableModalController(getWindowControl(), "close", glossEditCtrl.getInitialComponent());
          cmc.activate();
          listenTo(cmc);
        } else if (button.getCommand().startsWith(CMD_DELETE)) {
          currentDeleteItem = currentGlossaryItem;
          if (deleteDialogCtr != null) {
            deleteDialogCtr.dispose();
          }
          deleteDialogCtr = activateYesNoDialog(ureq, null, translate("glossary.delete.dialog", currentGlossaryItem.getGlossTerm()),
              deleteDialogCtr);
        }
      }
      else if (button.getCommand().startsWith(REGISTER_LINK)) {
        filterIndex = cmd.substring(cmd.lastIndexOf(".") + 1);

        updateRegisterAndGlossaryItems();       
      }
    }
View Full Code Here

    Collections.sort(gIList);
   
    glistVC.contextPut("filterIndex", choosenFilterIndex);   
    if (!filterIndex.equals("all")) {
      // highlight filtered index   
      Link indexLink = (Link) glistVC.getComponent(REGISTER_LINK + choosenFilterIndex);
      if (indexLink!=null){
        indexLink.setCustomEnabledLinkCSS("o_glossary_register_active");
      }
    }
   
    for (GlossaryItem gi : gIList) {
      Link tmpEditButton = LinkFactory.createCustomLink(CMD_EDIT + linkNum, CMD_EDIT + linkNum, "cmd.edit", Link.BUTTON_SMALL, glistVC,
          this);
      tmpEditButton.setUserObject(gi);
      Link tmpDelButton = LinkFactory.createCustomLink(CMD_DELETE + linkNum, CMD_DELETE + linkNum, "cmd.delete", Link.BUTTON_SMALL,
          glistVC, this);
      tmpDelButton.setUserObject(gi);
      List<Link> tmpList = new ArrayList<Link>(2);
      tmpList.add(tmpEditButton);
      tmpList.add(tmpDelButton);

      if (keys.contains(gi.getGlossTerm()) && (bufDublicates.indexOf(gi.getGlossTerm()) == -1)) {
View Full Code Here

   
    refresh = LinkFactory.createCustomLink("refresh", "cmd.refresh", "", Link.NONTRANSLATED, groupchatVC, this);
    refresh.setCustomEnabledLinkCSS("b_small_icon o_instantmessaging_refresh_icon");
    refresh.setTitle(getTranslator().translate("im.refresh"));
   
    Link refreshList = LinkFactory.createButtonXSmall("im.refresh", summaryVC, this);
   
   
    //set polling time of peridocal updater
    jsc = new JSAndCSSComponent("intervall2", this.getClass(), null, null, false, null, InstantMessagingModule.getIDLE_POLLTIME());
    groupchatVC.put("checkfordirtycomponents", jsc);
View Full Code Here

        pbw.open(ureq);
        //
      }
     
      if (source instanceof Link) {
        Link link = (Link)source;
       
        //chat gets created by click on buddy list
        if(link.getCommand().equals(ACTION_CHAT)) {
          chatMgrCtrl.createChat(ureq, getWindowControl(), (String)link.getUserObject(), link.getOffsetX()-470, link.getOffsetY(), true, null);
        } else if (link.getCommand().equals(ACTION_MSG)) {//chats gets created by click on new message icon
          NewMessageIconInfo info = (NewMessageIconInfo)link.getUserObject();
          Link msgLink = info.getNewMessageLink();
          chatMgrCtrl.createChat(ureq, getWindowControl(), info.getJabberId(), msgLink.getOffsetX()-470, msgLink.getOffsetY(), true, info.getInitialMessages());
          showNewMessageHolder.remove(info.getJabberId());
          newMsgIcon.setDirty(true);
        }
      }
       
View Full Code Here

  /**
   * creates an new message icon link
   * @param jabberId
   */
  private Link createShowNewMessageLink(String jabberId, NewMessageIconInfo newMessageInfo) {
    Link link = LinkFactory.createCustomLink(extractJid(jabberId), ACTION_MSG, "", Link.NONTRANSLATED, newMsgIcon, this);
    link.registerForMousePositionEvent(true);
    link.setCustomEnabledLinkCSS("b_small_icon o_instantmessaging_new_msg_icon");
    link.setTooltip(getTranslator().translate("im.new.message", new String[]{jabberId}), false);
    link.setUserObject(newMessageInfo);
    return link;
  }
View Full Code Here

   
    colorVC = new VelocityContainer("calEdit", VELOCITY_ROOT + "/calColor.html", translator, this);
    cancelButton = LinkFactory.createButton("cancel", colorVC, this);
   
    colorLinks = new HashMap();
    Link greenLink = LinkFactory.createCustomLink("greenLink", "selc", "", Link.NONTRANSLATED, colorVC, this);
    if (currentCssSelection.equals("o_cal_green")){
      greenLink.setCustomEnabledLinkCSS(SELECTED_COLOR_CSS);
      greenLink.setCustomDisabledLinkCSS(SELECTED_COLOR_CSS);
    }
    Link blueLink = LinkFactory.createCustomLink("blueLink", "selc", "", Link.NONTRANSLATED, colorVC, this);
    if (currentCssSelection.equals("o_cal_blue")){
      blueLink.setCustomEnabledLinkCSS(SELECTED_COLOR_CSS);
      blueLink.setCustomDisabledLinkCSS(SELECTED_COLOR_CSS);
    }
    Link orangeLink = LinkFactory.createCustomLink("orangeLink", "selc", "", Link.NONTRANSLATED, colorVC, this);
    if (currentCssSelection.equals("o_cal_orange")){
      orangeLink.setCustomEnabledLinkCSS(SELECTED_COLOR_CSS);
      orangeLink.setCustomDisabledLinkCSS(SELECTED_COLOR_CSS);
    }
    Link yellowLink = LinkFactory.createCustomLink("yellowLink", "selc", "", Link.NONTRANSLATED, colorVC, this);
    if (currentCssSelection.equals("o_cal_yellow")){
      yellowLink.setCustomEnabledLinkCSS(SELECTED_COLOR_CSS);
      yellowLink.setCustomDisabledLinkCSS(SELECTED_COLOR_CSS);
    }
    Link redLink = LinkFactory.createCustomLink("redLink", "selc", "", Link.NONTRANSLATED, colorVC, this);
    if (currentCssSelection.equals("o_cal_red")){
      redLink.setCustomEnabledLinkCSS(SELECTED_COLOR_CSS);
      redLink.setCustomDisabledLinkCSS(SELECTED_COLOR_CSS);
    }
    Link greyLink = LinkFactory.createCustomLink("greyLink", "selc", "", Link.NONTRANSLATED, colorVC, this);
    if (currentCssSelection.equals("o_cal_grey")){
      greyLink.setCustomEnabledLinkCSS(SELECTED_COLOR_CSS);
      greyLink.setCustomDisabledLinkCSS(SELECTED_COLOR_CSS);
    }
   
    colorLinks.put(greenLink, "o_cal_green");
    colorLinks.put(blueLink, "o_cal_blue");
    colorLinks.put(orangeLink,"o_cal_orange");
View Full Code Here

  public void event(UserRequest ureq, Component source, Event event) {
    if (source == cancelButton) {
      fireEvent(ureq, Event.CANCELLED_EVENT);
    } else if (colorLinks.containsKey(source)){
      choosenColor = (String)colorLinks.get(source);
      Link colorLink = (Link) source;
      colorLink.setCustomEnabledLinkCSS(choosenColor);
      colorLink.setCustomDisabledLinkCSS(choosenColor);
      fireEvent(ureq, Event.DONE_EVENT);
    }
  }
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.