本文整理匯總了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);
}
}
示例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();
}
}
示例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();
}
示例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