Exemplo n.º 1
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("");
 }
Exemplo n.º 2
0
  /**
   * @param mapTCs
   * @param defaultVisibleOrder
   */
  private static void setVisibility(Map mapTCs, String[] defaultVisibleOrder) {
    for (Iterator iter = mapTCs.values().iterator(); iter.hasNext(); ) {
      TableColumnCore tc = (TableColumnCore) iter.next();
      tc.setVisible(false);
    }

    for (int i = 0; i < defaultVisibleOrder.length; i++) {
      String id = defaultVisibleOrder[i];
      TableColumnCore tc = (TableColumnCore) mapTCs.get(id);
      if (tc != null) {
        tc.setVisible(true);
        tc.setPositionNoShift(i);
      }
    }
  }
  private static void setVisibility(Map mapTCs, String[] defaultVisibleOrder) {
    for (Iterator iter = mapTCs.values().iterator(); iter.hasNext(); ) {
      TableColumnCore tc = (TableColumnCore) iter.next();
      Long force_visible = (Long) tc.getUserData(TableColumn.UD_FORCE_VISIBLE);
      if (force_visible == null || force_visible == 0) {

        tc.setVisible(false);
      }
    }

    for (int i = 0; i < defaultVisibleOrder.length; i++) {
      String id = defaultVisibleOrder[i];
      TableColumnCore tc = (TableColumnCore) mapTCs.get(id);
      if (tc != null) {
        tc.setVisible(true);
        tc.setPositionNoShift(i);
      }
    }
  }