Beispiel #1
0
 private Component makeComponent(JIDStatus jidStatus) {
   int show;
   if (jidStatus.isOnline()) {
     show = jidStatus.getShow();
   } else {
     show = Presence.UNAVAILABLE;
   }
   renderer.setIcon(StatusIcons.getStatusIcon(show, jidStatus.getType()));
   return renderer;
 }
Beispiel #2
0
 private Component makeComponent(JIDStatus jidStatus) {
   if (jidStatus.isOnline()) {
     if (!onlineTree) return fill; // leeg want offline tree
     int show = jidStatus.getShow();
     renderer.setIcon(StatusIcons.getStatusIcon(show, jidStatus.getType()));
   } else {
     if (onlineTree) return fill; // leeg want online tree
     renderer.setIcon(StatusIcons.getStatusIcon(Presence.UNAVAILABLE, jidStatus.getType()));
   }
   return renderer;
 }
Beispiel #3
0
  public String getToolTipText(MouseEvent ev) {
    if (ev == null) return null;
    TreePath path = getPathForLocation(ev.getX(), ev.getY());
    if (path != null) {
      JIDStatus jidStatus = null;
      Object o = path.getLastPathComponent();
      if (o instanceof PrimaryJIDStatus) {
        jidStatus = ((PrimaryJIDStatus) o).getJIDPrimaryStatus();
      }
      if (o instanceof JIDStatus) {
        jidStatus = ((JIDStatus) o);
      } else {
        return null;
      }
      String statusMsg;
      if (jidStatus.getStatus() != null) {
        statusMsg =
            I18N.gettext("main.main.statusmenu.Status_message:")
                + " "
                + jidStatus.getStatus()
                + "</p><p>";
      } else {
        statusMsg = "";
      }

      String waitingStatus = jidStatus.getWaiting();
      if (jidStatus.getWaiting() != null) {
        waitingStatus =
            "<p>"
                + I18N.gettext("main.main.roster.Waiting_Status:")
                + " "
                + jidStatus.getWaiting()
                + "</p>";
      } else {
        waitingStatus = "";
      }
      return "<HTML><P>"
          + I18N.gettext("main.main.roster.Status:")
          + " "
          + Presence.toLongShow(jidStatus.getShow())
          + "</p><p>"
          + statusMsg
          + "JID: "
          + jidStatus.getCompleteJID()
          + "</p><p>"
          + I18N.gettext("main.main.roster.Subscription:")
          + " "
          + jidStatus.getSubscription()
          + "</p>"
          + waitingStatus
          + "</p></HTML>";
    }
    return null;
  }
Beispiel #4
0
 private void sendMessage(JIDStatus jidStatus) {
   new SendMessage(backend, jidStatus.getJID(), jidStatus.getNick()).show();
 }