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


Java StructuredViewer.getSelection方法代碼示例

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


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

示例1: getSelection

import org.eclipse.jface.viewers.StructuredViewer; //導入方法依賴的package包/類
/**
   * Returns the current selection.
   * @return selection
   */
  protected ISelection getSelection() {
  	StructuredViewer viewerInFocus= fSelectionProviderMediator.getViewerInFocus();
if (viewerInFocus != null) {
	return viewerInFocus.getSelection();
}
return StructuredSelection.EMPTY;
  }
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:12,代碼來源:CallHierarchyViewPart.java

示例2: switchViewer

import org.eclipse.jface.viewers.StructuredViewer; //導入方法依賴的package包/類
private void switchViewer(int state) {
	//Indicate which viewer is to be used
	if (fCurrViewState == state)
		return;
	else {
		fCurrViewState= state;
		IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore();
		store.setValue(getViewSite().getId() + TAG_VIEW_STATE, state);
	}

	//get the information from the existing viewer
	StructuredViewer viewer= fWrappedViewer.getViewer();
	Object object= viewer.getInput();
	ISelection selection= viewer.getSelection();

	// create and set up the new viewer
	Control control= createViewer(fWrappedViewer.getControl().getParent()).getControl();

	setUpViewer(fWrappedViewer);

	createSelectAllAction();

	// add the selection information from old viewer
	fWrappedViewer.setViewerInput(object);
	fWrappedViewer.getControl().setFocus();
	fWrappedViewer.setSelection(selection, true);

	// dispose old viewer
	viewer.getContentProvider().dispose();
	viewer.getControl().dispose();

	// layout the new viewer
	if (control != null && !control.isDisposed()) {
		control.setVisible(true);
		control.getParent().layout(true);
	}
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:38,代碼來源:PackagesView.java

示例3: getSelection

import org.eclipse.jface.viewers.StructuredViewer; //導入方法依賴的package包/類
private List<IJiveEvent> getSelection(final StructuredViewer viewer)
{
  final ISelection selection = viewer.getSelection();
  final List<IJiveEvent> result = new ArrayList<IJiveEvent>();
  if (selection != null && selection instanceof IStructuredSelection)
  {
    final IStructuredSelection sel = (IStructuredSelection) selection;
    for (@SuppressWarnings("unchecked")
    final Iterator<IJiveEvent> iterator = sel.iterator(); iterator.hasNext();)
    {
      result.add(iterator.next());
    }
  }
  return result;
}
 
開發者ID:UBPL,項目名稱:jive,代碼行數:16,代碼來源:TraceCopyEventsAction.java


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