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

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


      }
      Message message = allMessages.get(i);
      messages.add(message);
      // add link to item
      // Add link to jump to course node
      Link nodeLink = LinkFactory.createLink("nodeLink_" + message.getKey(), peekviewVC, this);
      nodeLink.setCustomDisplayText(message.getTitle());
      nodeLink.setCustomEnabledLinkCSS("b_with_small_icon_left o_forum_message_icon o_gotoNode");
      nodeLink.setUserObject(Long.toString(message.getKey()));       
    }
    peekviewVC.contextPut("messages", messages);
    // Add link to show all items (go to node)
    Link allItemsLink = LinkFactory.createLink("peekview.allItemsLink", peekviewVC, this);
    allItemsLink.setCustomEnabledLinkCSS("b_float_right");
    // Add Formatter for proper date formatting
    peekviewVC.contextPut("formatter", Formatter.getInstance(getLocale()));
    //
    this.putInitialPanel(peekviewVC);
  }
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)
   */
  @Override
  protected void event(UserRequest ureq, Component source, Event event) {
    if (source instanceof Link) {
      Link nodeLink = (Link) source;
      String messageId = (String) nodeLink.getUserObject();
      if (messageId == null) {
        fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId));               
      } else {
        fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId + "/" + messageId));       
      }
View Full Code Here

        handleMenuCommands(ureq);
      }
    } else if (source == backButton){
      doUsersList(ureq, true); // for now init whole table models again
    } else if (source instanceof Link) {
      Link link = (Link) source;
      BusinessGroup group = (BusinessGroup) link.getUserObject();
      String groupKey = group.getKey().toString();
      if (link.getCommand().indexOf(CMD_USER_REMOVE_GROUP_PART) == 0) {
        doRemoveUserFromParticipatingGroup(ureq.getIdentity(), this.currentIdentity, groupKey);
        doUserDetails(ureq);
      } else if (link.getCommand().indexOf(CMD_USER_REMOVE_GROUP_OWN) == 0) {
        doRemoveUserFromOwnedGroup(ureq, groupKey);
        doUserDetails(ureq);
      }
    }
    /*
 
View Full Code Here

      Item item = allItems.get(i);
      if (item.isPublished()) {
        items.add(item);
        // add link to item
        // Add link to jump to course node
        Link nodeLink = LinkFactory.createLink("nodeLink_" + item.getGuid(), peekviewVC, this);
        nodeLink.setCustomDisplayText(item.getTitle());
        nodeLink.setCustomEnabledLinkCSS("b_with_small_icon_left o_feed_item_icon o_gotoNode");
        nodeLink.setUserObject(item.getGuid());
      }
    }
    peekviewVC.contextPut("items", items);
    // Add link to show all items (go to node)
    Link allItemsLink = LinkFactory.createLink("peekview.allItemsLink", peekviewVC, this);
    allItemsLink.setCustomEnabledLinkCSS("b_float_right");
    // Add Formatter for proper date formatting
    peekviewVC.contextPut("formatter", Formatter.getInstance(getLocale()));
    //
    this.putInitialPanel(peekviewVC);
  }
View Full Code Here

      Link[] ownerGroupLinks= new Link[ownerGroups.size()];
      int ownerNumber = 0;
     
      for (Iterator iter = ownerGroups.iterator(); iter.hasNext();) {
        BusinessGroup group = (BusinessGroup) iter.next();
        Link tmp = LinkFactory.createCustomLink("cmd.user.remove.group.own." + group.getKey(), "cmd.user.remove.group.own." + group.getKey(), "userdetails.remove", Link.BUTTON_SMALL, userDetailsVC, this);
        tmp.setUserObject(group);
        ownerGroupLinks[ownerNumber] = tmp;
        ownerNumber++;
      }
      userDetailsVC.contextPut("ownerGroupLinks", ownerGroupLinks);
      userDetailsVC.contextPut("noOwnerGroups", (ownerGroups.size() > 0 ? Boolean.FALSE : Boolean.TRUE));
      userDetailsVC.contextPut("showOwnerGroups", Boolean.TRUE);
    } else {
      userDetailsVC.contextPut("showOwnerGroups", Boolean.FALSE);
    }
    // 3. expose the participant groups of the identity
    List participantGroups = groupManager.findBusinessGroupsAttendedBy(bgContext.getGroupType(), this.currentIdentity, bgContext);
   
    Link[] participantGroupLinks= new Link[participantGroups.size()];
    int participantNumber = 0;
   
    for (Iterator iter = participantGroups.iterator(); iter.hasNext();) {
      BusinessGroup group = (BusinessGroup) iter.next();
      Link tmp = LinkFactory.createCustomLink("cmd.user.remove.group.part." + group.getKey(), "cmd.user.remove.group.part." + group.getKey(), "userdetails.remove", Link.BUTTON_SMALL, userDetailsVC, this);
      tmp.setUserObject(group);
      participantGroupLinks[participantNumber] = tmp;
      participantNumber++;
    }
    userDetailsVC.contextPut("noParticipantGroups", (participantGroups.size() > 0 ? Boolean.FALSE : Boolean.TRUE));
    userDetailsVC.contextPut("participantGroupLinks", participantGroupLinks);
View Full Code Here

   *      org.olat.core.gui.control.Event)
   */
  @Override
  protected void event(UserRequest ureq, Component source, Event event) {
    if (source instanceof Link) {
      Link nodeLink = (Link) source;
      String itemId = (String) nodeLink.getUserObject();
      if (itemId == null) {
        fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId));
      } else {
        fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId + "/" + itemId));
      }
View Full Code Here

      // add link to item
      // Add link to jump to course node
      if (leaf instanceof LocalFileImpl) {
        LocalFileImpl localFile = (LocalFileImpl) leaf;
        String relPath = localFile.getBasefile().getAbsolutePath().substring(rootFolder.getBasefile().getAbsolutePath().length());
        Link nodeLink = LinkFactory.createLink("nodeLink_" + (i+1), peekviewVC, this);
        nodeLink.setCustomDisplayText(leaf.getName());
        int lastDot = localFile.getName().lastIndexOf(".");
        String cssClass = "";
        if (lastDot > 0 ) {
          cssClass = "b_filetype_" + localFile.getName().substring(lastDot+1);
        }
        nodeLink.setCustomEnabledLinkCSS("b_with_small_icon_left b_filetype_file o_gotoNode " + cssClass);
        nodeLink.setUserObject(relPath);       
      } else {
        // hu? don't konw how to work with non-local impls
      }
    }
    peekviewVC.contextPut("leafs", leafs);
    // Add link to show all items (go to node)
    Link allItemsLink = LinkFactory.createLink("peekview.allItemsLink", peekviewVC, this);
    allItemsLink.setCustomEnabledLinkCSS("b_float_right");
    //
    this.putInitialPanel(peekviewVC);
  }
View Full Code Here

    List<CourseNode> childNodes = new ArrayList<CourseNode>();
    for (int i = 0; i < courseNode.getChildCount(); i++) {
      CourseNode child = (CourseNode) courseNode.getChildAt(i);
      childNodes.add(child);
      // Add link to jump to course node
      Link nodeLink = LinkFactory.createLink("nodeLink_" + child.getIdent(), genericPeekViewVC, this);
      nodeLink.setCustomDisplayText(child.getShortTitle());
      // Add css class for course node type
      String iconCSSClass = CourseNodeFactory.getInstance().getCourseNodeConfiguration(child.getType()).getIconCSSClass();
      nodeLink.setCustomEnabledLinkCSS("b_with_small_icon_left o_gotoNode " + iconCSSClass);
      nodeLink.setUserObject(child.getIdent());
    }
    // Add course node to get title etc
    genericPeekViewVC.contextPut("childNodes", childNodes);
    // Add css class for course node type
    CourseNodeFactory courseNodeFactory = CourseNodeFactory.getInstance();
View Full Code Here

   *      org.olat.core.gui.control.Event)
   */
  @Override
  protected void event(UserRequest ureq, Component source, Event event) {
    if (source instanceof Link) {
      Link nodeLink = (Link) source;
      // get node ID and fire activation event
      String nodeId = (String) nodeLink.getUserObject();
      fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId));     
    }
  }
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)
   */
  @Override
  protected void event(UserRequest ureq, Component source, Event event) {
    if (source instanceof Link) {
      Link nodeLink = (Link) source;
      String relPath = (String) nodeLink.getUserObject();
      if (relPath == null) {
        fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId));               
      } else {
        fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId + "/" + relPath));       
      }
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.