Package org.eclipse.wb.internal.core.xml.model.description

Examples of org.eclipse.wb.internal.core.xml.model.description.ComponentDescription


  //
  ////////////////////////////////////////////////////////////////////////////
  private final Map<String, ComponentDescription> m_gridElementDescriptions = Maps.newTreeMap();

  private ComponentDescription getElementDescription(String name) throws Exception {
    ComponentDescription description = m_gridElementDescriptions.get(name);
    if (description == null) {
      description = new ComponentDescription(Object.class);
      description.setToolkit(GwtToolkitDescription.INSTANCE);
      description.setIcon(ComponentDescriptionHelper.getIcon(
          getContext(),
          getDescription().getComponentClass(),
          "_" + name));
      m_gridElementDescriptions.put(name, description);
    }
View Full Code Here


    }
    // create Widget
    {
      Class<?> widgetClass =
          context.getClassLoader().loadClass("com.google.gwt.user.client.ui.Widget");
      ComponentDescription widgetDescription =
          ComponentDescriptionHelper.getDescription(context, widgetClass);
      m_widget = new IsWidgetWrappedInfo(context, widgetDescription, creationSupport, this);
    }
    // bind IsWidget to Widget
    m_widget.addChild(this);
View Full Code Here

        return result[0];
      }
    }
    // try "UiBinder.createInstance" script
    {
      ComponentDescription description = ComponentDescriptionHelper.getDescription(context, clazz);
      // prepare script
      String script;
      {
        String scriptObject[] = {null};
        context.getBroadcastSupport().getListener(CreateObjectScript.class).invoke(
            objectName,
            clazz,
            args,
            scriptObject);
        script = scriptObject[0];
      }
      if (script == null) {
        script = description.getParameter("UiBinder.createInstance");
      }
      // try to use script
      if (script != null) {
        ClassLoader classLoader = context.getClassLoader();
        Map<String, Object> variables = Maps.newTreeMap();
        variables.put("wbpClassLoader", UiBinderParser.class.getClassLoader());
        variables.put("classLoader", classLoader);
        variables.put("componentClass", clazz);
        variables.put("objectName", objectName);
        variables.put("modelClass", description.getModelClass());
        variables.put("modelClassLoader", description.getModelClass().getClassLoader());
        variables.put("args", args);
        Object result = ScriptUtils.evaluate(classLoader, script, variables);
        return result;
      }
    }
View Full Code Here

  /**
   * @return the base variable name for given {@link XmlObjectInfo}.
   */
  private String getBaseName() {
    ComponentDescription description = m_object.getDescription();
    String componentClassName = description.getComponentClass().getName();
    // check type specific information
    {
      ComponentNameDescription nameDescription =
          NamesManager.getNameDescription(description.getToolkit(), componentClassName);
      if (nameDescription != null) {
        return nameDescription.getName();
      }
    }
    // check component parameter
View Full Code Here

TOP

Related Classes of org.eclipse.wb.internal.core.xml.model.description.ComponentDescription

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.