本文整理匯總了Java中org.eclipse.swt.widgets.Table.removeAll方法的典型用法代碼示例。如果您正苦於以下問題:Java Table.removeAll方法的具體用法?Java Table.removeAll怎麽用?Java Table.removeAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Table
的用法示例。
在下文中一共展示了Table.removeAll方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initPropertiesSectionFromModel
import org.eclipse.swt.widgets.Table; //導入方法依賴的package包/類
/**
* TODO: Comment.
*
*/
protected void initPropertiesSectionFromModel() {
Table table = getPropertiesSectionTable();
table.removeAll();
Map<String, String> properties = getZooKeeperConnectionProperties();
for (String key : properties.keySet()) {
TableItem item = new TableItem(table, SWT.NONE);
String value = properties.get(key);
item.setText(0, key);
item.setText(1, value);
}
packTable(table, PROPERTIES_COLUMN_WIDTHS);
}
示例2: initDescriptorSectionFromModel
import org.eclipse.swt.widgets.Table; //導入方法依賴的package包/類
protected void initDescriptorSectionFromModel() {
Descriptor descriptor = getJmxDescriptor();
if (descriptor == null) {
return;
}
Table table = getDescriptorTable();
if (table == null) {
return;
}
table.removeAll();
for (String fieldName : descriptor.getFieldNames()) {
TableItem item = new TableItem(table, SWT.NONE);
Object value = descriptor.getFieldValue(fieldName);
item.setText(0, fieldName);
item.setText(1, String.valueOf(value));
}
packTable(table, DEFAULT_NAME_VALUE_COLUMN_WIDTHS);
}
示例3: initPrimarySectionFromModel
import org.eclipse.swt.widgets.Table; //導入方法依賴的package包/類
@Override
protected void initPrimarySectionFromModel() {
Table table = getPrimaryTable();
table.removeAll();
MBeanAttributeModel model = getModel();
MBeanAttribute attribute = model.getData();
String valueString = attribute.getValueAsString();
String valueError = attribute.getValueRetrievalErrorMessage();
TableItem item = new TableItem(table, SWT.NONE);
item.setText(0, attribute.getName());
if (valueError != null) {
item.setText(1, valueError);
item.setForeground(1, table.getDisplay().getSystemColor(SWT.COLOR_RED));
}
else {
item.setText(1, valueString);
}
packTable(table, DEFAULT_NAME_VALUE_COLUMN_WIDTHS);
}
示例4: initInfoSectionFromModel
import org.eclipse.swt.widgets.Table; //導入方法依賴的package包/類
@Override
protected void initInfoSectionFromModel() {
Table table = getInfoTable();
table.removeAll();
MBeanFeatureInfo featureInfo = getFeatureInfo();
TableItem nameItem = new TableItem(table, SWT.NONE);
nameItem.setText(0, FEATURE_INFO_PROPERTY_NAME_NAME);
nameItem.setText(1, featureInfo.getName());
TableItem descriptionItem = new TableItem(table, SWT.NONE);
descriptionItem.setText(0, FEATURE_INFO_PROPERTY_NAME_DESCRIPTION);
descriptionItem.setText(1, featureInfo.getDescription());
}
示例5: initPropertiesSectionFromModel
import org.eclipse.swt.widgets.Table; //導入方法依賴的package包/類
/**
* TODO: Comment.
*
*/
protected void initPropertiesSectionFromModel() {
Table table = getPropertiesSectionTable();
table.removeAll();
Map<String, String> properties = getZooKeeperConnectionProperties();
for (String key : properties.keySet()) {
TableItem item = new TableItem(table, SWT.NONE);
String value = properties.get(key);
item.setText(0, key);
item.setText(1, value);
Color valueTextColor = table.getForeground();
if (key.equals(ZooKeeperConnectionModelElementType.PROPERTY_NAME_STATE)) {
if (!States.CONNECTED.name().equals(value)) {
valueTextColor = table.getDisplay().getSystemColor(SWT.COLOR_RED);
}
// else {
// valueTextColor = table.getDisplay().getSystemColor(SWT.COLOR_GREEN);
// }
}
item.setForeground(1, valueTextColor);
}
packTable(table, PROPERTIES_COLUMN_WIDTHS);
}
示例6: initTableItemsFromZnode
import org.eclipse.swt.widgets.Table; //導入方法依賴的package包/類
@Override
protected void initTableItemsFromZnode() {
Table table = getTable();
table.removeAll();
ZnodeModel znodeModel = getModel();
Znode znode = znodeModel.getData();
Stat stat = znode.getStat();
DateFormat format = DateFormat.getDateTimeInstance();
String ctime = format.format(new Date(stat.getCtime()));
String mtime = format.format(new Date(stat.getMtime()));
addStatValueTableItem(table, Znode.STAT_NAME_CZXID, String.valueOf(stat.getCzxid()),
Znode.STAT_DESCRIPTION_CZXID);
addStatValueTableItem(table, Znode.STAT_NAME_MZXID, String.valueOf(stat.getMzxid()),
Znode.STAT_DESCRIPTION_MZXID);
addStatValueTableItem(table, Znode.STAT_NAME_CTIME, ctime, Znode.STAT_DESCRIPTION_CTIME);
addStatValueTableItem(table, Znode.STAT_NAME_MTIME, mtime, Znode.STAT_DESCRIPTION_MTIME);
addStatValueTableItem(table, Znode.STAT_NAME_VERSION, String.valueOf(stat.getVersion()),
Znode.STAT_DESCRIPTION_VERSION);
addStatValueTableItem(table, Znode.STAT_NAME_CVERSION, String.valueOf(stat.getCversion()),
Znode.STAT_DESCRIPTION_CVERSION);
addStatValueTableItem(table, Znode.STAT_NAME_AVERSION, String.valueOf(stat.getAversion()),
Znode.STAT_DESCRIPTION_AVERSION);
addStatValueTableItem(table, Znode.STAT_NAME_EPHEMERAL_OWNER, String.valueOf(stat.getEphemeralOwner()),
Znode.STAT_DESCRIPTION_EPHEMERAL_OWNER);
addStatValueTableItem(table, Znode.STAT_NAME_DATA_LENGTH, String.valueOf(stat.getDataLength()),
Znode.STAT_DESCRIPTION_DATA_LENGTH);
addStatValueTableItem(table, Znode.STAT_NAME_NUM_CHILDREN, String.valueOf(stat.getNumChildren()),
Znode.STAT_DESCRIPTION_NUM_CHILDREN);
}