FileDocCategorySizeDatePackage
PeerIDItem.javaAPI DocAzureus 3.0.3.42199Sun Sep 23 04:55:16 BST 2007org.gudy.azureus2.ui.swt.views.tableitems.peers

PeerIDItem

public class PeerIDItem extends org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn implements org.gudy.azureus2.plugins.ui.tables.TableCellRefreshListener
author
Allan Crooks

Fields Summary
Constructors Summary
public PeerIDItem(String table_id)
Default Constructor

		// Uses same values for subclass constructor as ClientItem does.
		super("peer_id", POSITION_INVISIBLE, 100, table_id);
		setRefreshInterval(INTERVAL_LIVE);
	
Methods Summary
public voidrefresh(org.gudy.azureus2.plugins.ui.tables.TableCell cell)

		PEPeer peer = (PEPeer) cell.getDataSource();
		if (peer == null) {cell.setText(""); return;}
		
		byte[] peer_id = peer.getId();
		if (peer_id == null) {cell.setText(""); return;}
		try {
			String text = new String(peer_id, 0, peer_id.length, Constants.BYTE_ENCODING);
			text = text.replace((char)12, (char)32); // Replace newlines.
			text = text.replace((char)10, (char)32);
			cell.setText(text);
		}
		catch (java.io.UnsupportedEncodingException uee) {
			cell.setText("");
		}