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


Java Table.setSelection方法代码示例

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


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

示例1: deleteRow

import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
private void deleteRow(){

		Table table = mappingTableViewer.getTable();
		setValueForCellEditor();
		int selectionIndex = table.getSelectionIndex();
		int[] indexs = table.getSelectionIndices();
		if (selectionIndex == -1) {
			WidgetUtility.errorMessage("Select Rows to delete");
		} else {
			table.remove(indexs);
			int itemsRemoved=0;
			for (int index : indexs) {
				mappingTableItemList.remove(index-itemsRemoved);
				if(index-itemsRemoved-1 != -1){
					table.setSelection(index-itemsRemoved-1);
				}else{
					table.setSelection(0);
				}
				itemsRemoved++;
			}
			mappingTableViewer.refresh();
		}
		refreshButtonStatus();
	
	}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:26,代码来源:JoinMapDialog.java

示例2: deleteRow

import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
private void deleteRow()
{
	Table table = mappingTableViewer.getTable();
	setValueForCellEditor();
	int selectionIndex = table.getSelectionIndex();
	int[] indexs = table.getSelectionIndices();
	if (selectionIndex == -1) {
		WidgetUtility.errorMessage("Select Rows to delete");
	} else {
		table.remove(indexs);
		int itemsRemoved=0;
		for (int index : indexs) {
			mappingTableItemList.remove(index-itemsRemoved);
			if(index-itemsRemoved-1 != -1){
				table.setSelection(index-itemsRemoved-1);
			}else{
				table.setSelection(0);
			}
			itemsRemoved++;
		}
		mappingTableViewer.refresh();
	}
	component.setLatestChangesInSchema(false);
	refreshButtonStatus();

}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:27,代码来源:LookupMapDialog.java

示例3: addNewItem

import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
private void addNewItem() {
    ACL acl = new ACL();
    acl.setId(ZooDefs.Ids.ANYONE_ID_UNSAFE);
    acl.setPerms(ZooDefs.Perms.ALL);

    TableItem newItem = addAclTableItem(acl);
    Table table = getTable();
    table.setSelection(newItem);
    tableSelectionChanged(newItem);

    fireOrchestrationChange();
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:13,代码来源:ZnodeAclComposite.java

示例4: searchInLogs

import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
private void searchInLogs(int side) {
	int searchIndex = currentFoundIndex + side;
	if (searchIndex < 0 || searchIndex > foundIndexes.size())
		return;
	
	currentFoundIndex = searchIndex;
	Table table = tableViewer.getTable();
	
	table.setSelection(foundIndexes.get(currentFoundIndex));
	table.setFocus();

	// Disable "previous" if is the beginning
	if (foundIndexes.get(currentFoundIndex) == foundIndexes.get(0))
		previousSearch.setEnabled(false);
	else
		previousSearch.setEnabled(true);

	// Disable "next" if is the end
	if (foundIndexes.get(currentFoundIndex) == foundIndexes.get(foundIndexes.size() - 1))
		nextSearch.setEnabled(false);
	else
		nextSearch.setEnabled(true);
	
	infoSearch.setText((currentFoundIndex + 1) + "/" + foundIndexes.size());

	// To force components resizing if needed
	compositeSearch.layout();
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:29,代码来源:EngineLogView.java

示例5: mouseAction

import org.eclipse.swt.widgets.Table; //导入方法依赖的package包/类
@Override
public void mouseAction(PropertyDialogButtonBar propertyDialogButtonBar,
		ListenerHelper helpers, Event event, Widget... widgets) {
	 Table table=(Table)widgets[0];
	 Label label=(Label)event.widget;
	 Event e = new Event();
        e.item = (TableItem) label.getData("_TABLEITEM");
        table.setSelection(new TableItem[] { (TableItem) e.item });
        table.notifyListeners(SWT.Selection, e);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:11,代码来源:MouseDownSchemaGridListener.java


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