Package org.eclipse.core.expressions

Examples of org.eclipse.core.expressions.ICountable


    Object var= context.getDefaultVariable();
    int size;
    if (var instanceof Collection) {
      size= ((Collection)var).size();
    } else {
      ICountable countable= Expressions.getAsICountable(var, this);
      if (countable == null)
        return EvaluationResult.NOT_LOADED;
      size= countable.count();
    }
    switch (fMode) {
      case UNKNOWN:
        return EvaluationResult.FALSE;
      case NONE:
View Full Code Here


  public static ICountable getAsICountable(Object var, Expression expression) throws CoreException {
    if (var instanceof ICountable) {
      return (ICountable)var;
    } else {
      IAdapterManager manager= Platform.getAdapterManager();
      ICountable result= (ICountable)manager.getAdapter(var, ICountable.class);
      if (result != null)
        return result;
     
      if (manager.queryAdapter(var, ICountable.class.getName()) == IAdapterManager.NOT_LOADED)
        return null;
View Full Code Here

    if (sel.isEmpty()) {
      return ICOUNT_0;
    }
    if (sel instanceof IStructuredSelection) {
      final IStructuredSelection ss = (IStructuredSelection) sel;
      return new ICountable() {
        public int count() {
          return ss.size();
        }
      };
    }
View Full Code Here

TOP

Related Classes of org.eclipse.core.expressions.ICountable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.