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


Java TableItem.setText方法代码示例

本文整理汇总了Java中org.eclipse.swt.widgets.TableItem.setText方法的典型用法代码示例。如果您正苦于以下问题:Java TableItem.setText方法的具体用法?Java TableItem.setText怎么用?Java TableItem.setText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.widgets.TableItem的用法示例。


在下文中一共展示了TableItem.setText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initDescriptorSectionFromModel

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的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

示例2: initPrimarySectionFromModel

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的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

示例3: initInfoSectionFromModel

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的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

示例4: refreshTable

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
/**
 * Refresh the table of information.
 */
protected void refreshTable() {
	fileTable.removeAll();
	Iterator specs = wizard.getImportSpecifications().iterator();
	boolean canFinish = specs.hasNext();
	while (specs.hasNext()) {
		ImportSpecification spec = (ImportSpecification) specs.next();
		File file = new File(spec.getSourceFilename());
		TableItem item = new TableItem(fileTable, SWT.NULL);
		item.setText(new String[] {
			file.getName(),
			spec.getTargetFilename(),
			spec.getFiletype() });
		item.setData(spec);
		canFinish &= spec.hasFiletype();
	}
	fileTable.redraw();
	wizard.enableFinishButton(canFinish);
}
 
开发者ID:AppleCommander,项目名称:AppleCommander,代码行数:22,代码来源:ImportSelectFilesWizardPane.java

示例5: initPropertiesSectionFromModel

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的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: addStatValueTableItem

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
private void addStatValueTableItem(Table table, String name, String value, String description) {
    TableItem item = new TableItem(table, SWT.NONE);

    item.setText(0, name);
    item.setText(1, value);
    item.setText(2, description);
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:8,代码来源:ZnodeModelStatFormPage.java

示例7: refreshRules

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
private void refreshRules() {
	rulesTable.removeAll();
	for (int i=0; i<rules.size(); ++i) {
		LSDResult rule = rules.get(i);
		TableItem ti = new TableItem(rulesTable, SWT.NULL);
		ti.setText(new String[] { rule.num_matches+"/"+(rule.num_matches+rule.num_counter), rule.desc });
	}
	rulesTable.layout();
}
 
开发者ID:aserg-ufmg,项目名称:RefDiff,代码行数:10,代码来源:RulesView.java

示例8: handleUpdateData

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
private void handleUpdateData ( final int index, final Map<String, List<Double>> values, final List<ValueInformation> valueInformation )
{
    // FIXME: implement faster
    final int len = valueInformation.size ();
    for ( int i = 0; i < len; i++ )
    {
        final TableItem item = this.table.getItem ( i + index );

        final double quality = valueInformation.get ( i ).getQuality ();
        final double manual = valueInformation.get ( i ).getManualPercentage ();

        item.setText ( 0, String.format ( Messages.QueryDataView_Format_Index, index + i ) );
        item.setText ( 1, String.format ( Messages.QueryDataView_Format_Quality, quality ) );
        item.setText ( 2, String.format ( Messages.QueryDataView_Format_Manual, manual ) );

        for ( int j = 0; j < this.colNames.length; j++ )
        {
            final List<Double> value = values.get ( this.colNames[j] );
            item.setText ( j + FIX_FRONT_COLS, getValueString ( value.get ( i ) ) );
        }

        item.setText ( this.colNames.length + FIX_FRONT_COLS, "" + valueInformation.get ( i ).getSourceValues () ); //$NON-NLS-1$
        item.setText ( this.colNames.length + FIX_FRONT_COLS + 1, String.format ( Messages.QueryDataView_InfoFormat, valueInformation.get ( i ).getStartTimestamp (), valueInformation.get ( i ).getEndTimestamp () ) );

        if ( quality < 0.33 )
        {
            item.setBackground ( this.invalidColor );
        }
        else
        {
            item.setBackground ( null );
        }

    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:36,代码来源:QueryDataView.java

示例9: setDataSize

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
private void setDataSize ( final int entries, final Set<String> valueTypes )
{
    clearDataSize ();

    this.colNames = valueTypes.toArray ( new String[0] );
    for ( final String valueType : valueTypes )
    {
        final TableColumn col = new TableColumn ( this.table, SWT.NONE );
        col.setText ( valueType );
        col.setWidth ( 100 );
        col.setAlignment ( SWT.RIGHT );
        this.columns.put ( valueType, col );
    }

    this.countCol = new TableColumn ( this.table, SWT.NONE );
    this.countCol.setText ( Messages.QueryDataView_ColValues );
    this.countCol.setWidth ( 40 );

    this.infoCol = new TableColumn ( this.table, SWT.NONE );
    this.infoCol.setText ( Messages.QueryDataView_ColInfo );
    this.infoCol.setWidth ( 150 );

    this.table.clearAll ();
    this.table.setItemCount ( entries );

    for ( int i = 0; i < entries; i++ )
    {
        final TableItem item = this.table.getItem ( i );
        item.setBackground ( this.invalidColor );
        item.setText ( 0, String.format ( Messages.QueryDataView_Format_Index, i ) );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:33,代码来源:QueryDataView.java

示例10: appendBlankRowToTable

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
private static void appendBlankRowToTable(Table table, TableItem item,
		int index) {

	item.setText(new String[] { String.format("%d", index), "Element name",
			"Action keyword", "", "Selector value" });

	TableEditor keywordChoiceEditor = new TableEditor(table);
	CCombo keywordChoiceCombo = new CCombo(table, SWT.NONE);
	keywordChoiceCombo.setText("Choose..");
	for (String keyword : keywordTable.keySet()) {
		keywordChoiceCombo.add(keyword);
	}
	// NOTE: none of options is initially selected
	keywordChoiceEditor.grabHorizontal = true;
	int keywordChoiceColumn = 2;
	keywordChoiceCombo.setData("column", keywordChoiceColumn);
	keywordChoiceCombo.setData("item", item);
	keywordChoiceEditor.setEditor(keywordChoiceCombo, item,
			keywordChoiceColumn);
	keywordChoiceCombo.addModifyListener(new keywordChoiceListener());

	TableEditor selectorChoiceEditor = new TableEditor(table);
	CCombo selectorChoiceCombo = new CCombo(table, SWT.NONE);
	selectorChoiceCombo.setText("Choose");
	for (String locator : selectorFromSWD.values()) {
		selectorChoiceCombo.add(locator);
	}
	// NOTE: none of options is initially selected
	selectorChoiceEditor.grabHorizontal = true;
	int selectorChoiceColumn = 3;
	selectorChoiceCombo.setData("item", item);
	selectorChoiceCombo.setData("column", selectorChoiceColumn);
	selectorChoiceEditor.setEditor(selectorChoiceCombo, item,
			selectorChoiceColumn);
	selectorChoiceCombo.addModifyListener(new selectorChoiceListener());
	return;
}
 
开发者ID:sergueik,项目名称:SWET,代码行数:38,代码来源:TableEditorEx.java

示例11: loadData

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
private void loadData() {
	if (inputFields != null) {
		for (String field : inputFields) {
			TableItem tableItem=new TableItem(table, SWT.NONE);
			tableItem.setText(0,field);
			tableItem.setText(1,fieldMap.get(field).getSimpleName());
		}
	}
	if(table.getItemCount()==0){
		searchTextBox.setEnabled(false);
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:13,代码来源:AvailableFieldsComposite.java

示例12: setTableItems

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
@Override
protected void setTableItems(TableItem item, Book b) {
    super.setTableItems(item, b);

    int index = 0;
    for (TableColumn i : tableColumns) {
        BookTableColumn o = (BookTableColumn) i.getData();
        if (o == BookTableColumn.File) {
            item.setImage(getFileImage(b));
            item.setText("");
        }
    }
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:14,代码来源:BookTable.java

示例13: addAclTableItem

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
public TableItem addAclTableItem(ACL acl) {

        final Table table = getTable();

        final TableItem item = new TableItem(table, SWT.NONE);
        item.setData("ACL", acl);
        Id id = acl.getId();

        int aclPerms = acl.getPerms();
        boolean hasAll = ((aclPerms & ZooDefs.Perms.ALL) == ZooDefs.Perms.ALL);

        item.setText(0, id.getScheme());
        item.setText(1, id.getId());

        for (final int perm : PERMS) {
            final int permColumnIndex = getPermissionColumnIndex(perm);
            TableEditor permCheckBoxTableEditor = new TableEditor(table);
            setItemPermTableEditor(item, perm, permCheckBoxTableEditor);

            final Button permCheckBox = new Button(table, SWT.CHECK);

            boolean hasPerm = ((aclPerms & perm) == perm);
            permCheckBox.setSelection(hasPerm);
            permCheckBox.setEnabled(!hasAll || (hasAll && perm == ZooDefs.Perms.ALL));

            permCheckBox.addSelectionListener(new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {

                    if (perm == ZooDefs.Perms.ALL) {
                        for (int subPerm : PERMS) {
                            if (subPerm == ZooDefs.Perms.ALL) {
                                continue;
                            }

                            Button subPermCheckBox = getItemPermCheckBox(item, subPerm);
                            boolean allIsSelected = permCheckBox.getSelection();
                            if (allIsSelected) {
                                subPermCheckBox.setSelection(true);
                            }
                            subPermCheckBox.setEnabled(!allIsSelected);
                        }
                    }

                    fireOrchestrationChange();
                }

            });

            permCheckBox.pack();
            permCheckBoxTableEditor.minimumWidth = permCheckBox.getSize().x;
            permCheckBoxTableEditor.horizontalAlignment = SWT.CENTER;
            permCheckBoxTableEditor.setEditor(permCheckBox, item, permColumnIndex);

        }

        return item;
    }
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:60,代码来源:ZnodeAclComposite.java

示例14: populateDialog

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
/**
 * This helper method puts the step configuration stored in the meta object
 * and puts it into the dialog controls.
 */
private void populateDialog() {
    wStepname.selectAll();

    if (meta.getEndpoint() != null) {
        m_wEndpoint.setText(meta.getEndpoint());
    }
    if(meta.getTunnelEndpoint() != null) {
        m_wTunnelEndpoint.setText(meta.getTunnelEndpoint());
    }
    if (meta.getAccessId() != null) {
        m_wAccessId.setText(meta.getAccessId());
    }
    if (meta.getAccessKey() != null) {
        m_wAccessKey.setText(meta.getAccessKey());
    }
    if (meta.getProjectName() != null) {
        m_wProjectName.setText(meta.getProjectName());
    }
    if (meta.getTableName() != null) {
        m_wTableName.setText(meta.getTableName());
    }
    if (meta.getPartition() != null) {
        m_wPartition.setText(meta.getPartition());
    }
    m_wTruncate.setSelection(meta.isTruncate());

    if (meta.getOdpsFields() != null && meta.getStreamFields() != null) {
        for (int i = 0; i < meta.getOdpsFields().size(); i++) {
            OdpsField odpsField = meta.getOdpsFields().get(i);
            String streamField = meta.getStreamFields().get(i);
            TableItem item = m_wFieldsTable.table.getItem(i);
            if (odpsField != null) {
                if (odpsField.getName() != null)
                    item.setText(1, odpsField.getName());
                if (streamField != null)
                    item.setText(2, streamField);
            }
        }
    }
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:45,代码来源:OdpsOutputDialog.java

示例15: getFields

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
private void getFields(OdpsOutputMeta meta) {
    if (!Const.isEmpty(m_wEndpoint.getText()) && !Const.isEmpty(m_wAccessId.getText()) && !Const
        .isEmpty(m_wAccessKey.getText()) && !Const.isEmpty(m_wProjectName.getText()) && !Const
        .isEmpty(m_wTableName.getText())) {

        TableSchema schema = MaxcomputeUtil
            .getTableSchema(new AliyunAccount(m_wAccessId.getText(), m_wAccessKey.getText()),
                m_wEndpoint.getText(), m_wProjectName.getText(), m_wTableName.getText());

        List<Column> columns = schema.getColumns();
        List<OdpsField> odpsFields = new ArrayList<OdpsField>();
        for (int i = 0; i < columns.size(); i++) {
            OdpsField field = new OdpsField();
            field.setName(columns.get(i).getName());
            field.setType(columns.get(i).getType().name());
            field.setComment(columns.get(i).getCategoryLabel());
            odpsFields.add(field);
        }

        meta.setOdpsFields(odpsFields);
        RowMetaInterface r = null;
        try {
            r = transMeta.getPrevStepFields(stepname);
        } catch (KettleStepException e) {
            logError(e.getMessage(), e);
        }

        if (r != null) {
            logBasic("prev step fields: " + Arrays.toString(r.getFieldNames()));
            meta.setStreamFields(Arrays.asList(r.getFieldNames()));
        } else {
            logBasic("prev step fields empty!!!");
            meta.setStreamFields(new ArrayList<String>());
        }

        if (meta.getOdpsFields() != null && meta.getStreamFields() != null) {
            m_wFieldsTable.table.clearAll();
            m_wFieldsTable.table.setItemCount(meta.getOdpsFields().size());
            for (int i = 0; i < meta.getOdpsFields().size(); i++) {
                OdpsField odpsField = meta.getOdpsFields().get(i);
                String streamField = "";
                if (meta.getStreamFields().size() > i) {
                    streamField = meta.getStreamFields().get(i);
                }
                TableItem item = m_wFieldsTable.table.getItem(i);
                if (odpsField != null) {
                    if (odpsField.getName() != null)
                        item.setText(1, odpsField.getName());
                    if (streamField != null)
                        item.setText(2, streamField);
                }
            }
        }

    } else {
        // pop up an error dialog
        String missingConDetails = "";
        if (Const.isEmpty(m_wEndpoint.getText())) {
            missingConDetails += " odps endpoint";
        }
        if (Const.isEmpty(m_wAccessId.getText())) {
            missingConDetails += " accessId";
        }
        if (Const.isEmpty(m_wAccessKey.getText())) {
            missingConDetails += " accessKey";
        }
        if (Const.isEmpty(m_wProjectName.getText())) {
            missingConDetails += " project name";
        }
        if (Const.isEmpty(m_wTableName.getText())) {
            missingConDetails += " table name";
        }
        ShowMessageDialog smd = new ShowMessageDialog(shell, SWT.ICON_WARNING | SWT.OK,
            BaseMessages.getString(PKG, "ODPS.ErrorMessage.MissingConnectionDetails.Title"),
            BaseMessages.getString(PKG, "ODPS.ErrorMessage.MissingConnectionDetails",
                missingConDetails));
        smd.open();
    }
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:80,代码来源:OdpsOutputDialog.java


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