当前位置: 首页>>代码示例>>Java>>正文


Java Table.removeAll方法代码示例

本文整理汇总了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);

}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:22,代码来源:JmxConnectionModelMainFormPage.java

示例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);
    }
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:24,代码来源:BaseJmxModelMainFormPage.java

示例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);
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:27,代码来源:MBeanAttributeModelMainFormPage.java

示例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());
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:17,代码来源:MBeanFeatureModeMainFormPage.java

示例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);

}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:34,代码来源:ZooKeeperConnectionModelMainFormPage.java

示例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);

}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:35,代码来源:ZnodeModelStatFormPage.java


注:本文中的org.eclipse.swt.widgets.Table.removeAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。