Ejemplo n.º 1
0
 private void populateFeatureSet() {
   final ServiceDiscoveryManager disco =
       ServiceDiscoveryManager.getInstanceFor(ChatsyManager.getConnection());
   final DiscoverItems items = ChatsyManager.getSessionManager().getDiscoveredItems();
   Iterator<DiscoverItems.Item> iter = items.getItems();
   while (iter.hasNext()) {
     DiscoverItems.Item item = iter.next();
     String entity = item.getEntityID();
     if (entity != null) {
       if (entity.startsWith("manager.")) {
         chatsyManagerInstalled = true;
         try {
           featureInfo = disco.discoverInfo(item.getEntityID());
         } catch (XMPPException e) {
           Log.error("Error while retrieving feature list for ChatsyManager.", e);
         }
       }
     }
   }
 }
Ejemplo n.º 2
0
  private UserSettings() {
    privateDataManager = new PrivateDataManager(ChatsyManager.getConnection());
    PrivateDataManager.addPrivateDataProvider(
        "personal_settings", "jive:user:settings", new SettingsDataProvider());

    try {
      settingsData =
          (SettingsData)
              privateDataManager.getPrivateData("personal_settings", "jive:user:settings");
    } catch (XMPPException e) {
      Log.error("Error in User Settings", e);
    }
  }
Ejemplo n.º 3
0
  public void closeChatRoom() {
    fireClosingListeners();
    getTranscriptWindow().removeContextMenuListener(this);
    getTranscriptWindow().removeMouseListener(transcriptWindowMouseListener);
    getChatInputEditor().removeKeyListener(chatEditorKeyListener);
    textScroller.getViewport().remove(transcriptWindow);
    ChatsyManager.getConnection().removeConnectionListener(this);

    packetIDList.clear();
    messageListeners.clear();
    getChatInputEditor().close();

    getChatInputEditor().getActionMap().remove("closeTheRoom");
    chatAreaButton.getButton().removeActionListener(this);
    bottomPanel.remove(chatAreaButton);
  }
Ejemplo n.º 4
0
  protected ChatRoom() {
    chatPanel = new JPanel(new GridBagLayout());
    transcriptWindow = new TranscriptWindow();
    splitPane = new JSplitPane();
    packetIDList = new ArrayList<String>();
    notificationLabel = new JLabel();
    toolbar = new ChatToolBar();
    bottomPanel = new JPanel();

    messageListeners = new ArrayList<MessageListener>();
    transcript = new ArrayList<Message>();
    editorBar = new JPanel(new FlowLayout(FlowLayout.LEFT, 1, 1));

    transcriptWindowMouseListener =
        new MouseAdapter() {
          public void mouseClicked(MouseEvent e) {
            getChatInputEditor().requestFocus();
          }

          public void mouseReleased(MouseEvent e) {
            mousePressed = false;
            if (transcriptWindow.getSelectedText() == null) getChatInputEditor().requestFocus();
          }

          public void mousePressed(MouseEvent e) {
            mousePressed = true;
          }
        };
    transcriptWindow.addMouseListener(transcriptWindowMouseListener);
    transcriptWindow.setBackground(Color.white);
    chatAreaButton = new ChatAreaSendField("Send");

    textScroller = new JScrollPane(transcriptWindow);
    textScroller.setBackground(transcriptWindow.getBackground());
    textScroller.getViewport().setBackground(Color.white);
    textScroller.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.lightGray));

    getChatInputEditor().setSelectedTextColor(Color.decode("0xffffff"));
    getChatInputEditor().setSelectionColor(Color.decode("0x336699"));
    init();
    getSplitPane().setRightComponent(null);
    getTranscriptWindow().addContextMenuListener(this);

    ChatsyManager.getConnection().addConnectionListener(this);
    addFocusListener(this);
  }
Ejemplo n.º 5
0
 public void insertMessage(Message message) {
   ChatsyManager.getChatManager().filterIncomingMessage(this, message);
   ChatsyManager.getChatManager().fireGlobalMessageReceievedListeners(this, message);
   addToTranscript(message, true);
   fireMessageReceived(message);
 }