Package org.onesocialweb.gwt.client.ui.widget

Examples of org.onesocialweb.gwt.client.ui.widget.StyledLabel


    StyledFlowPanel sectionSimple = new StyledFlowPanel("section");

    Button buttonAdvanced = new Button("Advanced");
    buttonAdvanced.addStyleName("sectionedit");

    StyledLabel titleUN = new StyledLabel("grouplabel", "Privacy settings");
    StyledLabel instructionUN = new StyledLabel("instruction",
        "Choose the defaults for who can see and do what.");
    sectionSimple.add(buttonAdvanced);
    sectionSimple.add(titleUN);
    sectionSimple.add(instructionUN);
    DisclosurePanel disclosureStatus = new DisclosurePanel(
View Full Code Here


    sectionGeneral = new StyledFlowPanel("section");
    buttonEditG = new TooltipPushButton(new Image(OswClient.getInstance()
        .getPreference("theme_folder")
        + "assets/i-edit.png"), uiText.EditProfile());
    buttonEditG.addStyleName("sectionedit");
    StyledLabel titleG = new StyledLabel("grouplabel", uiText.General());
    sectionGeneral.add(buttonEditG);
    sectionGeneral.add(titleG);
    this.profile.add(sectionGeneral);

    // Editor version of general information
View Full Code Here

  private void loadAccount() {

    // username
    StyledFlowPanel sectionUsername = new StyledFlowPanel("section");
    FlexTable username = new FlexTable();
    StyledLabel titleUN = new StyledLabel("grouplabel", uiText.YourIdentity());
    StyledLabel instructionUN = new StyledLabel("instruction",
        uiText.IdentityFixed());
    sectionUsername.add(titleUN);
    sectionUsername.add(instructionUN);
    sectionUsername.add(username);
    account.add(sectionUsername);

    addHTMLLabelRow(username, uiText.UserName(), OswServiceFactory.getService()
        .getUserBareJID());

    // change language
    StyledFlowPanel sectionChangeLocale = new StyledFlowPanel("section");
    FlexTable changeLocale = new FlexTable();
    StyledLabel titleCL = new StyledLabel("grouplabel", uiText.ChangeLocale());
    StyledLabel instructionCL = new StyledLabel("instruction", uiText.SetLanguage());
   
    final ListBox languageSelector = new ListBox();
   
    // add the values to the list
    HashMap<String, String> OSWLocales = OswClient.getInstance().getOSWLocales();
View Full Code Here

                        isComment=true;
        }


        if ((!isComment) && (activity.hasRecipients())) {
      authorWrapper.add(new StyledLabel("separator", " " + uiText.To() + " "));
      Iterator<AtomReplyTo> recipients = activity.getRecipients()
          .iterator();
      while (recipients.hasNext()) {
        final AtomReplyTo recipient = recipients.next();
        final String recipientJID = recipient.getHref();
        final StyledLabel label = new StyledLabel("link", recipientJID);
        label.setTitle(uiText.ViewProfileOf() + recipientJID);

        service.getProfile(recipientJID,
            new RequestCallback<Profile>() {

              @Override
              public void onFailure() {
                // do nothing
              }

              @Override
              public void onSuccess(Profile result) {
                // show display name
                final String fullName = result.getFullName();
                if (fullName != null && fullName.length() > 0) {
                  label.setText(fullName);
                }

              }

            });

        label.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            // get the app instance from the session manager
            AbstractApplication app = OswClient.getInstance()
                .getCurrentApplication();
            ProfileWindow profileWindow = (ProfileWindow) app
                .addWindow(ProfileWindow.class.toString(), 1);
            profileWindow.setJID(recipientJID);
            profileWindow.show();
          }
        });
        authorWrapper.add(label);

        if (recipients.hasNext()) {
          authorWrapper.add(new StyledLabel("separator", ", "));
        }
      }
    }

    statuswrapper.add(statusIcon);
View Full Code Here

    StyledTooltipImage attachmentIcon = new StyledTooltipImage(OswClient
        .getInstance().getPreference("theme_folder")
        + "assets/i-attachment.png", "icon", "");
    StyledFlowPanel attachmentFlow = new StyledFlowPanel("image");
    StyledFlowPanel wrapper = new StyledFlowPanel("metadata");
    StyledLabel title = new StyledLabel("title", "");
    StyledLabel description = new StyledLabel("description", "");
    attachment.add(attachmentIcon);
    attachment.add(attachmentFlow);
    attachment.add(wrapper);
    wrapper.add(title);
    attachmentswrapper.add(attachment);

    // show the link elements
    for (int i = 0; i < object.getLinks().size(); i++) {
      // get the url to the picture
      if (object.hasLinks() && object.getLinks().get(0).hasRel()
          && object.getLinks().get(i).getRel().equals("alternate")) {

        // get the link to the image
        final StyledTooltipImage image = new StyledTooltipImage(object
            .getLinks().get(i).getHref(), "attachment",
            uiText.ShowPreview());

        image.addStyleName("link");

        // if the activity has a title
        if (activity.hasTitle() && activity.getTitle().length() > 0) {

          // and the link has a title as well
          if (object.getLinks().get(i).hasTitle()
              && object.getLinks().get(i).getTitle().length() > 0) {

            // check if they are the same and skip it on the link if
            // so
            // TODO this needs to be refactored to the
            // object.getTitle()
            if (!activity.getTitle().trim().equals(
                object.getLinks().get(i).getTitle().trim())) {
              title.setText(object.getLinks().get(i).getTitle());
            }

          }

          // otherwise we can show it
          // TODO this needs to be refactored to the object.getTitle()
        } else {
          title.setText(object.getLinks().get(i).getTitle());
        }

        attachmentFlow.add(image);

        image.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            PicturePreviewDialog.getInstance().showDialog(
                image.getUrl(), uiText.ImagePreview());
          }
        });
      }
    }

    // show description
    if (object.hasContents()
        && object.getContents().get(0).getValue() != null
        && object.getContents().get(0).getValue().length() > 0) {
      description.setText(object.getContents().get(0).getValue());
      wrapper.add(description);
    }

  }
View Full Code Here

        + "assets/i-private-r.png");
    setCloseTooltip(uiText.BackToDefault());

    // construct
    visibility = new ListBox();
    StyledLabel show = new StyledLabel("label", uiText.With());
    final Roster roster = OswServiceFactory.getService().getRoster();
    roster.registerEventHandler(new Observer<RosterEvent>() {

      @Override
      public void handleEvent(RosterEvent event) {
View Full Code Here

    }
    summaryWrapper.add(avatar);

    // Display name
    StyledFlowPanel displaynamewrapper = new StyledFlowPanel("wrapper");
    StyledLabel displayname = new StyledLabel("displayname", jid);
    displayname.setTitle(jid);
    String fullName;
    if (model != null) {
      fullName = model.getFullName();
      if (fullName != null && fullName.length() > 0) {
        displayname.setText(fullName);
      } else {
        displayname.setText(jid);
      }
    }

    StyledLabel you = new StyledLabel("you", uiText.You());

    displaynamewrapper.add(displayname);
    if (isSignedinUser)
      displaynamewrapper.add(you);
    summary.add(displaynamewrapper);

    // Get tags and following status
    String tags = "";
    OswService service = OswServiceFactory.getService();
    rosterItem = service.getRoster().getItem(jid);
    // make sure there is a rosterItem e.g. in the case it's you
    if (rosterItem != null) {
      for (int i = 0; i < rosterItem.getGroups().size(); i++) {
        String tag = rosterItem.getGroups().get(i);
        if (i < (rosterItem.getGroups().size() - 1)) {
          tags += "" + tag + ", ";
        } else {
          tags += "" + tag + "";
        }
      }
    }

    // Add the generic following icon
    following.setVisible(false);
    summary.add(following);

    // Are we following this person ?
    OswServiceFactory.getService().getSubscriptions(
        OswServiceFactory.getService().getUserBareJID(),
        new RequestCallback<List<String>>() {

          @Override
          public void onFailure() {
            // TODO Auto-generated method stub

          }

          @Override
          public void onSuccess(List<String> result) {
            // Show following green arow and label
            if (result.contains(jid)) {
              isFollowing = true;
              following.setVisible(true);
            } else {
              isFollowing = false;
              following.setVisible(false);
            }

            // Add the follow/unfollow button
            addButtons();
          }

        });

    buttonPanel.addStyleName("panel");

    // Bio
    if (model != null) {
      final String bio = model.getNote();
      if (model.getNote() != null) {
        if (model != null && bio != null && bio.length() > 0) {
          StyledLabel aboutme = new StyledLabel("aboutme",
              "<span>" + uiText.Bio() + "</span> " + HtmlHelper.encode(bio));
          summary.add(aboutme);
        }
      }
    }
View Full Code Here

    // setup layout

    // profile section
    StyledFlowPanel sectionProfile = new StyledFlowPanel("section");
    StyledLabel profileLabel = new StyledLabel("grouplabel", uiText.Profile());
    StyledLabel profileInstruction = new StyledLabel("instruction", "");
    details.add(sectionProfile);
    sectionProfile.add(profileLabel);
    sectionProfile.add(profileInstruction);
    sectionProfile.add(profile);

    // followers section
    StyledFlowPanel sectionFollowers = new StyledFlowPanel("section");
    StyledLabel followersLabel = new StyledLabel("grouplabel", uiText.Followers());
    final StyledLabel followersInstruction = new StyledLabel("instruction",
        "");
    details.add(sectionFollowers);
    sectionFollowers.add(followersLabel);
    sectionFollowers.add(followersInstruction);
    sectionFollowers.add(followersPanel);

    // following section
    StyledFlowPanel sectionFollowing = new StyledFlowPanel("section");
    StyledLabel followingLabel = new StyledLabel("grouplabel", uiText.FollowingPeople());
    final StyledLabel followingInstruction = new StyledLabel("instruction",
        "");
    details.add(sectionFollowing);
    sectionFollowing.add(followingLabel);
    sectionFollowing.add(followingInstruction);
    sectionFollowing.add(followingPanel);

    profileInstruction.setVisible(false);

    if (model != null && model.getFields().size() > 0) {
     
      // show the profile
      sectionProfile.setVisible(true);
     
      if (model.hasField(FullNameField.NAME)) {
        String displayname = model.getFullName();
        if (displayname != null && displayname.length() > 0)
          addHTMLLabelRow(profile, uiText.DisplayName(), displayname);
      }
     
      if (model.hasField(NameField.NAME)) {
        String name = model.getName();
        if (name != null && name.length() > 0)
          addHTMLLabelRow(profile, uiText.FullName(), name);
      }

      if (model.hasField(BirthdayField.NAME)) {
        Date birthday = model.getBirthday();
        if (birthday != null) {
          DateTimeFormat dtf = DateTimeFormat.getFormat("d MMMM yyyy");
          String bday = dtf.format(birthday);
          addHTMLLabelRow(profile, uiText.Birthday(), bday);
       
      }

      if (model.hasField(GenderField.NAME)) {
       
        String value = new String("");
       
        GenderField.Type gender = model.getGender();
       
        if (gender.equals(GenderField.Type.MALE)) {
          value = uiText.Male();
        } else if (gender.equals(GenderField.Type.FEMALE)) {
          value = uiText.Female();
        } else if (gender.equals(GenderField.Type.NOTKNOWN)) {
          value = uiText.NotKnown();
        } else if (gender.equals(GenderField.Type.NOTAPPLICABLE)) {
          value = uiText.NotApplicable();
        }
        if (gender != null)
          addHTMLLabelRow(profile, uiText.Gender(), value);
       
      }

      if (model.hasField(NoteField.NAME)) {
        String bio = model.getNote();
        if (bio != null && bio.length() > 0)
          addHTMLLabelRow(profile, uiText.Bio(), bio);
      }
     
      if (model.hasField(EmailField.NAME)) {
        String email = model.getEmail();
        if (email != null && email.length() > 0)
          addHTMLLabelRow(profile, uiText.Email(), email);
      }
     
      if (model.hasField(TelField.NAME)) {
        String tel = model.getTel();
        if (tel != null && tel.length() > 0)
          addHTMLLabelRow(profile, uiText.Telephone(), tel);
      }
     
      if (model.hasField(URLField.NAME)) {
        String url = model.getUrl();
        if (url != null && url.length() > 0)
          addHTMLLabelRow(profile, uiText.Website(), url);
      }

    } else {
      // if there are no results

      // hide the profile table
      profile.setVisible(false);

      // show message
      String msg = uiText.FailedToGetProfile();
      profileInstruction.setText(msg);
      profileInstruction.setVisible(true);

    }

    // get the followers of this person
    final DefaultTaskInfo task1 = new DefaultTaskInfo(
        uiText.FetchingFollowers(), false);
    TaskMonitor.getInstance().addTask(task1);

    OswServiceFactory.getService().getSubscribers(jid,
        new RequestCallback<List<String>>() {

          @Override
          public void onFailure() {
            // TODO Auto-generated method stub
            task1.complete("", Status.failure);
          }

          @Override
          public void onSuccess(List<String> result) {

            task1.complete("", Status.succes);

            // see if there are any results
            if (result.size() > 0) {
              // sort the list alphabetically
              Collections.sort(result, new Comparator<String>() {

                @Override
                public int compare(String o1, String o2) {
                  return o1.compareToIgnoreCase(o2);
                }

              });

              // add all the jids to the list
              for (final String jid : result) {

                Label follower = new Label(jid);
                follower.addStyleName("link");
                follower.setTitle(uiText.ViewProfileOf() + " " + jid);
                followersPanel.add(follower);
                follower.addClickHandler(new ClickHandler() {

                  @Override
                  public void onClick(ClickEvent event) {

                    // get the app instance from the session
                    // manager
                    AbstractApplication app = OswClient
                        .getInstance()
                        .getCurrentApplication();
                    ProfileWindow profileWindow = (ProfileWindow) app
                        .addWindow(ProfileWindow.class
                            .toString(), 1);
                    profileWindow.setJID(jid);
                    profileWindow.show();
                  }

                });
              }
            } else {
              // give a message if there are no followers
              followersInstruction
                  .setText(uiText.NoFollowers());
            }

          }

        });

    // get the people who are being followed by this person
    final DefaultTaskInfo task2 = new DefaultTaskInfo(
        uiText.FetchingFollowing(), false);
    TaskMonitor.getInstance().addTask(task2);

    OswServiceFactory.getService().getSubscriptions(jid,
        new RequestCallback<List<String>>() {

          @Override
          public void onFailure() {
            // TODO Auto-generated method stub
            task2.complete("", Status.failure);
          }

          @Override
          public void onSuccess(List<String> result) {

            task2.complete("", Status.succes);

            // see if there are any results
            if (result.size() > 0) {
              // sort the list alphabetically
              Collections.sort(result, new Comparator<String>() {

                @Override
                public int compare(String o1, String o2) {
                  return o1.compareToIgnoreCase(o2);
                }

              });

              // add all the jids to the list
              for (final String jid : result) {

                Label following = new Label(jid);
                following.addStyleName("link");
                following.setTitle(uiText.ViewProfileOf() + " " + jid);
                followingPanel.add(following);
                following.addClickHandler(new ClickHandler() {

                  @Override
                  public void onClick(ClickEvent event) {

                    // get the app instance from the session
                    // manager
                    AbstractApplication app = OswClient
                        .getInstance()
                        .getCurrentApplication();
                    ProfileWindow profileWindow = (ProfileWindow) app
                        .addWindow(ProfileWindow.class
                            .toString(), 1);
                    profileWindow.setJID(jid);
                    profileWindow.show();
                  }

                });
              }
            } else {
              // give a message if no one is followed
              followingInstruction
                  .setText(uiText.NoFollowing());
            }

          }
View Full Code Here

     * manage.add(manageFollowing);
     */

    // Add the lists
    StyledFlowPanel sectionLists = new StyledFlowPanel("section");
    StyledLabel tagsLabel = new StyledLabel("grouplabel", uiText.YourLists());
    StyledLabel tagsInstruction = new StyledLabel("instruction",
        uiText.AddOrRemovePerson());
    // EditableTagsList manageTags = new EditableTagsList(jid);

    OswService service = OswServiceFactory.getService();
    RosterItem rosterItem = service.getRoster().getItem(jid);
View Full Code Here

TOP

Related Classes of org.onesocialweb.gwt.client.ui.widget.StyledLabel

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.