本文整理匯總了Java中org.eclipse.jface.viewers.CheckboxTreeViewer.getSelection方法的典型用法代碼示例。如果您正苦於以下問題:Java CheckboxTreeViewer.getSelection方法的具體用法?Java CheckboxTreeViewer.getSelection怎麽用?Java CheckboxTreeViewer.getSelection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.viewers.CheckboxTreeViewer
的用法示例。
在下文中一共展示了CheckboxTreeViewer.getSelection方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: run
import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
@Override
public void run() {
// check all selected compared tours which are not yet stored
final CheckboxTreeViewer viewer = fCompareResultView.getViewer();
final StructuredSelection selection = (StructuredSelection) viewer.getSelection();
if (selection.size() > 0) {
for (final Object tour : selection.toArray()) {
if (tour instanceof TVICompareResultComparedTour) {
final TVICompareResultComparedTour comparedTour = (TVICompareResultComparedTour) tour;
if (comparedTour.isSaved() == false) {
viewer.setChecked(tour, true);
}
}
}
}
}
示例2: getSelectedProfile
import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
public static Profile getSelectedProfile(CheckboxTreeViewer treeViewer) {
IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
if (!selection.isEmpty()) {
Object selectedElement = selection.getFirstElement();
if (selectedElement instanceof Profile) {
return (Profile) selectedElement;
}
}
return null;
}
示例3: getSelectedExpression
import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
public static Expression getSelectedExpression(CheckboxTreeViewer treeViewer) {
IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
if (!selection.isEmpty()) {
Object selectedElement = selection.getFirstElement();
if (selectedElement instanceof Expression) {
return (Expression) selectedElement;
}
}
return null;
}
示例4: getSelectedProfiles
import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
public static List<Profile> getSelectedProfiles(CheckboxTreeViewer treeViewer) {
IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
List<Profile> result = Lists.newArrayList();
for (Object element : selection.toList()) {
if (element instanceof Profile) {
result.add((Profile) element);
}
}
return result;
}
示例5: getSelectedExpressions
import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
public static List<Expression> getSelectedExpressions(CheckboxTreeViewer treeViewer) {
IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
List<Expression> result = Lists.newArrayList();
for (Object element : selection.toList()) {
if (element instanceof Expression) {
result.add((Expression) element);
}
}
return result;
}