Package org.onesocialweb.gwt.client.ui.application

Examples of org.onesocialweb.gwt.client.ui.application.AbstractApplication


            }

            @Override
            public void onSuccess(Profile result) {
              // get the app instance from the session manager
              AbstractApplication app = OswClient.getInstance()
                  .getCurrentApplication();
              ProfileWindow profileWindow = (ProfileWindow) app
                  .addWindow(ProfileWindow.class.toString(),
                      1);
              profileWindow.setJID(input.getText());
              profileWindow.show();
            }
View Full Code Here


    // 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();
      }
    });
View Full Code Here

            });

        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);
    statuswrapper2.add(authorWrapper);
    statuswrapper2.add(statusLabel);
    statuswrapper.add(statuswrapper2);
    infowrapper.add(infoIcon);
    infowrapper.add(infoLabel);
    flow.add(statuswrapper);
    flow.add(attachmentswrapper);
    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");

    // display who can see your own items
    List<String> visibility = new ArrayList<String>();

    if (activity.getActor().getUri().equals(
        OswServiceFactory.getService().getUserBareJID())) {
     
      // show the acl rule
      for (AclRule rule : activity.getAclRules()) {
        for (AclAction action : rule.getActions(AclAction.ACTION_VIEW,
            AclAction.PERMISSION_GRANT)) {
          for (AclSubject subject : rule.getSubjects()) {
            if (subject.getType().equals(AclSubject.EVERYONE)) {
              visibility.add(uiText.Everyone());
            } else if (subject.getType().equals(AclSubject.GROUP)) {
              visibility.add(subject.getName());
            } else if (subject.getType().equals(AclSubject.PERSON)) {
              visibility.add(subject.getName());
            }
          }
        }
      }
     
      // and add a special style to show this is your own item
      addStyleName("isOwner");
    }

    statusLabel.setText(" - " + activity.getTitle());
    String info = "";
    info += getFormattedDate(activity.getPublished());
    if (!visibility.isEmpty())
      info += " - " + uiText.VisibleTo() + " " + FormatHelper.implode(visibility, ", ");
    // if (location != "") info += " - From: " + location;
    // if (tags != "") info += " - Tagged: " + tags;

    infoLabel.setText(info);
    author.setTitle(uiText.ViewProfileOf() + " " + activity.getActor().getUri());

    // check for any attachments
    for (int i = 0; i < activity.getObjects().size(); i++) {
      if (activity.getObjects().get(i).getType().equals(
          ActivityObject.PICTURE)) {
        addPictureAttachment(activity.getObjects().get(i));
      } else if (activity.getObjects().get(i).getType().equals(
          ActivityObject.LINK)) {
        addLinkAttachment(activity.getObjects().get(i));
      }
    }
   
    statusActivity.add(hpanel);
    add(statusActivity);

    // add styles
    avatarImage.setStyleName("avatar");
    infoLabel.setStyleName("info");
    addStyleName("statusActivityWrapper");

    // 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(activity.getActor().getUri());
        profileWindow.show();
      }
    });
View Full Code Here

                  @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();
                  }
View Full Code Here

TOP

Related Classes of org.onesocialweb.gwt.client.ui.application.AbstractApplication

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.