Thursday, December 11, 2014

Re: Cannot bind css classes with Java CssResource interface - GWT 2.7.0 - GSS - UiBinder

use @ClassName annotation to map your style classes with the corresponding method of your interface or rename the style classes to match the name of the methods.

interface MyStyle extends CssResource {
    @ClassName("max-width")
    String maxWidth();

    @ClassName("max-width-2")
    String maxWidth2();
  }

Julien

On Wednesday, December 10, 2014 5:48:12 PM UTC+1, Freddy Boucher wrote:
Hi,

I get an error when I want to bind a UiBinder with gss enable with my Java CssResource interface MyStyle.
Even with conversionMode at lenient it doesn't work.

Is it possible in this state of art?

THX


<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui">
  <ui:style type='com.myerp.web.client.objectview.header.opportunity.OpportunityHeader.MyStyle' gss="true">  
  .max-width {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    float: right;
  }
  
  @media ( min-width: 992px) {
    .max-width-4 {
      max-width: 170px;
    }
    .max-width-2 {
      max-width: 85px;
    }
  }
  
  @media ( min-width: 1200px) {
    .max-width-4 {
      max-width: 240px;
    }
    .max-width-2 {
      max-width: 120px;
    }
  }
  </ui:style>



public class OpportunityHeader extends Composite {

  private static Binder uiBinder = GWT.create(Binder.class);

  interface Binder extends UiBinder<Widget, OpportunityHeader> {
  }

  interface MyStyle extends CssResource {
    String maxWidth();

    String maxWidth2();
  }

  @UiField
  MyStyle style;



GET /recompile/erp
   Job com.myerp.web.Dev_1_0
      starting job: com.myerp.web.Dev_1_0
      binding: locale=en_US
      binding: user.agent=safari
      Compiling module com.myerp.web.Dev
         Ignored 8 units with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
         Computing all possible rebind results for 'com.google.gwt.user.cellview.client.CellTable.Resources'
            Rebinding com.google.gwt.user.cellview.client.CellTable.Resources
               Invoking generator com.google.gwt.resources.rebind.context.InlineClientBundleGenerator
                  Preparing method cellTableStyle
                     [WARN] Invalid characters detected in [selectionBorderWidth]. They have been replaced [SELECTION_BORDER_WIDTH]
         Computing all possible rebind results for 'com.myerp.web.client.objectview.header.opportunity.OpportunityHeader_BinderImpl_GenBundle'
            Rebinding com.myerp.web.client.objectview.header.opportunity.OpportunityHeader_BinderImpl_GenBundle
               Invoking generator com.google.gwt.resources.rebind.context.InlineClientBundleGenerator
                  Creating assignment for style()
                     [ERROR] The following non-obfuscated class is present in a strict CssResource: max-width
                     [ERROR] The following non-obfuscated class is present in a strict CssResource: max-width-2
         [ERROR] Errors in 'gen/com/myerp/web/client/objectview/header/opportunity/OpportunityHeader_BinderImpl.java'
            [ERROR] Line 77: Failed to resolve 'com.myerp.web.client.objectview.header.opportunity.OpportunityHeader_BinderImpl_GenBundle' via deferred binding
         [WARN] For the following type(s), generated source was never committed (did you forget to call commit()?)
            [WARN] com.myerp.web.client.objectview.header.opportunity.OpportunityHeader_BinderImpl_GenBundle_en_US_InlineClientBundleGenerator
         Unification traversed 69951 fields and methods and 6866 types. 6825 are considered part of the current module and 6825 had all of their fields and methods traversed.
      [ERROR] Compiler returned false
      [WARN] recompile failed
      [WARN] continuing to serve previous version

  <set-configuration-property name="CssResource.enableGss" value="true" />
  <set-configuration-property name="CssResource.legacy" value="true" />
  <set-configuration-property name="CssResource.conversionMode" value="lenient" />




--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment