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


Java TableItem.setData方法代码示例

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


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

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

示例2: checkIfXPathIsDuplicate

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
private void checkIfXPathIsDuplicate( ) {
	Text loopXpathQueryTextBox=(Text)table.getData();
	String loopXPathQuery=loopXpathQueryTextBox.getText();
	Set<Path> setToCheckDuplicates= new HashSet<Path>();
	Set<String> uniqueName=new HashSet<>();
	for(TableItem tableItem:table.getItems()){
		Path xPathColumn=makeXPathAbsoluteIfNot(tableItem.getText(2), loopXPathQuery);
		if(!uniqueName.add(tableItem.getText(0))){
			tableItem.setData(Constants.ERROR_MESSAGE,FIELD_IS_DUPLICATE);
			setRedColor(tableItem);
		}
		else if(!setToCheckDuplicates.add(xPathColumn)){
			tableItem.setData(Constants.ERROR_MESSAGE,Messages.X_PATH_IS_DUPLICATE);
			setRedColor(tableItem);
		}
		else{
			tableItem.setData(Constants.ERROR_MESSAGE,"");
			setBlackColor(tableItem);
		}
	}	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:22,代码来源:SchemaRowValidation.java

示例3: addTextBoxInTable

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
private Text addTextBoxInTable(TableViewer tableViewer, TableItem tableItem, String textBoxName, 
		String valueTextPane, String editorName, int columnIndex, Listener listener) {
	final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
	buttonPane.setLayout(new FillLayout());
	final Text text = new Text(buttonPane, SWT.NONE);
	text.addListener(SWT.Modify, listener);
	text.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
	tableItem.setData(textBoxName, text);
	tableItem.setData(valueTextPane, buttonPane);
	//text.addModifyListener(FilterHelper.INSTANCE.getTextModifyListener());
	
	final TableEditor editor = new TableEditor(tableViewer.getTable());
	editor.grabHorizontal = true;
	editor.grabVertical = true;
	editor.setEditor(buttonPane, tableItem, columnIndex);
	editor.layout();
	text.setData(editorName, editor);
	return text;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:20,代码来源:FilterConditionsDialog.java

示例4: addComboInTable

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
private CCombo addComboInTable(TableViewer tableViewer, TableItem tableItem, String comboName, String comboPaneName, 
		String editorName, int columnIndex,	String[] relationalOperators, SelectionListener dropDownSelectionListener,
		ModifyListener modifyListener,FocusListener focusListener) {
	final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
	buttonPane.setLayout(new FillLayout());
	final CCombo combo = new CCombo(buttonPane, SWT.NONE);
	combo.setItems(relationalOperators);
	combo.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
	tableItem.setData(comboName, combo);
	tableItem.setData(comboPaneName, buttonPane);
	combo.addSelectionListener(dropDownSelectionListener);
	combo.addModifyListener(modifyListener);
	combo.addFocusListener(focusListener);
	new AutoCompleteField(combo, new CComboContentAdapter(), combo.getItems());
	final TableEditor editor = new TableEditor(tableViewer.getTable());
	editor.grabHorizontal = true;
	editor.grabVertical = true;
	editor.setEditor(buttonPane, tableItem, columnIndex);
	editor.layout();
	combo.setData(editorName, editor);
	return combo;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:23,代码来源:FilterConditionsDialog.java

示例5: addButtonInTable

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
private void addButtonInTable(TableViewer tableViewer, TableItem tableItem, String columnName, 
		String buttonPaneName, String editorName, int columnIndex, SelectionListener buttonSelectionListener,
		ImagePathConstant imagePath) {
	final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
	buttonPane.setLayout(new FillLayout());
	final Button button = new Button(buttonPane, SWT.NONE);
	//button.setText(columnName);
	button.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
	tableItem.setData(columnName, button);
	tableItem.setData(buttonPaneName, buttonPane);
	button.addSelectionListener(buttonSelectionListener);
	button.setImage(imagePath.getImageFromRegistry());
	
	final TableEditor editor = new TableEditor(tableViewer.getTable());
	editor.grabHorizontal = true;
	editor.grabVertical = true;
	editor.setEditor(buttonPane, tableItem, columnIndex);
	editor.layout();
	button.setData(editorName, editor);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:21,代码来源:FilterConditionsDialog.java

示例6: addCheckButtonInTable

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
private void addCheckButtonInTable(TableViewer tableViewer, TableItem tableItem, String columnName, 
		String groupPaneName, String editorName, int columnIndex, SelectionListener buttonSelectionListener) {
	final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
	buttonPane.setLayout(new FillLayout());
	final Button button = new Button(buttonPane, SWT.CHECK);
	button.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
	if(null != buttonSelectionListener){
		button.addSelectionListener(buttonSelectionListener);
	}
	tableItem.setData(columnName, button);
	tableItem.setData(groupPaneName, buttonPane);
	
	final TableEditor editor = new TableEditor(tableViewer.getTable());
	editor.grabHorizontal = true;
	editor.grabVertical = true;
	editor.setEditor(buttonPane, tableItem, columnIndex);
	editor.layout();
	button.setData(editorName, editor);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:20,代码来源:FilterConditionsDialog.java

示例7: getGroupCheckCellProvider

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
private CellLabelProvider getGroupCheckCellProvider(final TableViewer tableViewer, final List<Condition> conditionsList, 
		final Button btnAddGrp) {
	return new CellLabelProvider() {
		
		@Override
		public void update(ViewerCell cell) {
			final TableItem item = (TableItem) cell.getItem();
			// DO NOT REMOVE THIS CONDITION. The condition is return to
			// prevent multiple updates on single item
			if (item.getData("UPDATED3") == null) {
				item.setData("UPDATED3", TRUE);
			} else {
				return;
			}
			addCheckButtonInTable(tableViewer, item, GROUP_CHECKBOX, GROUP_CHECKBOX_PANE, GROUP_EDITOR, cell.getColumnIndex(), 
					FilterHelper.INSTANCE.checkButtonListener(tableViewer, conditionsList,btnAddGrp));
			item.addDisposeListener(new DisposeListener() {
				
				@Override
				public void widgetDisposed(DisposeEvent e) {
					Button groupButton = (Button) item.getData(GROUP_CHECKBOX);
					((TableEditor)groupButton.getData(GROUP_EDITOR)).dispose();
					groupButton.dispose();
					
					Composite composite = (Composite)item.getData(GROUP_CHECKBOX_PANE);
					composite.dispose();
				}
			});
		}
	};
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:32,代码来源:FilterConditionsDialog.java

示例8: getRemoveButtonCellProvider

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
private CellLabelProvider getRemoveButtonCellProvider(final TableViewer tableViewer, final List<Condition> conditionsList, 
		final Button btnAddGrp, final TreeMap<Integer, List<List<Integer>>> groupSelectionMap, final boolean isRemote) {
	return new CellLabelProvider() {
		
		@Override
		public void update(ViewerCell cell) {
			final TableItem item = (TableItem) cell.getItem();
			// DO NOT REMOVE THIS CONDITION. The condition is return to
			// prevent multiple updates on single item
			if (item.getData("UPDATED2") == null) {
				item.setData("UPDATED2", TRUE);
			} else {
				return;
			}
			if(OSValidator.isMac()){
				addButtonInTable(tableViewer, item, REMOVE, REMOVE_BUTTON_PANE, REMOVE_EDITOR, cell.getColumnIndex(), 
						removeButtonListener(tableViewer, conditionsList, dummyList,groupSelectionMap, btnAddGrp,isRemote), 
						ImagePathConstant.MAC_DELETE_BUTTON);
			}else{
				addButtonInTable(tableViewer, item, REMOVE, REMOVE_BUTTON_PANE, REMOVE_EDITOR, cell.getColumnIndex(), 
						removeButtonListener(tableViewer, conditionsList, dummyList,groupSelectionMap, btnAddGrp,isRemote), 
						ImagePathConstant.DELETE_BUTTON);
			}
			item.addDisposeListener(new DisposeListener() {
				
				@Override
				public void widgetDisposed(DisposeEvent e) {
					Button removeButton = (Button) item.getData(REMOVE);
					((TableEditor)removeButton.getData(REMOVE_EDITOR)).dispose();
					removeButton.dispose();
					
					Composite composite = (Composite)item.getData(REMOVE_BUTTON_PANE);
					composite.dispose();
				}
			});
		}
	};
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:39,代码来源:FilterConditionsDialog.java

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

示例10: setItemPermTableEditor

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
private void setItemPermTableEditor(TableItem item, int zooDefPerm, TableEditor tableEditor) {
    item.setData(String.valueOf(zooDefPerm), tableEditor);
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:4,代码来源:ZnodeAclComposite.java

示例11: getAddButtonCellProvider

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
private CellLabelProvider getAddButtonCellProvider(final TableViewer tableViewer, final List<Condition> conditionsList
		,final TreeMap<Integer, List<List<Integer>>> groupSelectionMap) {
	return new CellLabelProvider() {
		
		@Override
		public void update(ViewerCell cell) {
			final TableItem item = (TableItem) cell.getItem();
			// DO NOT REMOVE THIS CONDITION. The condition is return to
			// prevent multiple updates on single item
			if (item.getData("UPDATED1") == null) {
				item.setData("UPDATED1", TRUE);
			} else {
				return;
			}
			
			if(OSValidator.isMac()){
				addButtonInTable(tableViewer, item, ADD, ADD_BUTTON_PANE, ADD_EDITOR, cell.getColumnIndex(), 
						FilterHelper.INSTANCE.addButtonListener(tableViewer,conditionsList, dummyList,groupSelectionMap), 
						ImagePathConstant.MAC_ADD_BUTTON);
			}else{
				addButtonInTable(tableViewer, item, ADD, ADD_BUTTON_PANE, ADD_EDITOR, cell.getColumnIndex(), 
						FilterHelper.INSTANCE.addButtonListener(tableViewer,conditionsList, dummyList,groupSelectionMap), 
						ImagePathConstant.ADD_BUTTON);
			}
			
			item.addDisposeListener(new DisposeListener() {
				
				@Override
				public void widgetDisposed(DisposeEvent e) {
					Button addButton = (Button) item.getData(ADD);
					((TableEditor)addButton.getData(ADD_EDITOR)).dispose();
					addButton.dispose();
					
					Composite composite = (Composite)item.getData(ADD_BUTTON_PANE);
					composite.dispose();
				}
			});
		}
		
	};
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:42,代码来源:FilterConditionsDialog.java

示例12: setItemData

import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
private ChatParticipant
setItemData(
	TableItem		item )
{
	int index = buddy_table.indexOf(item);

	if ( index < 0 || index >= participants.size()){

		return( null );
	}

	ChatParticipant	participant = (BuddyPluginBeta.ChatParticipant)participants.get(index);

	item.setData( participant );

	item.setText(0, participant.getName( ftux_ok ));

	setProperties( item, participant );

	return( participant );
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:22,代码来源:BuddyPluginViewBetaChat.java


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