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


Java Expression类代码示例

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


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


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