Methods Summary |
---|
public void | addColumn(com.aelitis.azureus.ui.common.table.TableColumnCore item)Adds a column definition to the list
try {
String name = item.getName();
String sTableID = item.getTableID();
try{
items_mon.enter();
Map mTypes = (Map)items.get(sTableID);
if (mTypes == null) {
// LinkedHashMap to preserve order
mTypes = new LinkedHashMap();
items.put(sTableID, mTypes);
}
if (!mTypes.containsKey(name)) {
mTypes.put(name, item);
((TableColumnCore)item).loadSettings();
}
}finally{
items_mon.exit();
}
if (!item.getColumnAdded()) {
item.setColumnAdded(true);
}
} catch (Exception e) {
System.out.println("Error while adding Table Column Extension");
Debug.printStackTrace( e );
}
|
public void | addExtension(java.lang.String name, org.gudy.azureus2.plugins.ui.tables.mytorrents.PluginMyTorrentsItemFactory item)Add an extension from the deprecated PluginMyTorrentsItemFactory
String sAlign = item.getOrientation();
int iAlign;
if (sAlign.equals(PluginMyTorrentsItemFactory.ORIENT_RIGHT))
iAlign = TableColumnCore.ALIGN_TRAIL;
else
iAlign = TableColumnCore.ALIGN_LEAD;
int iVisibleIn = item.getTablesVisibleIn();
if ((iVisibleIn & PluginMyTorrentsItemFactory.TABLE_COMPLETE) != 0) {
TableColumnCore tci =
new OldMyTorrentsPluginItem(TableManager.TABLE_MYTORRENTS_COMPLETE,
name, item);
tci.initialize(iAlign, item.getDefaultPosition(), item.getDefaultSize());
addColumn(tci);
}
if ((iVisibleIn & PluginMyTorrentsItemFactory.TABLE_INCOMPLETE) != 0) {
TableColumnCore tci =
new OldMyTorrentsPluginItem(TableManager.TABLE_MYTORRENTS_INCOMPLETE,
name, item);
tci.initialize(iAlign, item.getDefaultPosition(), item.getDefaultSize());
addColumn(tci);
}
|
public void | addExtension(java.lang.String name, org.gudy.azureus2.plugins.ui.tables.peers.PluginPeerItemFactory item)Add an extension from the deprecated PluginPeerItemFactory
TableColumnCore tci = new OldPeerPluginItem(TableManager.TABLE_TORRENT_PEERS,
name, item);
tci.initialize(TableColumnCore.ALIGN_LEAD,
TableColumnCore.POSITION_INVISIBLE, item.getDefaultSize());
addColumn(tci);
|
public void | ensureIntegrety(java.lang.String sTableID)
Map mTypes = (Map)items.get(sTableID);
if (mTypes == null)
return;
TableColumnCore[] tableColumns =
(TableColumnCore[])mTypes.values().toArray(new TableColumnCore[mTypes.values().size()]);
Arrays.sort(tableColumns, new Comparator () {
public final int compare (Object a, Object b) {
int iPositionA = ((TableColumnCore)a).getPosition();
if (iPositionA == TableColumnCore.POSITION_LAST)
iPositionA = 0xFFFF;
int iPositionB = ((TableColumnCore)b).getPosition();
if (iPositionB == TableColumnCore.POSITION_LAST)
iPositionB = 0xFFFF;
return iPositionA - iPositionB;
}
});
int iPos = 0;
for (int i = 0; i < tableColumns.length; i++) {
int iCurPos = tableColumns[i].getPosition();
if (iCurPos >= 0 || iCurPos == TableColumnCore.POSITION_LAST) {
tableColumns[i].setPositionNoShift(iPos++);
}
}
|
public void | generateDiagnostics(org.gudy.azureus2.core3.util.IndentWriter writer)
try{
items_mon.enter();
writer.println("TableColumns");
for (Iterator iter = items.keySet().iterator(); iter.hasNext();) {
String sTableID = (String)iter.next();
Map mTypes = (Map)items.get(sTableID);
writer.indent();
writer.println(sTableID + ": " + mTypes.size() + " columns:");
writer.indent();
for (Iterator iter2 = mTypes.values().iterator(); iter2.hasNext();) {
TableColumnCore tc = (TableColumnCore)iter2.next();
tc.generateDiagnostics(writer);
}
writer.exdent();
writer.exdent();
}
} catch (Exception e) {
e.printStackTrace();
} finally {
items_mon.exit();
}
|
public com.aelitis.azureus.ui.common.table.TableColumnCore[] | getAllTableColumnCoreAsArray(java.lang.String sTableID)
Map mTypes = (Map)items.get(sTableID);
if (mTypes != null) {
return (TableColumnCore[])mTypes.values().toArray(new TableColumnCore[mTypes.values().size()]);
}
return new TableColumnCore[0];
|
public java.util.List | getAutoHideOrder(java.lang.String sTableID)
List list = (List)autoHideOrder.get(sTableID);
if (list == null) {
return new ArrayList();
}
return list;
|
public static org.gudy.azureus2.ui.swt.views.table.utils.TableColumnManager | getInstance()Retrieve the static TableColumnManager instance
try{
class_mon.enter();
if(instance == null)
instance = new TableColumnManager();
return instance;
}finally{
class_mon.exit();
}
|
public com.aelitis.azureus.ui.common.table.TableColumnCore | getTableColumnCore(java.lang.String sTableID, java.lang.String sColumnName)
Map mTypes = (Map)items.get(sTableID);
if (mTypes == null)
return null;
return (TableColumnCore)mTypes.get(sColumnName);
|
public int | getTableColumnCount(java.lang.String sTableID)
Map mTypes = (Map)items.get(sTableID);
if (mTypes == null) {
return 0;
}
return mTypes.size();
|
public java.util.Map | getTableColumnsAsMap(java.lang.String sTableID)Retrieves TableColumnCore objects of a particular type.
//System.out.println("getTableColumnsAsMap(" + sTableID + ")");
try{
items_mon.enter();
Map mReturn = new LinkedHashMap();
Map mTypes = (Map)items.get(sTableID);
if (mTypes != null) {
mReturn.putAll(mTypes);
}
//System.out.println("getTableColumnsAsMap(" + sTableID + ") returnsize: " + mReturn.size());
return mReturn;
}finally{
items_mon.exit();
}
|
public void | saveTableColumns(java.lang.String sTableID)Saves all the user configurable Table Column settings at once, complete
with a COConfigurationManager.save().
try {
TableColumnCore[] tcs = getAllTableColumnCoreAsArray(sTableID);
for (int i = 0; i < tcs.length; i++) {
if (tcs[i] != null)
tcs[i].saveSettings();
}
COConfigurationManager.save();
} catch (Exception e) {
Debug.out(e);
}
|
public void | setAutoHideOrder(java.lang.String sTableID, java.lang.String[] autoHideOrderColumnIDs)
ArrayList autoHideOrderList = new ArrayList(autoHideOrderColumnIDs.length);
for (int i = 0; i < autoHideOrderColumnIDs.length; i++) {
String sColumnID = autoHideOrderColumnIDs[i];
TableColumnCore column = getTableColumnCore(sTableID, sColumnID);
if (column != null) {
autoHideOrderList.add(column);
}
}
autoHideOrder.put(sTableID, autoHideOrderList);
|