Ejemplo n.º 1
0
  /** Removes the room that is currently selected. */
  void removeSelectedRoom() {
    ChatRoomWrapper chatRoomWrapper = chatRoomsTableModel.getValueAt(chatRoomList.getSelectedRow());

    ConferenceChatManager conferenceManager =
        GuiActivator.getUIService().getConferenceChatManager();
    conferenceManager.removeChatRoom(chatRoomWrapper);
  }
Ejemplo n.º 2
0
    public Component getTableCellRendererComponent(
        JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
      ChatRoomWrapper chatRoom = (ChatRoomWrapper) value;

      this.setText(chatRoom.getChatRoomName());

      Image chatRoomImage = ImageLoader.getImage(ImageLoader.CHAT_ROOM_16x16_ICON);

      if (chatRoom.getChatRoom() == null || !chatRoom.getChatRoom().isJoined()) {
        chatRoomImage = LightGrayFilter.createDisabledImage(chatRoomImage);
      }

      this.setIcon(new ImageIcon(chatRoomImage));

      this.setFont(this.getFont().deriveFont(Font.PLAIN));

      if (isSelected) this.setBackground(table.getSelectionBackground());
      else this.setBackground(UIManager.getColor("Table.background"));

      return this;
    }
Ejemplo n.º 3
0
    public Component getTableCellRendererComponent(
        JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
      ProtocolProviderService pps = (ProtocolProviderService) value;
      OperationSetPresence presence = pps.getOperationSet(OperationSetPresence.class);

      if (presence != null) {
        byte[] protocolStatusImage = presence.getPresenceStatus().getStatusIcon();

        if (protocolStatusImage != null) {
          this.setIcon(new ImageIcon(protocolStatusImage));
        } else {
          this.setIcon(null);
        }
      }

      this.setText(pps.getAccountID().getDisplayName());

      if (isSelected) this.setBackground(table.getSelectionBackground());
      else this.setBackground(UIManager.getColor("Table.background"));

      return this;
    }
Ejemplo n.º 4
0
 /**
  * Returns the currently selected room.
  *
  * @return the currently selected room.
  */
 ChatRoomWrapper getSelectedRoom() {
   return chatRoomsTableModel.getValueAt(chatRoomList.getSelectedRow());
 }