/**
   * Called to accept an incoming invitation. Adds the invitation chat room to the list of chat
   * rooms and joins it.
   *
   * @param invitation the invitation to accept.
   */
  public void acceptInvitation(WhiteboardInvitation invitation) {
    WhiteboardSession whiteboard = invitation.getTargetWhiteboard();

    byte[] password = invitation.getWhiteboardPassword();

    try {
      if (password == null) whiteboard.join();
      else whiteboard.join(password);
    } catch (OperationFailedException e) {
      WhiteboardActivator.getUiService()
          .getPopupDialog()
          .showMessagePopupDialog(
              Resources.getString(
                  "failedToJoinWhiteboard", new String[] {whiteboard.getWhiteboardID()}),
              Resources.getString("error"),
              PopupDialog.ERROR_MESSAGE);

      logger.error("Failed to join whiteboard: " + whiteboard.getWhiteboardID(), e);
    }
  }
    /**
     * Implements the <tt>WhiteboardSessionPresenceListener .whiteboardSessionPresenceChanged</tt>
     * method.
     */
    public void whiteboardSessionPresenceChanged(WhiteboardSessionPresenceChangeEvent evt) {
      WhiteboardSession whiteboardSession = evt.getWhiteboardSession();

      if (evt.getEventType().equals(WhiteboardSessionPresenceChangeEvent.LOCAL_USER_JOINED)) {
        whiteboardSession.addWhiteboardObjectListener(WhiteboardSessionManager.this);

        WhiteboardFrame frame = getWhiteboardFrame(evt.getWhiteboardSession());

        if (frame == null) {
          frame = new WhiteboardFrame(WhiteboardSessionManager.this, whiteboardSession);

          frame.setVisible(true);
          wbFrames.add(frame);
        }
      } else if (evt.getEventType()
          .equals(WhiteboardSessionPresenceChangeEvent.LOCAL_USER_JOIN_FAILED)) {
        WhiteboardActivator.getUiService()
            .getPopupDialog()
            .showMessagePopupDialog(
                Resources.getString(
                        "failedToJoinWhiteboard",
                        new String[] {whiteboardSession.getWhiteboardID()})
                    + evt.getReason(),
                Resources.getString("error"),
                PopupDialog.ERROR_MESSAGE);
      } else if (evt.getEventType().equals(WhiteboardSessionPresenceChangeEvent.LOCAL_USER_LEFT)) {
        WhiteboardFrame frame = getWhiteboardFrame(whiteboardSession);

        if (frame == null) return;

        wbFrames.remove(frame);
        frame.dispose();
        whiteboardSession.removeWhiteboardObjectListener(WhiteboardSessionManager.this);
      } else if (evt.getEventType()
          .equals(WhiteboardSessionPresenceChangeEvent.LOCAL_USER_KICKED)) {

      } else if (evt.getEventType()
          .equals(WhiteboardSessionPresenceChangeEvent.LOCAL_USER_DROPPED)) {

      }
    }
Beispiel #3
0
  /**
   * Creates an instance of <tt>StatusSubMenu</tt>.
   *
   * @param tray a reference of the parent <tt>Systray</tt>
   */
  public StatusSubMenu(SystrayServiceJdicImpl tray) {

    parentSystray = tray;

    this.setText(Resources.getString("setStatus"));
    this.setIcon(Resources.getImage("statusMenuIcon"));

    /* makes the menu look better */
    this.setPreferredSize(new java.awt.Dimension(28, 24));

    this.init();
  }
 /**
  * Implements the <code>AccountRegistrationWizard.getProtocolDescription
  * </code> method. Returns the description of the protocol for this wizard.
  *
  * @return String
  */
 public String getProtocolDescription() {
   return Resources.getString("plugin.gibberishaccregwizz.PROTOCOL_DESCRIPTION");
 }
 /**
  * Implements the <code>AccountRegistrationWizard.getProtocolName</code> method. Returns the
  * protocol name for this wizard.
  *
  * @return String
  */
 public String getProtocolName() {
   return Resources.getString("plugin.gibberishaccregwizz.PROTOCOL_NAME");
 }
  /**
   * Creates an instance of <tt>GibberishAccountRegistrationWizard</tt>.
   *
   * @param wizardContainer the wizard container, where this wizard is added
   */
  public GibberishAccountRegistrationWizard(WizardContainer wizardContainer) {
    setWizardContainer(wizardContainer);

    wizardContainer.setFinishButtonText(Resources.getString("service.gui.SIGN_IN"));
  }