Package org.eclipse.e4.core.contexts

Examples of org.eclipse.e4.core.contexts.IEclipseContext


    try {
      URL url = AboutPageTab.class.getResource(name);
      Map<String, Object> options = new HashMap<String, Object>();
      options.put(IXWTLoader.CLASS_PROPERTY, this);
      options.put(IXWTLoader.CONTAINER_PROPERTY, this);
      XWT.setLoadingContext(new DefaultLoadingContext(this.getClass().getClassLoader()));
      XWT.loadWithOptions(url, options);
    } catch (Throwable e) {
      throw new Error("Unable to load " + name, e);
    }
  }
View Full Code Here


    try {
      URL url = HelpPageTab.class.getResource(name);
      Map<String, Object> options = new HashMap<String, Object>();
      options.put(IXWTLoader.CLASS_PROPERTY, this);
      options.put(IXWTLoader.CONTAINER_PROPERTY, this);
      XWT.setLoadingContext(new DefaultLoadingContext(this.getClass().getClassLoader()));
      XWT.loadWithOptions(url, options);
    } catch (Throwable e) {
      throw new Error("Unable to load " + name, e);
    }
  }
View Full Code Here

  public IDataProvider findDataProvider(Object dataContext) {
    if (dataContext instanceof IDataProvider) {
      return (IDataProvider) dataContext;
    }
    for (IDataProviderFactory factory : dataProviderFactories.values()) {
      IDataProvider dataProvider = factory.create(dataContext);
      if (dataProvider != null) {
        return dataProvider;
      }
    }
    ObjectDataProvider dataProvider = new ObjectDataProvider();
    dataProvider.setObjectInstance(dataContext);
    return dataProvider;
  }
View Full Code Here

    // direct binding
    if (dataContext instanceof IBinding) {
      dataContext = ((IBinding) dataContext).getValue(null);
    }

    IDataProvider dataProvider = getDataProvider(dataContext);

    try {
      if (isSourceControl()) {
        ControlDataBinding controlDataBinding = new ControlDataBinding(
            dataContext, this, dataProvider);
View Full Code Here

    }
    return value;
  }

  public boolean isSourcePropertyReadOnly() {
    IDataProvider dataProvider = getDataProvider();
    try {
      return ScopeManager.isPropertyReadOnly(dataProvider,
          getPathPropertySegments());
    } catch (XWTException e) {
    }
View Full Code Here

    return valueProperty;
  }

  protected static IValueProperty doCreateValueProperty(Object type,
      String fullPath) {
    IDataProvider dataProvider = XWT.findDataProvider(type);
    return dataProvider.createValueProperty(type, fullPath);
  }
View Full Code Here

  public void removeDataProviderFactory(IDataProviderFactory dataProviderFactory) {
    if (dataProviderFactory == null) {
      return;
    }
    for (String name : dataProviderFactories.keySet()) {
      IDataProviderFactory value = dataProviderFactories.get(name);
      if (dataProviderFactory == value) {
        dataProviderFactories.remove(name);
      }
    }
  }
View Full Code Here

    }
    return convertedValue(dataContext);
  }

  private Object convertedValue(Object value) {
    IValueConverter converter = getConverter();
    if (converter != null) {
      value = converter.convert(value);
    }
    return value;
  }
View Full Code Here

          if (converter != null) {
            Object newValue = converter.convert(value);
            descriptor.getWriteMethod().invoke(data, newValue);
            tableViewer.refresh(data);
          } else {
            throw new XWTException("Converter doesn't exist from \"" + value.getClass().getName() + "\" to \"" + type.getName());
          }
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
View Full Code Here

          try {
            writeMethod.invoke(target, value);
            fireSetPostAction(target, this, value);
          } catch (IllegalArgumentException e) {
            if (value == null) {
              throw new XWTException("Property type " + getName()
                  + " of " + target.getClass().getName()
                  + " cannot be null.", e);
            }
            throw new XWTException("Property type " + getName()
                + " of " + target.getClass().getName()
                + " is mismatch with "
                + value.getClass().getName()
                + " expected type is "
                + parameterTypes[0].getName(), e);
          }
          catch (InvocationTargetException e) {
            throw new XWTException("Problem of invoke " + getName()
                + " of " + target.getClass().getName()
                + " with a value of type "
                + value.getClass().getName(), e);
          }
        }
View Full Code Here

TOP

Related Classes of org.eclipse.e4.core.contexts.IEclipseContext

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.