本文整理汇总了Java中org.eclipse.swt.widgets.Table.getItems方法的典型用法代码示例。如果您正苦于以下问题:Java Table.getItems方法的具体用法?Java Table.getItems怎么用?Java Table.getItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Table
的用法示例。
在下文中一共展示了Table.getItems方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getZnodeAclFromTable
import org.eclipse.swt.widgets.Table; //导入方法依赖的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);
}
示例2: selectAllInTable
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
private void selectAllInTable(TableViewer debugDataViewer, TableCursor tableCursor){
Table table = debugDataViewer.getTable();
TableItem[] tableItems = table.getItems();
int recordCount = 0;
for(int rowIndex = 0; rowIndex < tableItems.length; rowIndex++){
TableItem tableItem = tableItems[rowIndex];
for(int colIndex = 1; colIndex <= table.getColumnCount(); colIndex++){
if(StringUtils.containsIgnoreCase(tableItem.getText(colIndex), findText.getText())){
label.setVisible(false);
tableItem.setBackground(colIndex, Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY));
recordCount++;
}
}
findColIndex=1;
}
findRowIndex = 0;
findColIndex = 0;
if(recordCount > 0){
label.setVisible(true);
label.setText("Match count - " + recordCount);
}else{ label.setVisible(false); }
}
示例3: isExistInTable
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
private boolean isExistInTable(TableViewer tableViewer, String text){
boolean isDataExist = false;
Table table = tableViewer.getTable();
TableItem[] tableItems = table.getItems();
for(int i=0;i<tableItems.length;i++){
TableItem tableItem = tableItems[i];
for(int j=1;j <= table.getColumnCount()-1;j++){
if(StringUtils.containsIgnoreCase(tableItem.getText(j), text)){
label.setVisible(false);
isDataExist = true;
return isDataExist;
}else{
label.setVisible(true);
label.setText(labelText);
isDataExist = false;
}
}
}
return isDataExist;
}
示例4: highlightInvalidRowWithRedColor
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
/**
* @param gridRow
* @param item
* @param table
* @param componentType
*
* This method highlight invalid data row with red color.
*
*/
public void highlightInvalidRowWithRedColor(GridRow gridRow,TableItem item,Table table,String componentType ){
this.table=table;
if(item==null){
for(TableItem tableItem:table.getItems()){
setRedColorOnTableRowBasedOnInvalidData((GridRow)tableItem.getData(), componentType, tableItem);
}
}else{
setRedColorOnTableRowBasedOnInvalidData(gridRow, componentType, item);
gridRow=null;
}
}
示例5: forwardTableTraverse
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
private void forwardTableTraverse(TableViewer debugDataViewer, TableCursor tableCursor){
TableItem previousSelectedTableItem = null;
if(debugDataViewer.getData("SELECTED_ROW_INDEX")!=null){
previousSelectedTableItem = debugDataViewer.getTable().getItem((int) debugDataViewer.getData("SELECTED_ROW_INDEX"));
findColIndex++;
}
Table table = debugDataViewer.getTable();
TableItem[] tableItems = table.getItems();
if(findColIndex == prevColSelection && findRowIndex == prevRowSelection){
findColIndex++;
}
if(findRowIndex < 0){
findRowIndex = 0;
}
for(;findRowIndex<tableItems.length;){
TableItem tableItem = tableItems[findRowIndex];
for(;findColIndex <= table.getColumnCount();findColIndex++){
if(StringUtils.containsIgnoreCase(tableItem.getText(findColIndex), findText.getText())){
if(prevColSelection > 0){
previousSelectedTableItem.setBackground(prevColSelection, Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
}
label.setVisible(false);
table.showItem(tableItem);
table.showColumn(table.getColumn(findColIndex));
tableCursor.setSelection(findRowIndex, findColIndex);
tableCursor.setVisible(false);
tableItem.setBackground(findColIndex, Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY));
debugDataViewer.setData("SELECTED_ROW_INDEX", findRowIndex);
debugDataViewer.setData("SEELCTED_COLUMN_INDEX", findColIndex);
prevColSelection = findColIndex;
return;
}
}
findRowIndex++;
findColIndex=1;
if(findRowIndex >= tableItems.length){ findRowIndex = 0;}
}
}
示例6: reverseTableTraverse
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
private void reverseTableTraverse(TableViewer debugDataViewer, TableCursor tableCursor){
TableItem previousSelectedTableItem = null;
if(debugDataViewer.getData("SELECTED_ROW_INDEX")!=null){
previousSelectedTableItem = debugDataViewer.getTable().getItem((int) debugDataViewer.getData("SELECTED_ROW_INDEX"));
findColIndex -= 1;
}
if(findRowIndex < 0){
findRowIndex = debugDataViewer.getTable().getItems().length - 1;
}
Table table = debugDataViewer.getTable();
TableItem[] tableItems = table.getItems();
for(; findRowIndex >=0; findRowIndex--){
TableItem tableItem = tableItems[findRowIndex];
for( ; findColIndex > 0 ;findColIndex--){
if(StringUtils.containsIgnoreCase(tableItem.getText(findColIndex), findText.getText())){
if(prevColSelection > 0){
previousSelectedTableItem.setBackground(prevColSelection, Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
}
label.setVisible(false);
table.showItem(tableItem);
table.showColumn(table.getColumn(findColIndex));
tableCursor.setSelection(findRowIndex, findColIndex);
tableCursor.setVisible(false);
tableItem.setBackground(findColIndex,Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY));
if(findColIndex<=0){debugDataViewer.setData("SELECTED_ROW_INDEX", findRowIndex-1);}else{
debugDataViewer.setData("SELECTED_ROW_INDEX", findRowIndex);
}
debugDataViewer.setData("SEELCTED_COLUMN_INDEX", findColIndex);
prevColSelection = findColIndex;
prevRowSelection = findRowIndex;
return ;
}
}
if(findColIndex <= 0){ findColIndex = table.getColumnCount();}
if(findRowIndex == 0){ findRowIndex = tableItems.length; }
}
}
示例7: clearTableItemBgColor
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
private void clearTableItemBgColor(TableViewer debugDataViewer){
if(debugDataViewer == null){
return;
}
Table table = debugDataViewer.getTable();
TableItem[] tableItems = table.getItems();
for(int i=0;i<tableItems.length;i++){
TableItem tableItem = tableItems[i];
for(int j=1;j <= table.getColumnCount()-1;j++){
tableItem.getText(j);
tableItem.setBackground(j, Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
}
}
}
示例8: appendRowToTable
import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
private static void appendRowToTable(Table table, List<String> stepIds) {
TableItem[] tableItems = table.getItems();
int cnt = 0;
for (String stepId : stepIds) {
// get element data
TableItem tableItem = tableItems[cnt];
Map<String, String> elementData = testData.get(stepId);
String selectorChoice = selectorFromSWD
.get(elementData.get("ElementSelectedBy"));
String selectorValue = elementData
.get(elementData.get("ElementSelectedBy"));
// Append row into the TableEditor
tableItem.setText(new String[] { elementData.get("ElementStepNumber"),
elementData.get("ElementCodeName"), String.format("Action %d", cnt),
selectorChoice, selectorValue });
// some columns need to be converted to selects
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", tableItem);
keywordChoiceEditor.setEditor(keywordChoiceCombo, tableItem,
keywordChoiceColumn);
keywordChoiceCombo.addModifyListener(new keywordChoiceListener());
TableEditor selectorChoiceEditor = new TableEditor(table);
CCombo selectorChoiceCombo = new CCombo(table, SWT.NONE);
for (String locator : selectorFromSWD.values()) {
selectorChoiceCombo.add(locator);
}
int currentSelector = new ArrayList<String>(selectorFromSWD.values())
.indexOf(selectorFromSWD.get(elementData.get("ElementSelectedBy")));
selectorChoiceCombo.select(currentSelector);
selectorChoiceEditor.grabHorizontal = true;
int selectorChoiceColumn = 3;
selectorChoiceCombo.setData("item", tableItem);
selectorChoiceCombo.setData("column", selectorChoiceColumn);
selectorChoiceEditor.setEditor(selectorChoiceCombo, tableItem,
selectorChoiceColumn);
selectorChoiceCombo.addModifyListener(new selectorChoiceListener());
cnt = cnt + 1;
}
return;
}