Examples of UiBinderContext


Examples of com.google.gdt.eclipse.designer.uibinder.parser.UiBinderContext

  ////////////////////////////////////////////////////////////////////////////
  @Override
  public Object getValue(XmlObjectInfo object) throws Exception {
    DocumentElement cellElement = getExistingCellElement(object);
    if (cellElement != null) {
      UiBinderContext context = (UiBinderContext) object.getContext();
      return context.getAttributeValue(cellElement, m_attribute);
    }
    return Property.UNKNOWN_VALUE;
  }
View Full Code Here

Examples of com.google.gdt.eclipse.designer.uibinder.parser.UiBinderContext

  @Override
  protected WidgetInfo createLiveComponent() throws Exception {
    m_utils.setLiveManager(true);
    // remember form source
    {
      UiBinderContext context = (UiBinderContext) m_component.getContext();
      m_formSourceOriginal = context.getFormEditor().getSource();
    }
    // prepare empty AbsolutePanel
    AbsolutePanelInfo panel =
        (AbsolutePanelInfo) parse(new String[]{
            "<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'"
View Full Code Here

Examples of com.google.gdt.eclipse.designer.uibinder.parser.UiBinderContext

  @Override
  protected void cleanupLiveComponent(AbstractComponentInfo liveComponentInfo) throws Exception {
    super.cleanupLiveComponent(liveComponentInfo);
    // restore form source
    if (liveComponentInfo != null) {
      UiBinderContext context = (UiBinderContext) liveComponentInfo.getContext();
      context.getFormEditor().setSource(m_formSourceOriginal);
      context.saveFormEditor();
    }
    // reset "live" state of UIObjectManipulations
    m_utils.setLiveWidget(null);
    m_utils.setLiveManager(false);
  }
View Full Code Here

Examples of com.google.gdt.eclipse.designer.uibinder.parser.UiBinderContext

    LocationValue trailing;
    LocationValue size;
  }

  private Location getLocation(WidgetInfo widget, boolean horizontal) {
    UiBinderContext context = widget.getContext();
    DocumentElement layerElement = widget.getElement().getParent();
    Location location = new Location();
    location.layer = layerElement;
    if (horizontal) {
      location.leading = getLocationValue(context, layerElement, "left");
View Full Code Here

Examples of com.google.gdt.eclipse.designer.uibinder.parser.UiBinderContext

      layer.setAttribute(attribute, (int) units + "px");
    } else {
      layer.setAttribute(attribute, SIZE_FORMAT.format(units) + unitName);
    }
    {
      UiBinderContext context = getContext();
      context.setAttributeValue(layer, attribute, ImmutableList.of(units, unit));
    }
  }
View Full Code Here

Examples of com.google.gdt.eclipse.designer.uibinder.parser.UiBinderContext

  }

  @Override
  protected XmlObjectInfo parse() throws Exception {
    // prepare UiBinderContext
    UiBinderContext context;
    if (m_state == null) {
      context = new UiBinderContext(m_file, m_document);
    } else {
      context = new UiBinderContext(m_state, m_classLoader, m_file, m_document);
    }
    // do parse
    try {
      UiBinderParser parser = new UiBinderParser(context);
      return parser.parse();
    } finally {
      // remember GwtState, even if parsing failed, GwtState may be created
      if (m_state == null) {
        m_state = context.getState();
        m_classLoader = context.getClassLoader();
      }
    }
  }
View Full Code Here

Examples of com.google.gdt.eclipse.designer.uibinder.parser.UiBinderContext

public final class UiBinderReportEntriesProvider implements IReportEntriesProvider {
  public void addEntries(final IErrorReport report) {
    // Report entry allowing to include the corresponding java source file of the currently editing
    // UiBinder xml
    try {
      UiBinderContext context = (UiBinderContext) GlobalStateXml.getEditorContext();
      if (context == null) {
        // not applicable
        return;
      }
      IType formType = context.getFormType();
      String name = formType.getTypeQualifiedName() + ".java";
      String source = formType.getCompilationUnit().getSource();
      report.addEntry(new StringFileReportEntry(name, source) {
        @Override
        public void write(ZipOutputStream zipStream) throws Exception {
View Full Code Here

Examples of com.google.gdt.eclipse.designer.uibinder.parser.UiBinderContext

      return false;
    }
    // prepare Java source
    String formSource;
    {
      UiBinderContext context = (UiBinderContext) m_object.getContext();
      formSource = getTypeSource(context.getFormType());
    }
    // widget name
    if (!formSource.contains("\"" + name + "\"")) {
      return false;
    }
View Full Code Here

Examples of com.google.gdt.eclipse.designer.uibinder.parser.UiBinderContext

  private static String call_getPreview(WidgetInfo widget,
      String propertyName,
      String exposedName,
      boolean isPublic) throws Exception {
    UiBinderContext context = widget.getContext();
    String initialSource = context.getDocument().get();
    // prepare action
    IAction action;
    {
      action = getExposeAction(widget, propertyName);
      assertTrue(action.isEnabled());
    }
    // get preview
    String previewSource;
    {
      assertNull(call_validate(action, exposedName));
      previewSource =
          (String) ReflectionUtils.invokeMethod2(
              action,
              "getPreviewSource",
              boolean.class,
              isPublic);
    }
    // assert that source is not changed
    assertEquals(initialSource, context.getDocument().get());
    // OK
    return previewSource;
  }
View Full Code Here

Examples of com.google.gdt.eclipse.designer.uibinder.parser.UiBinderContext

        return getExistingElement(object);
      }

      @Override
      public Object getValue(XmlObjectInfo object) throws Exception {
        UiBinderContext context = (UiBinderContext) object.getContext();
        return context.getAttributeValue(getElement(object), m_attribute);
      }
    };
    GenericPropertyDescription description =
        new GenericPropertyDescription(name, name, type, accessor);
    description.setConverter(converter);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.