Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    AndreiF
    @andreififiita
    I am sure in the browser dev console should be some whay to print the running gwt version (at least in superdev mode)
    aallnneess
    @aallnneess
    Why is it impossible to wrap a TreeItem in length?
    The tree is in a flaxtable. I can limit the width of the tree via CSS (max-length) but the TreeItem (the name) goes across the screen .....
    Also about other widgets about it ...
    makes no sense to me
    image.png
    Do I really have to cut the string itself?
    aallnneess
    @aallnneess
    seems so :D
    aallnneess
    @aallnneess
    nobody an idea?
    Just try to set the name of the TreeItem as HTML with the <br> tag. That seems possible
    Ahmad K. Bawaneh
    @vegegoku
    You need to provide more useful input so we can help ... like what is the markup you are using for this and what css
    maybe use pastebin or any other tool to reproduce the case
    aallnneess
    @aallnneess
    Hm. That’s a very big project now. The Tree class is over 500 lines in size. So I didn't want to post big code because of this small issue. Because, I just don't understand why TreeItems don't have a wrap option - and doesn't respond to wrap CSS commands.
    Justin Hickman
    @jhickman
    You'd just have to look in chrome dev tools to see what the output HTML and CSS is. Typically, you can tweak it from there to what works, and then apply to your CssResource
    That seems more of an HTML/CSS issue than GWT-specific
    Colin Alworth
    @niloc132
    @andreififiita at runtime in the browser you can check for the $gwt_version of any running gwt app
    from the classpath you can check the About class i believe, but since you have both gwt-dev and gwt-user, you need to further make sure that those match (there is a About.properties file that it reads from), in com.google.gwt.dev
    (if it builds, they probably match)
    aallnneess
    @aallnneess
    @jhickman ah okay that helps a bit thanks
    AndreiF
    @andreififiita
    @niloc132 hi. i was searching about that, but in superdev mode i see no variable $gwt_version
    VM6221:1 Uncaught ReferenceError: $gwt_version is not defined
    at <anonymous>:1:1
    Colin Alworth
    @niloc132
    @andreififiita unless you've heavily modified your linker, it is there
    oh, it isnt in the top window
    it is in the gwt "frame" or whatever context it runs in
    AndreiF
    @andreififiita
    oooooh right, i forgot about that
    Colin Alworth
    @niloc132
    look inside the .cache.js file, should be one of the very first commands
    custom gwt builds will of course have custom versions, iirc all of google's internal builds always used version 0.0.0
    AndreiF
    @andreififiita
    @niloc132 got it!. It was there. inside the .cache.js file and the i printed the variable inside the frame
    Btw, why does gwt need the frame?
    Is there an explanation in the docs?
    Colin Alworth
    @niloc132
    you don't always need it - but it guards against your own code stomping on some external js
    like if gwt decided to name something $, but you already had jquery on the page
    AndreiF
    @andreififiita
    I mean why does gwt loads all code within that frame by default, and not directly in top window
    Ah ok, so it is good patterns / practice
    Colin Alworth
    @niloc132
    using modern modules would make this easier, but gwt2 at least doesnt assume modern js
    AndreiF
    @andreififiita
    And not for "technical" reasons / constraints
    I see, yes
    Colin Alworth
    @niloc132
    correct, you can build a linker that dumps stuff in the top level window
    there may be other reasons that aren't coming to be right away, probably related to hoisting, other js toolkits monkey patching objects that dont belong to them, etc
    AndreiF
    @andreififiita
    @aallnneess i think you can apply a css property, something like "line-break: anywhere" and/or "white-space: normal". Check out the css docs about those. But first, apply a class (gwt styleName) first to control your items properly (from the design persective i mean)
    @aallnneess also, in css you might use "overflow: hidden" togheter with "text-overflow: ellipsis" to slice the text at the end if that is your desire
    @niloc132 i understand
    aallnneess
    @aallnneess
    @andreififiita yes, it was a ** mistake on myside: white-space: nowrap....
    so, i can try as long as the sun shines today with this code snipped in my css class..... :D
    know it works fine
    thanks @all
    AndreiF
    @andreififiita
    @aallnneess aaa of course... the good ol' inherited nowrap, which in 25K lines of css it is hard to find. Very useful tip: use chrome's dev tools, the tab "Computed" (after "Styles", before "Layout")
    search and check for white-space whenever you find this, and then whn you hove the mouse on top, you will see a small arrow, click on it and it will take you to the class/css selector where that instruction is applied
    Rafat J. Al-Barouki
    @rjeeb
    how can I convert byte[] to Blob?
    Rafat J. Al-Barouki
    @rjeeb
    following does that:
          ArrayBuffer arrayBuffer = new ArrayBuffer(bytes.length);
          Uint8Array buffer = new Uint8Array(arrayBuffer);
          buffer.set(TypedArray.SetArrayUnionType.of(bytes));
          BlobPropertyBag options = BlobPropertyBag.create();
          options.setType("application/octet-stream");
          Blob blob =
              new Blob(
                  new Blob.ConstructorBlobPartsArrayUnionType[] {
                    Blob.ConstructorBlobPartsArrayUnionType.of(buffer)
                  },
                  options);