Methods Summary |
---|
public void | addMouseListener(TableRowMouseListener listener)
try {
this_mon.enter();
if (mouseListeners == null)
mouseListeners = new ArrayList(1);
mouseListeners.add(listener);
} finally {
this_mon.exit();
}
|
public void | delete()
this_mon.enter();
try {
if (bDisposed)
return;
if (TableViewSWT.DEBUGADDREMOVE)
System.out.println((table.isDisposed() ? "" : table.getData("Name"))
+ " row delete; index=" + getIndex());
Iterator iter = mTableCells.values().iterator();
while (iter.hasNext()) {
TableCellSWT item = (TableCellSWT) iter.next();
item.dispose();
}
bDisposed = true;
} finally {
this_mon.exit();
}
|
public void | doPaint(org.eclipse.swt.graphics.GC gc)
doPaint(gc, isVisible());
|
public void | doPaint(org.eclipse.swt.graphics.GC gc, boolean bVisible)
if (bDisposed || !bVisible)
return;
Iterator iter = mTableCells.values().iterator();
while(iter.hasNext()) {
TableCellSWT cell = (TableCellSWT) iter.next();
if (cell == null) {
continue;
}
// if (bOnlyIfChanged && !cell.getVisuallyChangedSinceRefresh()) {
// continue;
// }
if (cell.needsPainting()) {
cell.doPaint(gc);
}
}
|
public java.lang.Object | getDataSource(boolean bCoreObject)
if (bDisposed)
return null;
if (bCoreObject)
return coreDataSource;
if (pluginDataSource != null)
return pluginDataSource;
if (sTableID.equals(TableManager.TABLE_MYTORRENTS_COMPLETE) ||
sTableID.equals(TableManager.TABLE_MYTORRENTS_INCOMPLETE)) {
DownloadManager dm = (DownloadManager)coreDataSource;
if (dm != null) {
try {
pluginDataSource = DownloadManagerImpl.getDownloadStatic(dm);
} catch (DownloadException e) { /* Ignore */ }
}
}
if (sTableID.equals(TableManager.TABLE_TORRENT_PEERS)) {
PEPeer peer = (PEPeer)coreDataSource;
if (peer != null)
pluginDataSource = PeerManagerImpl.getPeerForPEPeer( peer );
}
if (sTableID.equals(TableManager.TABLE_TORRENT_PIECES)) {
// XXX There is no Piece object for plugins yet
PEPiece piece = (PEPiece)coreDataSource;
if (piece != null)
pluginDataSource = null;
}
if (sTableID.equals(TableManager.TABLE_TORRENT_FILES)) {
DiskManagerFileInfo fileInfo = (DiskManagerFileInfo)coreDataSource;
if (fileInfo != null){
try {
pluginDataSource =
new DiskManagerFileInfoImpl(
DownloadManagerImpl.getDownloadStatic(fileInfo.getDownloadManager()),
fileInfo);
} catch (DownloadException e) { /* Ignore */ }
}
}
if (sTableID.equals(TableManager.TABLE_MYSHARES)) {
pluginDataSource = coreDataSource;
}
if (sTableID.equals(TableManager.TABLE_MYTRACKER)) {
TRHostTorrent item = (TRHostTorrent)coreDataSource;
if (item != null)
pluginDataSource = new TrackerTorrentImpl(item);
}
return pluginDataSource;
|
public java.lang.Object | getDataSource()TableRow Implementation which returns the
associated plugin object for the row. Core Column Object who wish to get
core data source must re-class TableRow as TableRowCore and use
getDataSource(boolean)
return getDataSource(false);
|
public int | getIndex()
if (bDisposed)
return -1;
return ((TableViewSWTImpl)tableView).indexOf(this);
//return super.getIndex();
|
public int | getRealIndex()
return super.getIndex();
|
public TableCell | getTableCell(java.lang.String field)
if (bDisposed)
return null;
return (TableCell)mTableCells.get(field);
|
public com.aelitis.azureus.ui.common.table.TableCellCore | getTableCellCore(java.lang.String field)
if (bDisposed)
return null;
return (TableCellCore)mTableCells.get(field);
|
public org.gudy.azureus2.ui.swt.views.table.TableCellSWT | getTableCellSWT(java.lang.String name)
if (bDisposed)
return null;
return (TableCellSWT)mTableCells.get(name);
|
public java.lang.String | getTableID()
return sTableID;
|
public com.aelitis.azureus.ui.common.table.TableView | getView()
return tableView;
|
public void | invalidate()
super.invalidate();
if (bDisposed)
return;
Iterator iter = mTableCells.values().iterator();
while (iter.hasNext()) {
TableCellSWT cell = (TableCellSWT)iter.next();
if (cell != null)
cell.invalidate(true);
}
|
public void | invokeMouseListeners(TableRowMouseEvent event)
ArrayList listeners = mouseListeners;
if (listeners == null)
return;
for (int i = 0; i < listeners.size(); i++) {
try {
TableRowMouseListener l = (TableRowMouseListener) (listeners.get(i));
l.rowMouseTrigger(event);
} catch (Throwable e) {
Debug.printStackTrace(e);
}
}
|
public boolean | isRowDisposed()
return bDisposed;
|
public boolean | isValid()
if (bDisposed)
return true;
boolean valid = true;
Iterator iter = mTableCells.values().iterator();
while (iter.hasNext()) {
TableCellSWT cell = (TableCellSWT)iter.next();
if (cell != null)
valid &= cell.isValid();
}
return valid;
|
public void | locationChanged(int iStartColumn)
if (bDisposed || !isVisible())
return;
Iterator iter = mTableCells.values().iterator();
while(iter.hasNext()) {
TableCellSWT item = (TableCellSWT)iter.next();
if (item.getTableColumn().getPosition() > iStartColumn)
item.locationChanged();
}
|
public void | redraw()
refresh(true);
|
public java.util.List | refresh(boolean bDoGraphics)
if (bDisposed) {
return new ArrayList(0);
}
boolean bVisible = isVisible();
return refresh(bDoGraphics, bVisible);
|
public java.util.List | refresh(boolean bDoGraphics, boolean bVisible)
// If this were called from a plugin, we'd have to refresh the sorted column
// even if we weren't visible
ArrayList list = new ArrayList();
if (bDisposed) {
return list;
}
if (!bVisible) {
if (!bSetNotUpToDateLastRefresh) {
setUpToDate(false);
bSetNotUpToDateLastRefresh = true;
}
return list;
}
bSetNotUpToDateLastRefresh = false;
//System.out.println(SystemTime.getCurrentTime() + "refresh " + getIndex());
Iterator iter = mTableCells.values().iterator();
while(iter.hasNext()) {
TableCellSWT item = (TableCellSWT)iter.next();
boolean changed = item.refresh(bDoGraphics, bVisible);
if (changed) {
list.add(item);
}
}
return list;
|
public void | removeMouseListener(TableRowMouseListener listener)
try {
this_mon.enter();
if (mouseListeners == null)
return;
mouseListeners.remove(listener);
} finally {
this_mon.exit();
}
|
public void | setAlternatingBGColor(boolean bEvenIfNotVisible)
super.setAlternatingBGColor(bEvenIfNotVisible);
|
public void | setForeground(org.eclipse.swt.graphics.Color c)
// Don't need to set when not visible
if (!isVisible())
return;
super.setForeground(c);
|
public boolean | setTableItem(int newIndex)
if (bDisposed) {
System.out.println("XXX setTI: bDisposed from " + Debug.getCompressedStackTrace());
return false;
}
//if (getRealIndex() != newIndex) {
// ((TableViewSWTImpl)tableView).debug("sTI " + newIndex + "; via " + Debug.getCompressedStackTrace(4));
//}
return setTableItem(newIndex, false);
|
public void | setUpToDate(boolean upToDate)
if (bDisposed)
return;
Iterator iter = mTableCells.values().iterator();
while (iter.hasNext()) {
TableCellSWT cell = (TableCellSWT)iter.next();
if (cell != null)
cell.setUpToDate(upToDate);
}
|
public java.lang.String | toString()
String result = "TableRowImpl@" + Integer.toHexString(hashCode());
// In the rare case that we are calling this outside of a SWT thread, this
// may break, so we will just ignore those exceptions.
String index = null;
try {index = String.valueOf(getIndex());}
catch (SWTException se) {/* do nothing */}
return result + ((index == null) ? "" : ("/#" + index));
|