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


Java CheckboxTreeViewer.getSelection方法代碼示例

本文整理匯總了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);
				}
			}
		}
	}
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:21,代碼來源:ActionCheckTours.java

示例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;
}
 
開發者ID:agusevas,項目名稱:logan,代碼行數:12,代碼來源:TreeSelectionUtils.java

示例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;
}
 
開發者ID:agusevas,項目名稱:logan,代碼行數:12,代碼來源:TreeSelectionUtils.java

示例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;
}
 
開發者ID:agusevas,項目名稱:logan,代碼行數:12,代碼來源:TreeSelectionUtils.java

示例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;
}
 
開發者ID:agusevas,項目名稱:logan,代碼行數:12,代碼來源:TreeSelectionUtils.java


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