Exemplo n.º 1
0
 /** @return the key prefix used to store column data */
 public String getColumnKey(IColumn c) {
   String key = c.getColumnId();
   if (c.getTable() != null) {
     key = getTableKey(c.getTable()) + "#" + key;
   }
   return key;
 }
Exemplo n.º 2
0
  public void setAllTableColumnPreferences(ITable table) {
    if (table == null) {
      return;
    }

    for (IColumn col : table.getColumns()) {
      if (col.isDisplayable()) {
        setTableColumnPreferences(col, false);
      }
    }

    flush();
  }
Exemplo n.º 3
0
  public void setTableColumnPreferences(IColumn col, boolean flush) {
    String keySuffix = getColumnKey(col);
    String key = TABLE_COLUMN_UIINDEX + keySuffix;
    int viewIndex = col.getVisibleColumnIndexHint();
    boolean visible = col.isVisibleInternal();
    int width = col.getWidth();
    int sortIndex = col.getSortIndex();
    boolean sortUp = col.isSortAscending();
    boolean sortExplicit = col.isSortExplicit();
    //
    if (viewIndex >= 0) {
      m_env.put(key, "" + viewIndex);
    } else {
      m_env.remove(key);
    }
    //
    key = TABLE_COLUMN_VISIBLE + keySuffix;
    if (!visible) {
      m_env.put(key, "no");
    } else {
      m_env.put(key, "yes");
    }
    //
    key = getUserAgentPrefix() + TABLE_COLUMN_WIDTH + keySuffix;
    if (width >= 0) {
      m_env.put(key, "" + width);
    } else {
      m_env.remove(key);
    }
    //
    key = TABLE_COLUMN_SORT_INDEX + keySuffix;
    if (sortIndex >= 0) {
      m_env.put(key, "" + sortIndex);
    } else {
      m_env.put(key, "-1");
    }
    //
    key = TABLE_COLUMN_SORT_ASC + keySuffix;
    if (sortIndex >= 0 && sortUp) {
      m_env.put(key, "true");
    } else {
      m_env.put(key, "false");
    }
    //
    key = TABLE_COLUMN_SORT_EXPLICIT + keySuffix;
    if (sortExplicit) {
      m_env.put(key, "true");
    } else {
      m_env.put(key, "false");
    }

    if (flush) {
      flush();
    }
  }
 public void setColumn(IColumn<?> column) {
   m_column = column;
   m_columnId = column.getColumnId();
 }