Examples of StyledFlowPanel


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

 
  final StyledTextBox input = new StyledTextBox("bigtextbox", "", "");

  public SearchPanel() {

    StyledFlowPanel searchPanel = new StyledFlowPanel("addPanel");
    StyledHorizontalPanel hpanel = new StyledHorizontalPanel("middle");
    StyledButton show = new StyledButton("bigbutton", uiText.Search());

    hpanel.add(input);
    hpanel.add(show);

    searchPanel.add(hpanel);

    initWidget(searchPanel);

    searchPanel.setStyleName("topPanel");

    // handlers
    show.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
View Full Code Here

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

  public ContactItemView(RosterItem item) {
    rosterItem = item;

    // Place the check above the text box using a vertical panel.
    StyledFlowPanel flow = new StyledFlowPanel("contents");
    StyledFlowPanel statuswrapper = new StyledFlowPanel("wrapper");
    StyledFlowPanel statuswrapper2 = new StyledFlowPanel("wrapper2");
    final StyledFlowPanel infowrapper = new StyledFlowPanel("wrapper");
    final StyledFlowPanel followingwrapper = new StyledFlowPanel("wrapper");

    statuswrapper.add(statusIcon);
    statuswrapper2.add(author);
    statuswrapper2.add(statusLabel);
    statuswrapper.add(statuswrapper2);
    flow.add(statuswrapper);
    flow.add(followingwrapper);
    flow.add(infowrapper);

    hpanel.add(avatarwrapper);
    avatarwrapper.getElement().setAttribute(
        "style",
        "background-image: url('"
            + OswClient.getInstance().getPreference("theme_folder")
            + "assets/avatar-loader.gif');");
    hpanel.add(flow);
    hpanel.setCellWidth(avatarwrapper, "40px");

    add(hpanel);

    // add styles
    avatarImage.setStyleName("avatar");
    addStyleName("contact");

    // show jid on tooltip
    author.setTitle("View profile of " + rosterItem.getJid());

    // handlers
    author.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(rosterItem.getJid());
        profileWindow.show();
      }
    });

    this.addMouseOverHandler(this);
    this.addMouseOutHandler(this);

    // Fetch the avatar image
    OswService service = OswServiceFactory.getService();
    service.getProfile(rosterItem.getJid(), new RequestCallback<Profile>() {

      @Override
      public void onFailure() {
        // Do nothing
        avatarImage.setUrl(OswClient.getInstance().getPreference(
            "theme_folder")
            + "assets/default-avatar.png");
        avatarwrapper.getElement().setAttribute("style",
            "background-image: none;");
        avatarwrapper.add(avatarImage);
        author.setText(rosterItem.getJid());
      }

      @Override
      public void onSuccess(Profile result) {
        String url = result.getPhotoUri();
        if (url != null && url.length() > 0) {
          avatarImage.setUrl(url);
          avatarwrapper.getElement().setAttribute("style",
              "background-image: none;");
          avatarwrapper.add(avatarImage);
        } else {
          avatarImage.setUrl(OswClient.getInstance().getPreference(
              "theme_folder")
              + "assets/default-avatar-big.png");
          avatarwrapper.getElement().setAttribute("style",
              "background-image: none;");
          avatarwrapper.add(avatarImage);
        }

        String displayName = result.getFullName();
        if (displayName != null) {
          author.setText(displayName);
        } else {
          author.setText(rosterItem.getJid());
        }

      }

    });

    // Display following status
    service.getSubscriptions(service.getUserBareJID(),
        new RequestCallback<List<String>>() {

          @Override
          public void onFailure() {
            // Do nothing on fail
          }

          @Override
          public void onSuccess(List<String> result) {
            // Show following green arow and label
            if (result.contains(rosterItem.getJid())) {
              isFollowing = true;
              followingwrapper.add(followingIcon);
              followingwrapper.add(followingLabel);
              followingLabel.setStyleName("info");
            } else {
              isFollowing = false;
            }
          }
View Full Code Here

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

    // add the mouseOver handlers
    this.addMouseOverHandler(this);
    this.addMouseOutHandler(this);
   
    // Place the check above the text box using a vertical panel.
    StyledFlowPanel flow = new StyledFlowPanel("contents");
    StyledFlowPanel statuswrapper = new StyledFlowPanel("wrapper");
    StyledFlowPanel statuswrapper2 = new StyledFlowPanel("wrapper2");
    StyledFlowPanel infowrapper = new StyledFlowPanel("wrapper");
    StyledFlowPanel authorWrapper = new StyledFlowPanel("author-wrapper");
   
    author.setText(activity.getActor().getName());
    authorWrapper.add(author);
    final OswService service = OswServiceFactory.getService();
   
    boolean isComment=false;
        List<AtomReplyTo> recs=activity.getRecipients();
        Iterator<AtomReplyTo> itRecipients=recs.iterator();

        while (itRecipients.hasNext()){
                AtomReplyTo recipient=itRecipients.next();
                if (recipient.getHref().contains("?;node"))
                        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

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

    // addPhotoAttachment("http://www.iwatchstuff.com/2008/05/30/emily-the-strange-movie.jpg");
  }

  private void addPictureAttachment(ActivityObject object) {

    StyledFlowPanel attachment = new StyledFlowPanel("wrapper");
    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

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

  }

  private void addVideoAttachment(String url) {

    StyledFlowPanel attachment = new StyledFlowPanel("wrapper");
    StyledTooltipImage attachmentIcon = new StyledTooltipImage(OswClient
        .getInstance().getPreference("theme_folder")
        + "assets/i-attachment.png", "icon", "");
    FlowPanel attachmentFlow = new FlowPanel();
    HTML movie = new HTML();
    movie
        .setHTML("<embed src='http://vimeo.com/moogaloop.swf?clip_id=7659259&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1' type='application/x-shockwave-flash' allowfullscreen='true' allowscriptaccess='always' width='200' height='150'></embed>");

    attachment.add(attachmentIcon);
    attachment.add(attachmentFlow);
    attachmentFlow.add(movie);
    attachmentswrapper.add(attachment);

  }
View Full Code Here

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

  private void addLinkAttachment(ActivityObject object) {

    // check the links
    for (int i = 0; i < object.getLinks().size(); i++) {
      if (object.getLinks().get(i).getRel().equals("alternate")) {
        StyledFlowPanel attachment = new StyledFlowPanel("wrapper");
        StyledTooltipImage attachmentIcon = new StyledTooltipImage(
            OswClient.getInstance().getPreference("theme_folder")
                + "assets/i-attachment.png", "icon", "");
        FlowPanel attachmentFlow = new FlowPanel();

        attachment.add(attachmentIcon);
        attachment.add(attachmentFlow);

        Anchor link = new Anchor();
        link.setHref(object.getLinks().get(i).getHref());
        link.setText(object.getLinks().get(i).getHref());
        link.setTarget("_blank");
View Full Code Here

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

  private ListBox visibility;

  public PrivacyAttachmentPanel() {
    setHeader(uiText.Privacy());
    setVisible(false);
    StyledFlowPanel layout = new StyledFlowPanel("privacyAttachment");
    Label label = new Label(uiText.WhoCanSeeUpdate());
    StyledFlowPanel fix = new StyledFlowPanel("fix");

    // basic settings
    setIcon(OswClient.getInstance().getPreference("theme_folder")
        + "assets/i-private-r.png");
    setCloseTooltip(uiText.BackToDefault());
View Full Code Here

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

  }

  private void loadPrivacy() {

    // Compose privacy tab
    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(
        "More options for status updates");

    // Advanced settings status
    FlexTable advancedStatus = new FlexTable();
    PrivacySelector advancedstatus = new PrivacySelector("advancedstatus");
    addWidgetRow(advancedStatus, "See your status updates", advancedstatus);
    disclosureStatus.add(advancedStatus);

    // Simple privacy settings
    FlexTable simple = new FlexTable();

    simple.addStyleName("privacy");

    PrivacySelector status = new PrivacySelector("status");
    addWidgetRow(simple, "See your posts", status);

    PrivacySelector comment = new PrivacySelector("status");
    addWidgetRow(simple, "Comment on your posts", comment);

    PrivacySelector profile = new PrivacySelector("profile");
    addWidgetRow(simple, "See your profile information", profile);

    PrivacySelector contact = new PrivacySelector("contact");
    addWidgetRow(simple, "See your contact information", contact);

    PrivacySelector following = new PrivacySelector("following");
    addWidgetRow(simple, "See people you're following", following);

    PrivacySelector friends = new PrivacySelector("friends");
    addWidgetRow(simple, "See your friends", friends);

    sectionSimple.add(simple);
    privacy.add(sectionSimple);

  }
View Full Code Here

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

  }

  private void composeProfile() {

    // compose profile tab
    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
    generalEdit = new FlexTable();
    generalEdit.addStyleName("edit");
   
    final AvatarUploadField avatarF = new AvatarUploadField();
    addWidgetRow(generalEdit, uiText.Avatar(), avatarF);
   
    avatarD.setMaxSize(80, 80);
   
    final StyledTextBox displaynameF = new StyledTextBox("", "", "250px");
    addWidgetRow(generalEdit, uiText.DisplayName(), displaynameF);

    final NameEditField nameF = new NameEditField();
    addWidgetRow(generalEdit, uiText.FullName(), nameF);

    final DateField birthdayF = new DateField();
    addWidgetRow(generalEdit, uiText.Birthday(), birthdayF);

    addWidgetRow(generalEdit, uiText.Gender(), genderF);

    final StyledTextBox bioF = new StyledTextBox("", "", "250px");
    addWidgetRow(generalEdit, uiText.Bio(), bioF);
   
    final StyledTextBox emailF = new StyledTextBox("", "", "250px");
    addWidgetRow(generalEdit, uiText.Email(), emailF);

    final StyledTextBox telF = new StyledTextBox("", "", "250px");
    addWidgetRow(generalEdit, uiText.Telephone(), telF);
   
    final StyledTextBox urlF = new StyledTextBox("", "", "250px");
    addWidgetRow(generalEdit, uiText.Website(), urlF);

    // Text only version of general information
    general = new FlexTable();
    sectionGeneral.add(general);
   
    // make sure the model is not empty when there is no profile available
    if (model != null) {
      if (model.hasField(PhotoField.NAME)) {
        String avatar = model.getPhotoUri();
        // the field
        avatarF.setAvatar(avatar);
        // for display
        avatarD.setUrl(avatar);
        if (avatar != null && avatar.length() > 0)
          addWidgetRow(general, uiText.Avatar(), avatarD);
      }

      if (model.hasField(FullNameField.NAME)) {
        String displayname = model.getFullName();
        displaynameF.setText(displayname);
        if (displayname != null && displayname.length() > 0)
          addHTMLLabelRow(general, uiText.DisplayName(), displayname);
      }
     
      if (model.hasField(NameField.NAME)) {
        // the full string
        String name = model.getName();
       
        // get the separate pieces for editing
        DefaultNameField nameField = new DefaultNameField();
        nameField = (DefaultNameField) model.getField(NameField.NAME);
        nameF.setName(nameField.getGiven(), nameField.getSurname());
       
        if (name != null && name.length() > 0)
          addHTMLLabelRow(general, 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);
          birthdayF.setDate(birthday);
          if (birthday != null ) addHTMLLabelRow(general, uiText.Birthday(), bday);
       
      }

      if (model.hasField(GenderField.NAME)) {
        GenderField.Type gender = model.getGender();
       
        // get the gender value
        DefaultGenderField genderField = new DefaultGenderField();
        genderField = (DefaultGenderField) model.getField(GenderField.NAME);
       
        genderF.setGender(gender);
        if (gender != null)
          addHTMLLabelRow(general, uiText.Gender(), genderF.getGenderText());
      }

      if (model.hasField(NoteField.NAME)) {
        String bio = model.getNote();
        bioF.setText(bio);
        if (bio != null && bio.length() > 0)
          addHTMLLabelRow(general, uiText.Bio(), model.getField("note")
              .getValue());
      }
     
      if (model.hasField(EmailField.NAME)) {
        String email = model.getEmail();
        emailF.setText(email);
        if (email != null && email.length() > 0)
          addHTMLLabelRow(general, uiText.Email(), email);
      }
     
      if (model.hasField(TelField.NAME)) {
        String tel = model.getTel();
        telF.setText(tel);
        if (tel != null && tel.length() > 0)
          addHTMLLabelRow(general, uiText.Telephone(), tel);
      }
     
      if (model.hasField(URLField.NAME)) {
        String url = model.getUrl();
        urlF.setText(url);
        if (url != null && url.length() > 0)
          addHTMLLabelRow(general, uiText.Website(), url);
      }
     
      // if there are no fields
      if (model.getFields().size() == 0) {
        showEditProfile();
      }
     
    }

    StyledFlowPanel confirmG = new StyledFlowPanel("confirm");
    Button buttonSaveG = new Button(uiText.Save());
    Button buttonCancelG = new Button(uiText.Cancel());
    confirmG.add(buttonSaveG);
    confirmG.add(buttonCancelG);

    addWidgetRow(generalEdit, "", confirmG);

    // handlers
    buttonEditG.addClickHandler(new ClickHandler() {
View Full Code Here

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

  }
 
  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();
    for (String locale : OSWLocales.keySet()) {
      languageSelector.addItem(OSWLocales.get(locale).toString(), locale);
    }
   
    // get the locale if stored in the browser
    String localeStored = "";
    if (Storage.isSupported()) {
      Storage localStorage = Storage.getLocalStorage();
      localeStored = localStorage.getItem("locale");
    }
   
    // select the right locale in the list if one is predefined
    if (localeStored != null) {
      for (int i = 0; i < languageSelector.getItemCount(); i++) {
        if ( localeStored.equals(languageSelector.getValue(i))) {
          languageSelector.setSelectedIndex(i);
        }
      }
    // otherwise provide the default
    else {
      for (int i = 0; i < languageSelector.getItemCount(); i++) {
        if (languageSelector.getValue(i).equals("default")) {
          languageSelector.setSelectedIndex(i);
        }
      }
    }
   
    sectionChangeLocale.add(titleCL);
    sectionChangeLocale.add(instructionCL);
    sectionChangeLocale.add(changeLocale);
    account.add(sectionChangeLocale);
   
    addWidgetRow(changeLocale, uiText.Language(), languageSelector);
   
    languageSelector.addChangeHandler(new ChangeHandler() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.