當前位置: 首頁>>代碼示例>>Java>>正文


Java CheckboxTreeViewer.setSelection方法代碼示例

本文整理匯總了Java中org.eclipse.jface.viewers.CheckboxTreeViewer.setSelection方法的典型用法代碼示例。如果您正苦於以下問題:Java CheckboxTreeViewer.setSelection方法的具體用法?Java CheckboxTreeViewer.setSelection怎麽用?Java CheckboxTreeViewer.setSelection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.viewers.CheckboxTreeViewer的用法示例。


在下文中一共展示了CheckboxTreeViewer.setSelection方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: create

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
@Override
public void create() {
	super.create();

	// select the first checked element, or if none are checked, the first element
	CheckboxTreeViewer treeViewer= getTreeViewer();
	TreeItem[] items= treeViewer.getTree().getItems();
	if (items.length > 0) {
		Object revealedElement= items[0];

		for (int i= 0; i < items.length; i++) {
			if (items[i].getChecked()) {
				revealedElement= items[i].getData();
				break;
			}
		}
		treeViewer.setSelection(new StructuredSelection(revealedElement));
		treeViewer.reveal(revealedElement);
	}
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:21,代碼來源:SourceActionDialog.java

示例2: newFolderButtonPressed

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
protected void newFolderButtonPressed() {
    NewFolderDialog dialog= new NewFolderDialog(getShell(), fSelectedContainer);
    if (dialog.open() == Window.OK) {
        CheckboxTreeViewer treeViewer= fViewer;
        treeViewer.refresh(fSelectedContainer);
        Object createdFolder= dialog.getResult()[0];
        treeViewer.reveal(createdFolder);
        treeViewer.setChecked(createdFolder, true);
        treeViewer.setSelection(new StructuredSelection(createdFolder));
        updateOKStatus();
    }
}
 
開發者ID:iloveeclipse,項目名稱:filesync4eclipse,代碼行數:13,代碼來源:MultipleFolderSelectionDialog.java

示例3: down

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
public void down(List<?> checked, CheckboxTreeViewer tree) {
	if (checked.size() > 0) {
		setElements(reverse(moveUp(reverse(fFields), checked)), tree);
		tree.reveal(checked.get(checked.size() - 1));
	}
	tree.setSelection(new StructuredSelection(checked));
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:8,代碼來源:GenerateConstructorUsingFieldsContentProvider.java

示例4: up

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
public void up(List<?> checked, CheckboxTreeViewer tree) {
	if (checked.size() > 0) {
		setElements(moveUp(fFields, checked), tree);
		tree.reveal(checked.get(0));
	}
	tree.setSelection(new StructuredSelection(checked));
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:8,代碼來源:GenerateConstructorUsingFieldsContentProvider.java

示例5: move

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
private void move(Object element, CheckboxTreeViewer tree, int direction) {
	Object[] array= getContainingArray(element);
	int position= getElementPosition(element, array);
	Object temp= array[position];
	array[position]= array[position + direction];
	array[position + direction]= temp;
	tree.setSelection(new StructuredSelection(element));
	tree.refresh();
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:10,代碼來源:GenerateToStringDialog.java

示例6: newFolderButtonPressed

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
protected void newFolderButtonPressed() {
	Object createdFolder= createFolder(fSelectedContainer);
	if (createdFolder != null) {
		CheckboxTreeViewer treeViewer= fViewer;
		treeViewer.refresh(fSelectedContainer);
		treeViewer.reveal(createdFolder);
		treeViewer.setChecked(createdFolder, true);
		treeViewer.setSelection(new StructuredSelection(createdFolder));
		updateOKStatus();
	}
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:12,代碼來源:MultipleFolderSelectionDialog.java


注:本文中的org.eclipse.jface.viewers.CheckboxTreeViewer.setSelection方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。