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