当前位置: 首页>>代码示例>>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;未经允许,请勿转载。