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


Java IEvaluationContext.addVariable方法代码示例

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


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

示例1: testCopyUrl

import org.eclipse.core.expressions.IEvaluationContext; //导入方法依赖的package包/类
@Test
public void testCopyUrl() throws ExecutionException {
	// Given
	String url = "https://github.com/cchabanois/mesfavoris";
	Bookmark bookmark = new Bookmark(new BookmarkId(),
			ImmutableMap.of(UrlBookmarkProperties.PROP_URL, url));
	IEvaluationContext context = new EvaluationContext(null, new Object());
	context.addVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME, new StructuredSelection(bookmark));
	ExecutionEvent event = new ExecutionEvent(null, new HashMap<>(), null, context);

	// When
	CopyBookmarkUrlHandler handler = new CopyBookmarkUrlHandler();
	executeHandler(handler, event);

	// Then
	assertEquals(url, getClipboardContents());
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:18,代码来源:CopyBookmarkUrlHandlerTest.java

示例2: createEvaluationContext

import org.eclipse.core.expressions.IEvaluationContext; //导入方法依赖的package包/类
private IEvaluationContext createEvaluationContext( ISelection selection ) {
  IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow();
  IEvaluationContext result = new EvaluationContext( null, new Object() );
  result.addVariable( ISources.ACTIVE_WORKBENCH_WINDOW_NAME, activeWorkbenchWindow );
  result.addVariable( ISources.ACTIVE_CURRENT_SELECTION_NAME, selection );
  return result;
}
 
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:8,代码来源:OpenWithQuickMenuHandlerPDETest.java

示例3: createEvaluationContext

import org.eclipse.core.expressions.IEvaluationContext; //导入方法依赖的package包/类
private IEvaluationContext createEvaluationContext( Object editorInput ) {
  IWorkbenchWindow activeWorkbenchWindow = workbenchPage.getWorkbenchWindow();
  IEvaluationContext result = new EvaluationContext( null, new Object() );
  result.addVariable( ISources.ACTIVE_WORKBENCH_WINDOW_NAME, activeWorkbenchWindow );
  if( editorInput != null ) {
    result.addVariable( ISources.ACTIVE_EDITOR_INPUT_NAME, editorInput );
  }
  return result;
}
 
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:10,代码来源:DeleteEditorFileHandler_ResourcePDETest.java

示例4: createEvaluationContext

import org.eclipse.core.expressions.IEvaluationContext; //导入方法依赖的package包/类
private IEvaluationContext createEvaluationContext( IWorkbenchPart activePart ) {
  IWorkbenchWindow activeWorkbenchWindow = workbenchPage.getWorkbenchWindow();
  IEvaluationContext result = new EvaluationContext( null, new Object() );
  result.addVariable( ISources.ACTIVE_WORKBENCH_WINDOW_NAME, activeWorkbenchWindow );
  if( activePart != null ) {
    result.addVariable( ISources.ACTIVE_PART_NAME, activePart );
  }
  return result;
}
 
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:10,代码来源:CloseViewHandlerPDETest.java

示例5: getEnabledTextHoverDescriptors

import org.eclipse.core.expressions.IEvaluationContext; //导入方法依赖的package包/类
private List<TextHoverDescriptor> getEnabledTextHoverDescriptors(ITextViewer textViewer, int offset)
{
	List<TextHoverDescriptor> result = new ArrayList<TextHoverDescriptor>();
	if (fTextEditor == null)
	{
		return result;
	}
	try
	{
		QualifiedContentType contentType = CommonEditorPlugin.getDefault().getDocumentScopeManager()
				.getContentType(textViewer.getDocument(), offset);
		IEvaluationContext context = new EvaluationContext(null, textViewer);
		IWorkbenchPartSite site = fTextEditor.getSite();
		if (site != null)
		{
			context.addVariable(ISources.ACTIVE_EDITOR_ID_NAME, site.getId());
		}
		for (TextHoverDescriptor descriptor : TextHoverDescriptor.getContributedHovers())
		{
			if (descriptor.isEnabledFor(contentType, context))
			{
				result.add(descriptor);
			}
		}
	}
	catch (BadLocationException e)
	{
	}
	return result;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:31,代码来源:CommonSourceViewerConfiguration.java

示例6: createContext

import org.eclipse.core.expressions.IEvaluationContext; //导入方法依赖的package包/类
private IEvaluationContext createContext(Object selection) {
  IEvaluationContext context = new EvaluationContext(null, selection);
  context.addVariable("selection", selection); //$NON-NLS-1$
  return context;
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:6,代码来源:ContextualLaunchableTester.java

示例7: createEvaluationContext

import org.eclipse.core.expressions.IEvaluationContext; //导入方法依赖的package包/类
private IEvaluationContext createEvaluationContext() {
  IEvaluationContext result = new EvaluationContext( null, new Object() );
  result.addVariable( ACTIVE_WORKBENCH_WINDOW_NAME, workbenchWindow );
  return result;
}
 
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:6,代码来源:OpenLaunchDialogHanderPDETest.java

示例8: openFilterDialog

import org.eclipse.core.expressions.IEvaluationContext; //导入方法依赖的package包/类
void openFilterDialog() {
	final IEvaluationContext ec = new EvaluationContext(null, this);
	ec.addVariable(ISources.ACTIVE_PART_NAME, this);
	final ExecutionEvent ev = new ExecutionEvent(null, new HashMap<>(), this, ec);
	new ConfigureContentsDialogHandler().execute(ev);
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:7,代码来源:SyntaxErrorsView.java


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