• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Expression类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.core.expressions.Expression的典型用法代码示例。如果您正苦于以下问题:Java Expression类的具体用法?Java Expression怎么用?Java Expression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Expression类属于org.eclipse.core.expressions包,在下文中一共展示了Expression类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: ViewInstanceDescriptor

import org.eclipse.core.expressions.Expression; //导入依赖的package包/类
public ViewInstanceDescriptor ( final String id, final String parentId, final ViewInstanceFactory factory, final URI uri, final String name, final int order, final boolean defaultInstance, final Boolean zooming, final Expression lazyExpression, final Expression visibleExpression, final Expression defaultInstanceExpression, final String summaryConnectionId, final String summaryItemId, final boolean mainView, final Map<String, String> properties )
{
    super ();
    this.id = id;
    this.parentId = parentId;
    this.factory = factory;
    this.uri = uri;
    this.name = name;
    this.properties = properties;
    this.order = order;
    this.defaultInstance = defaultInstance;
    this.zooming = zooming;
    this.lazyExpression = lazyExpression;
    this.visibleExpression = visibleExpression;
    this.defaultInstanceExpression = defaultInstanceExpression;
    this.summaryConnectionId = summaryConnectionId;
    this.summaryItemId = summaryItemId;
    this.mainView = mainView;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:20,代码来源:ViewInstanceDescriptor.java


示例2: ModernActionKeyBindingSupport

import org.eclipse.core.expressions.Expression; //导入依赖的package包/类
private ModernActionKeyBindingSupport(
    final IAdaptable serviceLocator,
    final Expression expression,
    final int sourcePriorities) {
    Check.notNull(serviceLocator, "serviceLocator"); //$NON-NLS-1$
    Check.notNull(expression, "expression"); //$NON-NLS-1$

    bindingService = (IBindingService) serviceLocator.getAdapter(IBindingService.class);
    handlerService = (IHandlerService) serviceLocator.getAdapter(IHandlerService.class);

    if (bindingService == null || handlerService == null) {
        throw new IllegalArgumentException(
            "specified IAdapable could not provide IBindingService or IHandlerService"); //$NON-NLS-1$
    }

    this.expression = expression;
    this.sourcePriorities = sourcePriorities;
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:19,代码来源:ModernActionKeyBindingSupport.java


示例3: test

import org.eclipse.core.expressions.Expression; //导入依赖的package包/类
public boolean test(Object receiver, String property, Object[] args,
    Object expectedValue) {
  String delegateShortcutID = (String) args[0];
  Expression expr = expressions.get(delegateShortcutID);
  if (expr == null) {
    expr = createEnablementExpression(delegateShortcutID);
    expressions.put(delegateShortcutID, expr);
  }
  try {
    return expr.evaluate(createContext(receiver)) != EvaluationResult.FALSE;
  } catch (CoreException ce) {
    EclEmmaUIPlugin.getInstance().getLog()
        .log(EclEmmaUIPlugin.errorStatus("Launch shortcut '" //$NON-NLS-1$
            + delegateShortcutID
            + "' enablement expression caused exception.", //$NON-NLS-1$
            ce));
    return false;
  }
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:20,代码来源:ContextualLaunchableTester.java


示例4: createContributionItems

import org.eclipse.core.expressions.Expression; //导入依赖的package包/类
@Override
public void createContributionItems(IServiceLocator serviceLocator, IContributionRoot additions) {
	IMenuService menuService = (IMenuService) serviceLocator.getService(IMenuService.class);
	if (menuService == null) {
		CloudFoundryPlugin
				.logError("Unable to retrieve Eclipse menu service. Cannot add Cloud Foundry context menus."); //$NON-NLS-1$
		return;
	}

	List<IAction> debugActions = getActions(menuService);
	for (IAction action : debugActions) {
		additions.addContributionItem(new ActionContributionItem(action), new Expression() {
			public EvaluationResult evaluate(IEvaluationContext context) {
				return EvaluationResult.TRUE;
			}

			public void collectExpressionInfo(ExpressionInfo info) {
			}
		});
	}
}
 
开发者ID:eclipse,项目名称:cft,代码行数:22,代码来源:AbstractMenuContributionFactory.java


示例5: createContributionItems

import org.eclipse.core.expressions.Expression; //导入依赖的package包/类
@Override
public void createContributionItems(IServiceLocator serviceLocator, IContributionRoot additions) {
	IMenuService menuService = (IMenuService) serviceLocator.getService(IMenuService.class);
	if (menuService == null) {
		DockerFoundryPlugin
				.logError("Unable to retrieve Eclipse menu service. Cannot add Cloud Foundry context menus."); //$NON-NLS-1$
		return;
	}

	List<IAction> debugActions = getActions(menuService);
	for (IAction action : debugActions) {
		additions.addContributionItem(new ActionContributionItem(action), new Expression() {
			public EvaluationResult evaluate(IEvaluationContext context) {
				return EvaluationResult.TRUE;
			}

			public void collectExpressionInfo(ExpressionInfo info) {
			}
		});
	}
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:22,代码来源:AbstractMenuContributionFactory.java


示例6: createContributionItems

import org.eclipse.core.expressions.Expression; //导入依赖的package包/类
@Override
public void createContributionItems(IServiceLocator serviceLocator,
		IContributionRoot additions) {
	CommandContributionItemParameter toggleWatchpointParam = new CommandContributionItemParameter(serviceLocator, null, "org.eclipse.debug.ui.commands.ToggleWatchpoint", CommandContributionItem.STYLE_PUSH);
	toggleWatchpointParam.icon = DebugUITools.getImageDescriptor(IDebugUIConstants.IMG_OBJS_WATCHPOINT);
	toggleWatchpointParam.disabledIcon = DebugUITools.getImageDescriptor(IDebugUIConstants.IMG_OBJS_WATCHPOINT_DISABLED);
	toggleWatchpointParam.label = "Add Watchpoint";
	CommandContributionItem toggleWatchpoint = new CommandContributionItem(toggleWatchpointParam);
	Expression toggleWatchpointVisible = new Expression() {
		
		@Override
		public EvaluationResult evaluate(IEvaluationContext context)
				throws CoreException {
			return EvaluationResult.valueOf((context.getVariable("activeEditor") instanceof BfEditor));
		}
	};
	additions.addContributionItem(toggleWatchpoint, toggleWatchpointVisible);
}
 
开发者ID:RichardBirenheide,项目名称:brainfuck,代码行数:19,代码来源:WatchpointExtensionFactory.java


示例7: createContributionItems

import org.eclipse.core.expressions.Expression; //导入依赖的package包/类
@Override
public void createContributionItems(IServiceLocator serviceLocator, IContributionRoot additions) {
	for (PlanModifierFactory factory : PlanModifierRegistry.getInstance().getModifierFactories()) {
		String name = factory.getName();
		ImageDescriptor imageDescriptor = factory.getImageDescriptor();
		String id = null;
		String commandId = TEMPORAL_MODIFICATION_COMMAND_ID;
		Map<?, ?> parameters = Collections.singletonMap("name", name);
		ImageDescriptor icon = imageDescriptor;
		String label = name;
		String tooltip = name;
		FactoryServiceLocator locator = new FactoryServiceLocator(serviceLocator, factory);
		CommandContributionItemParameter parameter = new CommandContributionItemParameter(locator, id, commandId, parameters, icon, null, null, label, null, tooltip, SWT.RADIO, null, false);
		IContributionItem item = new CommandContributionItem(parameter);
		Expression visibleWhen = null;
		additions.addContributionItem(item, visibleWhen);
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:19,代码来源:PlanModifierContributionFactory.java


示例8: matches

import org.eclipse.core.expressions.Expression; //导入依赖的package包/类
public boolean matches(IJavaProject javaProject) {
	if (fStatus != null) {
		return fStatus.booleanValue();
	}

	IConfigurationElement[] children= fConfigurationElement.getChildren(ExpressionTagNames.ENABLEMENT);
	if (children.length == 1) {
		try {
			ExpressionConverter parser= ExpressionConverter.getDefault();
			Expression expression= parser.perform(children[0]);
			EvaluationContext evalContext= new EvaluationContext(null, javaProject);
			evalContext.addVariable("project", javaProject); //$NON-NLS-1$
			evalContext.addVariable("sourceLevel", javaProject.getOption(JavaCore.COMPILER_SOURCE, true)); //$NON-NLS-1$
			return expression.evaluate(evalContext) == EvaluationResult.TRUE;
		} catch (CoreException e) {
			JavaPlugin.log(e);
		}
		return false;
	}
	fStatus= Boolean.FALSE;
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:ClasspathFixProcessorDescriptor.java


示例9: createEditPart

import org.eclipse.core.expressions.Expression; //导入依赖的package包/类
public static EditPart createEditPart( EditPart context, Object model )
{
	EvaluationContext econtext = new EvaluationContext( null, model );
	for ( Iterator<Expression> iterator = extensionMap.keySet( ).iterator( ); iterator.hasNext( ); )
	{
		try
		{
			Expression expression = iterator.next( );
			if ( expression.evaluate( econtext ) == EvaluationResult.TRUE )
			{
				EditPart editPart = (EditPart) extensionMap.get( expression )
						.createExecutableExtension( "type" ); //$NON-NLS-1$
				editPart.setModel( model );
				return editPart;
			}
		}
		catch ( CoreException e )
		{
			logger.log( Level.SEVERE, e.getMessage( ), e );
		}
	}
	return null;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:24,代码来源:EditpartExtensionManager.java


示例10: createEnablementExpression

import org.eclipse.core.expressions.Expression; //导入依赖的package包/类
private Expression createEnablementExpression(String delegateShortcutID) {
  IConfigurationElement element = findEnablementConfiguration(delegateShortcutID);
  if (element != null) {
    try {
      return ExpressionConverter.getDefault().perform(element);
    } catch (CoreException ce) {
      EclEmmaUIPlugin.log(ce);
    }
  }
  return Expression.FALSE;
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:12,代码来源:ContextualLaunchableTester.java


示例11: matches

import org.eclipse.core.expressions.Expression; //导入依赖的package包/类
private boolean matches(ICompilationUnit cunit) {
	if (fRequiredSourceLevel != null) {
		String current= cunit.getJavaProject().getOption(JavaCore.COMPILER_SOURCE, true);
		if (JavaModelUtil.isVersionLessThan(current, fRequiredSourceLevel)) {
			return false;
		}
	}

	if (fStatus != null) {
		return fStatus.booleanValue();
	}

	IConfigurationElement[] children= fConfigurationElement.getChildren(ExpressionTagNames.ENABLEMENT);
	if (children.length == 1) {
		try {
			ExpressionConverter parser= ExpressionConverter.getDefault();
			Expression expression= parser.perform(children[0]);
			EvaluationContext evalContext= new EvaluationContext(null, cunit);
			evalContext.addVariable("compilationUnit", cunit); //$NON-NLS-1$
			IJavaProject javaProject= cunit.getJavaProject();
			String[] natures= javaProject.getProject().getDescription().getNatureIds();
			evalContext.addVariable("projectNatures", Arrays.asList(natures)); //$NON-NLS-1$
			evalContext.addVariable("sourceLevel", javaProject.getOption(JavaCore.COMPILER_SOURCE, true)); //$NON-NLS-1$
			return expression.evaluate(evalContext) == EvaluationResult.TRUE;
		} catch (CoreException e) {
			JavaPlugin.log(e);
		}
		return false;
	}
	fStatus= Boolean.FALSE;
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:33,代码来源:ContributedProcessorDescriptor.java


示例12: getDefaultInstanceExpression

import org.eclipse.core.expressions.Expression; //导入依赖的package包/类
public Expression getDefaultInstanceExpression ()
{
    return this.defaultInstanceExpression;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:5,代码来源:ViewInstanceDescriptor.java


示例13: getLazyExpression

import org.eclipse.core.expressions.Expression; //导入依赖的package包/类
public Expression getLazyExpression ()
{
    return this.lazyExpression;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:5,代码来源:ViewInstanceDescriptor.java


示例14: getVisibleExpression

import org.eclipse.core.expressions.Expression; //导入依赖的package包/类
public Expression getVisibleExpression ()
{
    return this.visibleExpression;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:5,代码来源:ViewInstanceDescriptor.java


示例15: getExpression

import org.eclipse.core.expressions.Expression; //导入依赖的package包/类
public Expression getExpression( )
{
	return expression;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:5,代码来源:ElementAdapter.java


示例16: setExpression

import org.eclipse.core.expressions.Expression; //导入依赖的package包/类
public void setExpression( Expression expression )
{
	this.expression = expression;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:5,代码来源:ElementAdapter.java


示例17: getEnablementExpression

import org.eclipse.core.expressions.Expression; //导入依赖的package包/类
/**
 * Returns the enablement element of the described extension.
 * 
 * @return the enablement expression or <code>null</code> if it is not specified
 * @since 3.8.1
 */
Expression getEnablementExpression() {
	return fEnablementExpression;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:CompletionProposalCategory.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FilteredItemsSelectionDialog类代码示例发布时间:2022-05-21
下一篇:
Java ImageInputStreamSpi类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap