InfoPanelpublic class InfoPanel extends TablePanel Display client info in a two-column format. |
Fields Summary |
---|
private org.eclipse.swt.widgets.Table | mTable | private org.eclipse.swt.widgets.TableColumn | mCol2 | private static final String[] | mLabels | private static final int | ENT_DDM_AWARE | private static final int | ENT_APP_DESCR | private static final int | ENT_VM_VERSION | private static final int | ENT_PROCESS_ID |
Methods Summary |
---|
public void | clientChanged(com.android.ddmlib.Client client, int changeMask)Sent when an existing client information changed.
This is sent from a non UI thread.
if (client == getCurrentClient()) {
if ((changeMask & Client.CHANGE_INFO) == Client.CHANGE_INFO) {
if (mTable.isDisposed())
return;
mTable.getDisplay().asyncExec(new Runnable() {
public void run() {
clientSelected();
}
});
}
}
| public void | clientSelected()Sent when a new client is selected. The new client can be accessed
with {@link #getCurrentClient()}
if (mTable.isDisposed())
return;
Client client = getCurrentClient();
if (client == null) {
for (int i = 0; i < mLabels.length; i++) {
TableItem item = mTable.getItem(i);
item.setText(1, "-");
}
} else {
TableItem item;
String clientDescription, vmIdentifier, isDdmAware,
pid;
ClientData cd = client.getClientData();
synchronized (cd) {
clientDescription = (cd.getClientDescription() != null) ?
cd.getClientDescription() : "?";
vmIdentifier = (cd.getVmIdentifier() != null) ?
cd.getVmIdentifier() : "?";
isDdmAware = cd.isDdmAware() ?
"yes" : "no";
pid = (cd.getPid() != 0) ?
String.valueOf(cd.getPid()) : "?";
}
item = mTable.getItem(ENT_APP_DESCR);
item.setText(1, clientDescription);
item = mTable.getItem(ENT_VM_VERSION);
item.setText(1, vmIdentifier);
item = mTable.getItem(ENT_DDM_AWARE);
item.setText(1, isDdmAware);
item = mTable.getItem(ENT_PROCESS_ID);
item.setText(1, pid);
}
mCol2.pack();
//Log.i("ddms", "InfoPanel: changed " + client);
| protected org.eclipse.swt.widgets.Control | createControl(org.eclipse.swt.widgets.Composite parent)Create our control(s).
mTable = new Table(parent, SWT.MULTI | SWT.FULL_SELECTION);
mTable.setHeaderVisible(false);
mTable.setLinesVisible(false);
TableColumn col1 = new TableColumn(mTable, SWT.RIGHT);
col1.setText("name");
mCol2 = new TableColumn(mTable, SWT.LEFT);
mCol2.setText("PlaceHolderContentForWidth");
TableItem item;
for (int i = 0; i < mLabels.length; i++) {
item = new TableItem(mTable, SWT.NONE);
item.setText(0, mLabels[i]);
item.setText(1, "-");
}
col1.pack();
mCol2.pack();
return mTable;
| public void | deviceSelected()Sent when a new device is selected. The new device can be accessed
with {@link #getCurrentDevice()}
// pass
| public void | setFocus()Sets the focus to the proper control inside the panel.
mTable.setFocus();
| protected void | setTableFocusListener()
addTableToFocusListener(mTable);
|
|