Package org.eclipse.e4.core.commands

Examples of org.eclipse.e4.core.commands.EHandlerService


              if (type != null) {
                segment = null;
              }
            }
            if (type == null) {
              throw new XWTException("Class " + className
                  + " not found");
            }
            dataProvider = XWT.findDataProvider(type);
          }
        }
      }
      if (currentPath == null) {
        currentPath = segment;
      } else if (segment != null) {
        currentPath = currentPath + '.' + segment;
      }

      IObservable segmentValue = scopeManager.getObservableValue(widget,
          value, currentPath);
      try {
        if (segmentValue == null) {
          if (segment != null) {
            segmentValue = createValueProperty(dataValue, segment,
                type);
            if (segmentValue == null) {
              throw new XWTException(" Property " + segment
                  + " is not found in "
                  + expressionPath.getFullPath());
              // maybe to
              // raise an
              // exception
            }
            scopeManager.addObservableValue(widget, value,
                currentPath, segmentValue);
          } else  if (dataValue instanceof IObservable){
            segmentValue = (IObservable)dataValue;
          }
        }
        else if (segment == null && type != null) {
          if (segmentValue instanceof TypedViewerObservableValueDecorator) {
            TypedViewerObservableValueDecorator typedViewerObservableValueDecorator = (TypedViewerObservableValueDecorator) segmentValue;
            typedViewerObservableValueDecorator.setElementType(type);
          }
        }
      } catch (IllegalArgumentException e) {
        // Property is not found
        String message = e.getMessage();
        if (!message.startsWith("Could not find property with name")) {
          throw e;
        }
        throw new XWTException(" Property " + segment
            + " is not found in " + expressionPath.getFullPath()); // maybe
                                        // to
                                        // raise
                                        // an
        // exception
View Full Code Here


      switch (array[i]) {
      case '}':
        {
          Character character = separators.pop();
          if (character.charValue() != '{') {
            throw new XWTException("Syntax error is binding expression " + value + " at " + i);
          }
        }
        level --;
        break;
      case ']':
        {
          Character character = separators.pop();
          if (character.charValue() != '[') {
            throw new XWTException("Syntax error is binding expression " + value + " at " + i);
          }
        }
        level --;
        break;
      case ')':
        {
          Character character = separators.pop();
          if (character.charValue() != '(') {
            throw new XWTException("Syntax error is binding expression " + value + " at " + i);
          }
        }
        level --;
        if (level == 0) {
          stripEnd = i - 1;
View Full Code Here

      switch (array[i]) {
      case '{':
        {
          Character character = separators.pop();
          if (character.charValue() != '}') {
            throw new XWTException("Syntax error is binding expression " + value + " at " + i);
          }
        }
        level --;
        break;
      case '[':
        {
          Character character = separators.pop();
          if (character.charValue() != '}') {
            throw new XWTException("Syntax error is binding expression " + value + " at " + i);
          }
        }
        level --;
        break;
      case '(':
        {
          Character character = separators.pop();
          if (character.charValue() != ')') {
            throw new XWTException("Syntax error is binding expression " + value + " at " + i);
          }
        }
        level --;
        break;
      case '}':
View Full Code Here

    String className = packageName.length() == 0 ? name : (packageName
        + "." + name);
    // try {
    Class<?> type = ClassLoaderUtil.loadClass(context, className);
    if (type == null) {
      throw new XWTException("Cannot load " + className);
    }
    metaclass = register(type, null);
    // There is no need to mapping a CLR class, since the ClassLoader will
    // be changed.
    nameRegister.remove(type.getSimpleName());
View Full Code Here

  protected IProperty getColumnsProperty() {
    if (columnsProperty == null) {
      IMetaclass metaclass = XWT.getMetaclass(viewer.getClass());
      columnsProperty = metaclass.findProperty(PropertiesConstants.PROPERTY_COLUMNS);
      if (columnsProperty == null) {
        throw new XWTException("Columns property is not found.");
      }
    }
    return columnsProperty;
  }
View Full Code Here

    return Object.class;
  }

  public void setIndex(Object parent, int index) {
    if (!(parent instanceof TableViewer)) {
      throw new XWTException("TableView is expected, not \"" + parent.getClass().getName() + "\"");
    }
    cellEditorHelper = new CellEditorHelper((TableViewer) parent, index);
  }
View Full Code Here

    if (targetName == null) {
      return target;
    }
    Object newTarget = UserData.findElementByName(target, targetName);
    if (newTarget == null) {
      throw new XWTException("Name element " + targetName + " is not found in animation.");
    }
    return super.findTarget(newTarget);
  }
View Full Code Here

      Element element = null;
      if (stream == null) {
        element = manager.load(input, (IBeforeParsingCallback) options.get(IXWTLoader.BEFORE_PARSING_CALLBACK));
      }
      else {
        IBeforeParsingCallback callback = (IBeforeParsingCallback) options.get(IXWTLoader.BEFORE_PARSING_CALLBACK);
        InputStream inputStream = stream;
        if (callback != null) {
          int size = stream.read();
          byte[] buffer = new byte[size];
          stream.read(buffer);
          String content = new String(buffer);
          stream.close();
          content = callback.onParsing(content);
          inputStream = new ByteArrayInputStream(content.getBytes());
          element = manager.load(stream, input);         
        }
        element = manager.load(inputStream, input);
      }
View Full Code Here

    this.bindings = bindings;
  }

  public IMultiValueConverter getConverter() {
    if (valueConverter == null) {
      valueConverter = new StringMultiValueConerter();
    }
    return valueConverter;
  }
View Full Code Here

    if (source == target
        || (source != Object.class && source.isAssignableFrom(target))) {
      return ObjectToObject.instance;
    }
    if (String.class == source && target.isEnum()) {
      return new StringToEnum(target);
    }
    ValueConvertorRegister convertorRegister = (ValueConvertorRegister)
        getService(ValueConvertorRegister.class);
    if (convertorRegister == null) {
      return null;
View Full Code Here

TOP

Related Classes of org.eclipse.e4.core.commands.EHandlerService

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.