當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。