コード例 #1
0
ファイル: PeersItem.java プロジェクト: aprasa/oldwork
    public void cellHover(TableCell cell) {
      super.cellHover(cell);

      long lConnectedPeers = 0;
      DownloadManager dm = (DownloadManager) cell.getDataSource();
      if (dm != null) {
        lConnectedPeers = dm.getNbPeers();
      }

      String sToolTip =
          lConnectedPeers + " " + MessageText.getString("GeneralView.label.connected") + "\n";
      if (lTotalPeers != -1) {
        sToolTip += lTotalPeers + " " + MessageText.getString("GeneralView.label.in_swarm");
      } else {
        TRTrackerScraperResponse response = dm.getTrackerScrapeResponse();
        sToolTip += "?? " + MessageText.getString("GeneralView.label.in_swarm");
        if (response != null) sToolTip += "(" + response.getStatusString() + ")";
      }

      int activationCount = dm == null ? 0 : dm.getActivationCount();
      if (activationCount > 0) {
        sToolTip +=
            "\n"
                + MessageText.getString(
                    "PeerColumn.activationCount", new String[] {"" + activationCount});
      }
      cell.setToolTip(sToolTip);
    }
コード例 #2
0
 // @see
 // org.gudy.azureus2.plugins.ui.tables.TableCellRefreshListener#refresh(org.gudy.azureus2.plugins.ui.tables.TableCell)
 public void refresh(TableCell cell) {
   TableColumnCore column = (TableColumnCore) cell.getDataSource();
   int colPos = column.getPosition();
   // colPos can have gaps in numbers
   if (!cell.setSortValue(colPos) && cell.isValid()) {
     return;
   }
   String key = column.getTitleLanguageKey();
   String s = MessageText.getString(key, column.getName());
   // s = column.getPosition() + "] " + s;
   cell.setText(s);
   cell.setToolTip("");
 }