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

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


  public GuiDemoFlexiFormMainController(UserRequest ureq, WindowControl wControl) {
    super(ureq, wControl);
    mainVC = createVelocityContainer("flexiformdemos");

    for (String linkName : demolinknames) {
      Link tmpLink = LinkFactory.createLink(linkName, mainVC, this);
      tmpLink.setUserObject(linkName);
    }

    mainVC.contextPut("demolinknames", demolinknames);

    // all democontroller content goes in this panel
View Full Code Here


   */
  @Override
  public void event(UserRequest ureq, Component source, Event event) {
    //there are only events of type link from the demos navigation
    if (source instanceof Link) {
      Link sl = (Link) source;
      //userobject tells which demo to activate
      String uob = (String) sl.getUserObject();
      if (uob != null) {
        ControllerCreator cc = demos.get(uob);
        //update source
        VelocityContainer sourceVC = createVelocityContainer(uob);
        ShrinkController sc = new ShrinkController(ureq, getWindowControl(), false, sourceVC, "toggle source");
View Full Code Here

        doAttachmentDelivery(ureq, cmd, messageMap);
      }
    } else if (source instanceof Link) {
      // all other commands have the message value map id coded into the
      // the command name. get message from this id
      Link link = (Link) source;
      String command = link.getCommand();
      Map<String, Object> messageMap = getMessageMapFromCommand(ureq.getIdentity(), command);
      Long messageId = (Long) messageMap.get("id");
     
      Message updatedMessage = fm.findMessage(messageId);
      if (updatedMessage!=null) {
View Full Code Here

    return new ArrayList<String>();
  }

  private List<String> createLinkList(Iterator iter, String groupname) {
    List<String> entries = new ArrayList<String>();
    Link link;
    for (Iterator i = iter; i.hasNext();) {
      RosterEntry entry = (RosterEntry) i.next();
      String entryPresence = getUserPresence(entry.getUser());
      if (getShowOfflineBuddies() || entryPresence != "offline") {
        if (groupname != null) {
          link = LinkFactory.createCustomLink(entry.getUser()+createAppendixFromGroupName(groupname), "cmd.chat", "", Link.NONTRANSLATED, vc, controller);
        } else {
          link = LinkFactory.createCustomLink(entry.getUser(), "cmd.chat", "", Link.NONTRANSLATED, vc, controller);
        }
        Identity ident = ManagerFactory.getManager().findIdentityByName(entry.getName());
        if (ident != null) {
          link.setCustomDisplayText(ident.getUser().getProperty(UserConstants.FIRSTNAME, null)+" "+ident.getUser().getProperty(UserConstants.LASTNAME, null)+" ("+ident.getName()+")");
        } else {
          link.setCustomDisplayText(entry.getName());
        }
        link.setCustomEnabledLinkCSS("o_instantmessaging_" + entryPresence +"_icon");
        link.setUserObject(entry.getUser());
        StringBuilder sb = new StringBuilder();
        if (!imc.isChatDisabled()) {
          sb.append(translator.translate("im.status")).append(" ");
          sb.append(translator.translate("presence."+entryPresence));
          sb.append("<br />");
          if(ident != null){
            //TODO:gs:a how to get the roster entries presence msg? new clienthelper will work but creates a im client!
            sb.append(translator.translate("im.status.msg")).append(" ").append("");
          }
          sb.append("<br /><br />");
          sb.append(translator.translate("im.start.chat"));
        } else {
          sb.append(translator.translate("im.chat.disabled"));
        }
        link.setTooltip(sb.toString(), false);
        link.registerForMousePositionEvent(true);
        entries.add(entry.getUser());
      }
    }
    return entries;
View Full Code Here

  /**
   * @param item
   */
  private void createItemLink(Item item) {
    String guid = item.getGuid();
    Link itemLink = LinkFactory.createCustomLink("link.to." + guid, "link.to." + guid, "feed.link.more", Link.LINK, vcItems, this);
    itemLink.setCustomEnabledLinkCSS("b_link_forward");
    itemLink.setUserObject(item);
    itemLinks.add(itemLink);
  }
View Full Code Here

  /**
   * @param item
   */
  private void createButtonsForItem(Item item) {
    String guid = item.getGuid();
    Link editButton = LinkFactory.createCustomLink("feed.edit.item." + guid, "feed.edit.item." + guid, "feed.edit.item",
        Link.BUTTON_XSMALL, vcItems, this);
    Link deleteButton = LinkFactory.createCustomLink("delete." + guid, "delete." + guid, "delete", Link.BUTTON_XSMALL, vcItems, this);
    editButton.setUserObject(item);
    deleteButton.setUserObject(item);
    editButtons.add(editButton);
    deleteButtons.add(deleteButton);
  }
View Full Code Here

      vcItems.setDirty(true);

    } else if (source instanceof Link) {
      // if it's a link try to get attached identity and assume that user wants
      // to see the users home page
      Link userLink = (Link) source;
      Object userObject = userLink.getUserObject();
      if (userObject instanceof Identity) {
        Identity chosenIdentity = (Identity) userObject;
        HomePageConfigManager hpcm = HomePageConfigManagerImpl.getInstance();
        OLATResourceable ores = hpcm.loadConfigFor(chosenIdentity.getName());
        DTabs dts = (DTabs) Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
View Full Code Here

   * @param ureq
   * @param item
   */
  private ItemController displayItemController(UserRequest ureq, Item item) {
    removeAsListenerAndDispose(itemCtr);
    Link editButton = getButtonByUserObject(item, editButtons);
    Link deleteButton = getButtonByUserObject(item, deleteButtons);
    FeedManager feedManager = FeedManager.getInstance();
    Feed feed = feedManager.readFeed(feedResource);
    itemCtr = new ItemController(ureq, getWindowControl(), item, feed, helper, uiFactory, callback, editButton, deleteButton);
    listenTo(itemCtr);
    mainPanel.setContent(itemCtr.getInitialComponent());
View Full Code Here

   * @param buttons
   * @return The Link in buttons which has the item attached as user object or
   *         null
   */
  private Link getButtonByUserObject(Item item, List<Link> buttons) {
    Link result = null;
    if (buttons != null && item != null) {
      for (Link button : buttons) {
        if (button.getUserObject() == item) {
          result = button;
          break;
View Full Code Here

    checkForumChangedEventReceived();
   
    if (source instanceof Link) {
      // all other commands have the message value map id coded into the
      // the command name. get message from this id
      Link link = (Link) source;
      String command = link.getCommand();
      Map<String, Object> messageMap = getMessageMapFromCommand(ureq.getIdentity(), command);
      Long messageId = (Long) messageMap.get("id");
     
      Message selectedMessage = ForumManager.getInstance().findMessage(messageId);
      if (selectedMessage != null) {
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.