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


Java TableItem类代码示例

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


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

示例1: checkSelection

import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
private void checkSelection(final Table table) {
    TableItem[] items = table.getSelection();
    if (items != null && items.length > 0) {
        for (TableItem item: items) {
            Plugin plugin = (Plugin) item.getData();
            if (plugin != null) {
                if (source.stream().anyMatch(p -> p.equals(plugin))) {
                    btnSelect.setEnabled(true);
                } else if (target.stream().anyMatch(p -> p.equals(plugin))) {
                    btnDeselect.setEnabled(true);
                }
                return;
            }
        }
    }
    btnSelect.setEnabled(false);
    btnDeselect.setEnabled(false);
}
 
开发者ID:gluonhq,项目名称:ide-plugins,代码行数:19,代码来源:PluginsSWT.java

示例2: getConditionalOperatorModifyListener

import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
/**
 * Gets the conditional operator modify listener.
 * 
 * @param conditionsList
 *            the conditions list
 * @param fieldsAndTypes
 *            the fields and types
 * @param fieldNames
 *            the field names
 * @param saveButton
 *            the save button
 * @param displayButton
 *            the display button
 * @return the conditional operator modify listener
 */
public ModifyListener getConditionalOperatorModifyListener(final List<Condition> conditionsList, 
		final Map<String, String> fieldsAndTypes, final String[] fieldNames, final Button saveButton, final Button displayButton) {
	ModifyListener listener = new ModifyListener() {
		
		@Override
		public void modifyText(ModifyEvent e) {
			CCombo source = (CCombo) e.getSource();
			TableItem tableItem = getTableItem(source);
			Condition condition = (Condition) tableItem.getData();
			if (tableItem.getData(FilterConstants.VALUE2TEXTBOX) != null) {
				Text text = (Text) tableItem.getData(FilterConstants.VALUE2TEXTBOX);
				enableAndDisableValue2TextBox(condition.getConditionalOperator(), text);
			}
			processConditionalOperator(source, conditionsList, fieldsAndTypes, fieldNames, saveButton, displayButton);
		}
	};
	return listener;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:34,代码来源:FilterHelper.java

示例3: getZnodeAclFromTable

import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
public List<ACL> getZnodeAclFromTable() {

        Table table = getTable();
        TableItem[] items = table.getItems();

        Set<ACL> aclSet = new HashSet<ACL>(items.length);
        for (TableItem item : items) {

            int perms = getItemPerms(item);
            Id id = getItemId(item);

            ACL acl = new ACL(perms, id);
            aclSet.add(acl);
        }
        return new ArrayList<ACL>(aclSet);
    }
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:17,代码来源:ZnodeAclComposite.java

示例4: tableSelectionChanged

import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
private void tableSelectionChanged(TableItem item) {

        Button setIdButton = getSetIdButton();
        setIdButton.setEnabled(SCHEME_DIGEST.equals(item.getText(TABLE_COLUMN_SCHEME)));

        Button removeButton = getRemoveButton();
        removeButton.setEnabled(item != null);

        initSchemeTableEditor(item);
        initIdTableEditor(item);

        Control idEditor = _IdTableEditor.getEditor();
        if (idEditor != null && !idEditor.isDisposed()) {
            idEditor.setFocus();
        }
    }
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:17,代码来源:ZnodeAclComposite.java

示例5: getItemPerms

import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
private int getItemPerms(TableItem item) {
    int perms = 0;
    Button allCheckBox = getItemPermCheckBox(item, ZooDefs.Perms.ALL);
    if (allCheckBox.getSelection()) {
        perms = ZooDefs.Perms.ALL;
    }
    else {
        for (int perm : PERMS) {
            Button permCheckBox = getItemPermCheckBox(item, perm);
            if (permCheckBox.getSelection()) {
                perms |= perm;
            }
        }
    }

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

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

    packTable(table, PROPERTIES_COLUMN_WIDTHS);

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

示例7: 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

示例8: 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

示例9: 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

示例10: setVisible

import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
@Override
public void setVisible ( final boolean visible )
{
    super.setVisible ( visible );

    if ( visible )
    {
        final Object[] data = this.mergeController.makeKnownFactories ().toArray ();
        this.factoriesViewer.setInput ( data );

        final Set<String> factories = this.mergeController.getIgnoreFactories ();

        // select all
        for ( final TableItem item : this.factoriesViewer.getTable ().getItems () )
        {
            item.setChecked ( factories.contains ( item.getData () ) );
        }

        // set ignore fields
        this.fieldsViewer.setInput ( this.mergeController.getIgnoreFields () );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:23,代码来源:IgnorePage.java

示例11: getFieldNameModifyListener

import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
/**
 * Gets the field name modify listener.
 * 
 * @param tableViewer
 *            the table viewer
 * @param conditionsList
 *            the conditions list
 * @param fieldsAndTypes
 *            the fields and types
 * @param fieldNames
 *            the field names
 * @param saveButton
 *            the save button
 * @param displayButton
 *            the display button
 * @return the field name modify listener
 */
public ModifyListener getFieldNameModifyListener(final TableViewer tableViewer, final List<Condition> conditionsList,
		final Map<String, String> fieldsAndTypes, final String[] fieldNames, final Button saveButton, final Button displayButton) {
	ModifyListener listener = new ModifyListener() {
		
		@Override
		public void modifyText(ModifyEvent e) {
			CCombo source = (CCombo) e.getSource();
			int index = (int) source.getData(FilterConstants.ROW_INDEX);
			Condition filterConditions = conditionsList.get(index);
			String fieldName = source.getText();
			filterConditions.setFieldName(fieldName);
			
			if(StringUtils.isNotBlank(fieldName)){
				String fieldType = fieldsAndTypes.get(fieldName);
				TableItem item = tableViewer.getTable().getItem(index);
				CCombo conditionalCombo = (CCombo) item.getData(FilterConditionsDialog.CONDITIONAL_OPERATORS);
				if(conditionalCombo != null && StringUtils.isNotBlank(fieldType)){
					conditionalCombo.setText(filterConditions.getConditionalOperator());
					conditionalCombo.setItems(FilterHelper.INSTANCE.getTypeBasedOperatorMap().get(fieldType));
					new AutoCompleteField(conditionalCombo, new CComboContentAdapter(), conditionalCombo.getItems());
				}
			}
			validateCombo(source);
			toggleSaveDisplayButton(conditionsList, fieldsAndTypes, fieldNames, saveButton, displayButton);
		}
	};
	return listener;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:46,代码来源:FilterHelper.java

示例12: selectedMonitors

import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
public List<DecoratedMonitor> selectedMonitors ()
{
    if ( this.tableRef.get ().getTable ().getSelectionCount () == 0 )
    {
        return new ArrayList<DecoratedMonitor> ();
    }
    final List<DecoratedMonitor> result = new ArrayList<DecoratedMonitor> ();
    for ( final TableItem row : this.tableRef.get ().getTable ().getSelection () )
    {
        if ( row.getData () instanceof DecoratedMonitor )
        {
            result.add ( (DecoratedMonitor)row.getData () );
        }
    }
    return result;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:17,代码来源:MonitorsViewTable.java

示例13: deleteFile

import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
/**
 * Delete the currently selected files.
 */
protected void deleteFile() {
	TableItem[] selection = fileTable.getSelection();

	String message = (selection.length > 1) ?
			textBundle.get("DeletePromptMultipleFiles") : //$NON-NLS-1$
			textBundle.get("DeletePromptSingleFile") //$NON-NLS-1$
			+ textBundle.get("DeletePromptTrailer"); //$NON-NLS-1$
	int answer = SwtUtil.showYesNoDialog(shell,
			textBundle.get("DeletePromptTitle"), //$NON-NLS-1$
			message);
	if (answer == SWT.YES) {
		for (int i=0; i<selection.length; i++) {
			TableItem tableItem = selection[i];
			FileEntry fileEntry = (FileEntry) tableItem.getData();
			fileEntry.delete();
		}
		fillFileTable(currentFileList);
		saveToolItem.setEnabled(true);
	}
}
 
开发者ID:AppleCommander,项目名称:AppleCommander,代码行数:24,代码来源:DiskExplorerTab.java

示例14: 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

示例15: createConvertor

import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
/**
 * @param context
 * @return
 * @throws CoreException
 */
public OffLinePostConversionImpl createConvertor(ResourceContext context) throws CoreException {
	List<BuildPolicy> selected = new ArrayList<BuildPolicy>();
	TableItem[] items = buildPoliciesViewer.getTable().getItems();
	for (TableItem tableItem : items) {
		if (tableItem.getChecked()) {
			selected.add((BuildPolicy) tableItem.getData());
		}
	}
	BuildPolicy[] policies = new BuildPolicy[selected.size()];
	selected.toArray(policies);
 
	ResourceContext ctx = new ResourceContext(
			context.getContainerFullPath(), 
			gcc.getRoot(), 
			gcc.getPackageFragment(), 
			gcc.getClassName(),
			gcc.getExtendedClassName(),
			context.getSelectedFile(), 
			gcc.getMode(), 
			context.getClassExtension());
	return new OffLinePostConversionImpl(ctx, policies, Integer.parseInt(timeoutText.getText()));
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:28,代码来源:OfflineGW4ETestUIPage.java


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