当前位置: 首页>>代码示例>>Java>>正文


Java IStructuredSelection.toList方法代码示例

本文整理汇总了Java中org.eclipse.jface.viewers.IStructuredSelection.toList方法的典型用法代码示例。如果您正苦于以下问题:Java IStructuredSelection.toList方法的具体用法?Java IStructuredSelection.toList怎么用?Java IStructuredSelection.toList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.viewers.IStructuredSelection的用法示例。


在下文中一共展示了IStructuredSelection.toList方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: modifyEvent

import org.eclipse.jface.viewers.IStructuredSelection; //导入方法依赖的package包/类
/**
 * Ensures that IProject is present as first element
 * and DBPair is present as second element of the selection.
 */
private SelectionChangedEvent modifyEvent(SelectionChangedEvent event, DBPair dbPair) {
    ISelection selection = event.getSelection();
    if (selection.isEmpty()) {
        return defaultSelectionEvent;
    }
    if (!(selection instanceof IStructuredSelection)) {
        Log.log(Log.LOG_WARNING, "Cannot handle this selection type: " + selection.toString()); //$NON-NLS-1$
        // no way to deal with empty/other types of selections
        return defaultSelectionEvent;
    }

    IStructuredSelection sel = (IStructuredSelection) selection;
    List<?> elements = sel.toList();

    List<Object> newElements = new ArrayList<>(elements.size() + 2);
    newElements.add(proj);
    newElements.add(dbPair);
    newElements.addAll(elements);

    return new SelectionChangedEvent((ISelectionProvider) event.getSource(),
            new StructuredSelection(newElements));
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:27,代码来源:ProjectEditorSelectionProvider.java

示例2: collectFiles

import org.eclipse.jface.viewers.IStructuredSelection; //导入方法依赖的package包/类
/** Collects files from provided selection. */
public List<IFile> collectFiles(IStructuredSelection structuredSelection) {
	Set<IFile> collected = new HashSet<>();
	for (Object object : structuredSelection.toList()) {
		collectRelevantFiles(object, collected);
	}

	return Lists.newArrayList(collected);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:10,代码来源:SelectionFilesCollector.java

示例3: canEnable

import org.eclipse.jface.viewers.IStructuredSelection; //导入方法依赖的package包/类
private boolean canEnable(final IStructuredSelection sel) {
	if (sel.size() == 0) {
		return true;
	}

	final List<?> list = sel.toList();
	for (final Iterator<?> iterator = list.iterator(); iterator.hasNext(); /**/) {
		if (!isNewTarget(iterator.next())) {
			return false;
		}
	}

	return true;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:15,代码来源:N4JSNewWizardsActionGroup.java

示例4: init

import org.eclipse.jface.viewers.IStructuredSelection; //导入方法依赖的package包/类
@Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
	this.workbench = workbench;
	setWindowTitle((MessageUtil.getString("GraphWalker_Generator_File"))); //$NON-NLS-1$
	setDefaultPageImageDescriptor(WIZARD_BANNER);

	List models = selection.toList();
	model = (IFile) models.get(0);
	ids = (List<String>) models.get(1);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:11,代码来源:GeneratorToFileCreationWizard.java

示例5: setSelectionSubtreesChecked

import org.eclipse.jface.viewers.IStructuredSelection; //导入方法依赖的package包/类
private void setSelectionSubtreesChecked(IStructuredSelection selection, boolean checked) {
    for (Object o : selection.toList()) {
        TreeElement el = (TreeElement) o;
        setSubTreeChecked(el, checked);
    }
    viewerChecksUpdated();
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:8,代码来源:DiffTableViewer.java

示例6: getModels

import org.eclipse.jface.viewers.IStructuredSelection; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
protected Collection<ZnodeModel> getModels(IStructuredSelection selection) {
    return selection.toList();
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:5,代码来源:TableEditAction.java

示例7: getSelectionList

import org.eclipse.jface.viewers.IStructuredSelection; //导入方法依赖的package包/类
private List<?> getSelectionList(IStructuredSelection selection) {
    return (selection != null && selection.size() > 1) ? selection.toList()
            : Collections.emptyList();
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:5,代码来源:DiffTableViewer.java


注:本文中的org.eclipse.jface.viewers.IStructuredSelection.toList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。