本文整理汇总了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);
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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();
}
});
}
};
}
示例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();
}
});
}
};
}
示例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;
}
示例10: setItemPermTableEditor
import org.eclipse.swt.widgets.TableItem; //导入方法依赖的package包/类
private void setItemPermTableEditor(TableItem item, int zooDefPerm, TableEditor tableEditor) {
item.setData(String.valueOf(zooDefPerm), tableEditor);
}
示例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();
}
});
}
};
}
示例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 );
}