Package org.eclipse.e4.xwt.metadata

Examples of org.eclipse.e4.xwt.metadata.IMetaclass


  public static boolean isPropertyReadOnly(Class<?> type, String propertyName) {
    if (type == null || propertyName == null || propertyName.indexOf(".") != -1) {
      return true;
    }
    try {     
      IMetaclass metaclass = XWT.getMetaclass(type);
      IProperty property = metaclass.findProperty(propertyName);
      if (property != null) {
        return property.isReadOnly();
      }
    } catch (Exception e) {
      LoggerManager.log(e);
View Full Code Here


        }
      }
    } catch (Exception e) {
      throw new XWTException(e);
    }
    IMetaclass mateclass = XWT.getMetaclass(type);
    IProperty property = mateclass.findProperty(propertyName);
    if (property instanceof EventProperty) {
      return true;
    }
    return false;
  }
View Full Code Here

    int index = str.lastIndexOf(':');
    if (index != -1) {
      typeName = str.substring(index + 1);
      namespace = str.substring(0, index);
    }
    IMetaclass metaclass = XWT.getMetaclass(typeName, namespace);
    if (metaclass != null) {
      return metaclass.getType();
    }
    return null;
  }
View Full Code Here

        }
      } catch (Exception e) {
        throw new XWTException(e);
      }
    }
    IMetaclass mateclass = XWT.getMetaclass(control);
    IProperty property = mateclass.findProperty(propertyName);
    if (property instanceof EventProperty) {
      return new EventPropertyObservableValue(control,
          (EventProperty) property);
    }
    return null;
View Full Code Here

  public static Shell findShell(Widget context) {
    return XWTLoaderManager.getActive().findShell(context);
  }

  public static IProperty findProperty(Object object, String name) {
    IMetaclass metaclass = XWTLoaderManager.getActive()
        .getMetaclass(object);
    return metaclass.findProperty(name);
  }
View Full Code Here

  public static Map<String, Object> getResources(Object object) {
    return XWTLoaderManager.getActive().getResources(object);
  }

  public static IEvent findEvent(Object object, String name) {
    IMetaclass metaclass = XWTLoaderManager.getActive()
        .getMetaclass(object);
    return metaclass.findEvent(name);
  }
View Full Code Here

   * Get the dynamic property value
   *
   * @param javaclass
   */
  static public Object getPropertyValue(Object uiElement, String propertyName) {
    IMetaclass metaclass = XWT.getMetaclass(uiElement);
    IProperty property = metaclass.findProperty(propertyName);
    if (property == null) {
      return null;
    }
    return XWTLoaderManager.getActive().getPropertyValue(uiElement,
        property);
View Full Code Here

   *
   * @param javaclass
   */
  static public void setPropertyValue(Object uiElement, String propertyName,
      Object value) {
    IMetaclass metaclass = XWT.getMetaclass(uiElement);
    IProperty property = metaclass.findProperty(propertyName);
    if (property == null) {
      throw new XWTException("Property " + propertyName + " not found.");
    }
    XWTLoaderManager.getActive().setPropertyValue(uiElement, property,
        value);
View Full Code Here

    IBaseLabelProvider labelProvider = viewer.getLabelProvider();
    return (labelProvider == null || labelProvider.getClass() == DefaultViewerLabelProvider.class);
  }

  protected Class<?> getElementType() {
    IProperty property = getDelegate();
    Class<?> type = property.getType();
    if (type == null) {
      return Object.class;
    }
    if (type.isArray()) {
      return type.getComponentType();
View Full Code Here

      }

      if (observable == null
          && dataProvider instanceof IObjectDataProvider) {
        IMetaclass mateclass = XWT.getMetaclass(type);
        IProperty property = mateclass.findProperty(propertyName);
        if (property instanceof EventProperty) {
          observable = new EventPropertyObservableValue(object,
              (EventProperty) property);
        }
      }
View Full Code Here

TOP

Related Classes of org.eclipse.e4.xwt.metadata.IMetaclass

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.