Re: value function in GSS and math formulas

2018-05-06 Thread vitrums
I can't get my mind around the fact that *value* function and *eval* are 
always runtime substitutions for *ImageResource*, when it's clearly said in 
http://www.gwtproject.org/doc/latest/DevGuideClientBundle.html for *@eval*
   
   - 
   
   If the user-defined function can be statically evaluated by the 
   compiler, then the implementation of the specific CssResource should 
   collapse to just a string literal.
   
One of the major optimizations provided by ClientBundle is an image bundle 
generation, and it's done at compile time. Also any ClientBundle is a 
subject of GWT.create(...) call. My point is that there's no runtime 
information required here. And yet for

@def MY_CONSTANT 5px;
@def TOP_PANEL_BUTTON_AREA_MARGIN_TOP eval(
"net.vit.gwt.dev.ui.popuplogger.client.PopupLoggerImpl.evalTopPanelButtonAreaMarginTop()"
);

I get only

Java expression : net.vit.gwt.dev.ui.popuplogger.client.PopupLoggerImpl.
evalTopPanelButtonAreaMarginTop()

I'm not sure at which point the call to *evalTopPanelButtonAreaMarginTop()* is 
done and why so late. But it precludes from mixing *value* or *eval* in GSS 
formulas. Therefore I have to either rely on CSS3 *calc()* funcion, or do 
everything in static methods like *evalTopPanelButtonAreaMarginTop()*.

-

So the task is still the same: *derive an offset, based on the information 
about image(s) size and other ready-to-use constants when 
CssResource.ensureInjected() is called. *

Let's say I need to declare a class *.inner* in *my.gss*, for which 
*margin-top:* property would be equal to *( - <**height **of 
image B>)/2 + constant*. I declare a static method:

*lib.MyWidgetImpl.java:*
public static String evalMarginTop() {
  int val = (*resource*.imageA().getHeight() - *resource*.imageB().getHeight
()) / 2 + *css*.myConstant();
  return val + "px";
}

Now where do I get *resource* and *css *from? Well, I believe I'm forced to 
statically inject them. I didn't manage to find a better solution for my 
GIN controlled client lib. These are the miniumum requirements:

*lib.MyWidgetImpl.java:*
@Inject static MyWidgetResources resources;
@Inject static MyWidgetCss css;

*lib/myWidget.gss*:
@def MY_CONSTANT 5px;
@def MARGIN_TOP eval("lib.MyWidgetImpl.evalMarginTop()");

.inner {
  margin-top: MARGIN_TOP;
}

*lib.MyWidgetCss.java:*
@ImportedWithPrefix("myWidget")
public interface MyWidgetCss extends CssResource, SharedCss {
  String DEFAULT_PATH = "lib/my.gss";
  ...
  int myConstant();
}

*lib.MyWidgetResource.java:*
public interface MyWidgetResources extends ClientBundle {
  @Source("lib/imageA.png")
  ImageResource imageA();

  @Source("lib/imageB.png")
  ImageResource imageB();

  @Source({MyWidgetCss.DEFAULT_PATH, SharedCss.DEFAULT_PATH});
  MyWidgetCss myWidgetCss();
}

*Application:*

*blah.AppResource.java:*
public interface AppResource extends ClientBundle, MyWidgetResource,...other 
bundles {
  ...
}

*blah.AppModule.java:*
@Override
protected void configure() {
  bind(MyWidgetResource.class).to(AppResource.class).in(Singleton.class);
  requestStaticInjection(MyWidgetImpl.class);
}

@Provides
@Singleton
public MyWidgetCss getMyWidgetCss(MyWidgetResource resources) {
  return resources.MyWidgetCss();
}

I don't want to statically inject resources and request static injection 
for each and every ui class in my application, for which I have a GSS file 
with runtime evaluation. I want to inject resources in constructor. Why 
does it have to be so ugly in order to make my GIN controlled client lib 
work?

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


value function in GSS and math formulas

2018-05-06 Thread vitrums
I've been struggling forever with a simple task of using size properties of 
an image as a constant in my ClientBundle managed .css file. Every time I 
have to calculate an offset based on some image width or height, I'm forced 
to involve ugly *@eval*. And with GSS things haven't become easier. My hope 
is that it was just me being blind in a search for a decent TOC of either 
GSS or full syntax of first generation CssResource-style .css files.

Here's a snippet:

@def POPUP_LOGGER_TOP_TAILS_HEIGHT value('popupLoggerTopTails.getHeight', 
'px');
@def POPUP_LOGGER_RED_BUTTON_HEIGHT value('popupLoggerRedButton.getHeight', 
'px');
@def TOP_PANEL_BUTTON_AREA_MARGIN_TOP divide(add(
POPUP_LOGGER_TOP_TAILS_HEIGHT, POPUP_LOGGER_RED_BUTTON_HEIGHT), 2);

I get this error: popup-logger.gss[line: 54 column: 42]: Size must be a 
CssNumericNode with a unit or 0; was: popupLoggerTopTails().getHeight() + 
"px"

Obviously I'm using *value* wrong. Here's an excerpt from CssResource.java:

   - value("bundleFunction.someFunction[.other[...]]" [, "suffix"]) 
   substitute the value of a sequence of named zero-arg function invocations. 
   An optional suffix will be appended to the return value of the function. 
   The first name is resolved relative to the bundle interface passed to 
   com.google.gwt.core.client.GWT.create(Class) 
   
.
 
   An example: 
   
.bordersTheSizeOfAnImage {
  border-left: value('leftBorderImageResource.getWidth', 'px') solid blue;
}
   
   
Now when it comes to GSS and the math functions:

Each of these functions can take a variable number arguments. Arguments may 
be purely numeric or CSS sizes with units (though mult() and divide() only 
allow the first argument to have a unit).

So technically this divide(add("15px", "10px"), 2) should work.

But instead of "15px" I get this this: *popupLoggerTopTails().getHeight() + 
"px". *Looks like a waste of opportunity. Completely unusable and 
counterintuitive design. It's not a *value* function. It's a *string 
concatenation* function. To become a *value* function it has to be already 
evaluated to "15px" at this point.

But I'm sure it's just yet another time when I got confused due to a lack 
of accessible use case examples. This code snippet 
at http://www.gwtproject.org:

@def SPRITE_WIDTH value('imageResource.getWidth', 'px') .selector { width: 
SPRITE_WIDTH; }

is literally the best example we ever had, which ironically contains a 
missing ";" after ")" syntax error.

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


Re: Discussion: gwt-user.jar-like uber jar for T.Broyer's multi-module project.

2018-04-28 Thread vitrums

>
> What you have is a gwt-app that you use as a playground/sandbox to help 
> you test gwt-lib⋅s. It happens that the gwt-app was initialized from the 
> archetype, but it could have not been the case and wouldn't have changed 
> anything to your gwt-lib issue. It also happens that your gwt-app is built 
> in the same Maven multi-module project, but again it could have been 
> different, and it wouldn't have changed your gwt-lib issue. This is why I 
> said, and keep saying, the archetype is not part of the equation.
>

Oh wow. Now I can very well see that indeed, multi-module archetype hasn't 
been the part of the equation this whole time. In fact the original problem 
was eventually reduced to a simple question of ideal use case for 
*gwt:generate-module* and *gwt:generate-module-metadata*, and whether its 
use would be appropriate for *gwt-lib* modules with deep inheritence 
structure. 

Your insight on the problems raised by the upcoming (hopefully) release of 
GWT3.0 makes me think about many things. I guess a well thought 
architecture of an app is not a subject of depreciation and it will easily 
surpass those days with grace. But it's hard to be optimistic about the 
fate of actual client components. Not the the best time to invest time and 
efforts into building castles, it may turn out that you built them on a 
swamp.

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


Re: Discussion: gwt-user.jar-like uber jar for T.Broyer's multi-module project.

2018-04-27 Thread vitrums


On Friday, April 27, 2018 at 7:38:41 PM UTC+3, Thomas Broyer wrote:
 

> - **
>>
>
> I must say I don't understand what you're talking about here (i.e. how 
> you'd use them here)
>

In context of *maven-jar-plugin* I was simply referring to something like 
e.g. 
https://maven.apache.org/plugins/maven-jar-plugin/examples/attached-jar.html
 

> - *BOM* parent to manage dependencies better. I think it also helps to 
>> keep versioning clean.
>>
>
> I'm not sure how this is related to the issue, but that can be useful to 
> the users of the libraries yes.
>

I've seen a hack for large multi-module projects. It introduced another 
bom-like parent with a dynamic list of child modules to better controll 
what has to be rebuild. Plus it allowed a "multiartifact" nature of build.

If your lib does not have one single main gwt.xml entry point but really is 
> more like a gwt-user.jar "set of libraries", then you'd probably better 
> skip the gwt:generate-module and gwt:generate-module-metadata and *put 
> all your modules in src/main/resources (and not use 
> src/main/module.gwt.xml).*
>
 
To recap. Are you suggesting to get rid of *module.gwt.xml* and related to 
it *gwt:generate-module* and *gwt:generate-module-metadata* in the build 
process, because you don't think using this pattern to be a good practice 
anymore? So I should simply get back to the roots of GWT, where I had to 
manually put *MyTextBox.gwt.xml* in the directory that is root for *client* 
folder, 
but this time under *resources *(as opposed to *src*), shouldn't I?

The real question is why you're developing my-client-lib and 
> my-client-lib-a separately if your goal is to ship them as a single 
> artifact (there can be use cases of course, but it's the exception rather 
> than the rule).
>

Because I look at *module.gwt.xml* in *my-client-lib* and simply don't 
fully understand how I can have my little widget-size modules like 
*TextBox.gwt.xml* as a part of this module, since it would go against the 
*gwt:generate-module* idiom. Therefore I'm left to think, that have to 
physically slice the project into many little modules... *That is a big 
part of the my overall confusion*. Look at *gwt-user.jar*. Googlers made it 
the way that it logically contains dozens of modules. But imagine they were 
using Maven and this archetype. Did they really have to physically keep 
them as different modules?

I noticed your note of criticism about how erroneously I use this 
archetype. Basically you imply that I should not use it to develop library 
code. But I'm not sure why it would be such a bad idea. I mean I have to 
develop it somewhere. This way I have a separate "playground" project 
dedicated to develop some components that are frequently reused in other 
projects. It's not a huge scale widget library, but still a set of shared 
interfaces, classes and resources common to more than one project. And in 
terminology of *sandbox* example I have a *gwt-app* packaged 
*sandbox-client* with Entry Point. I add dependencies to lib-packaged 
client modules like *my-client-lib* to debug and develop them. But then I 
stumbled across the "one module.gwt.xml per one Maven module" limitation 
and started to think about workarounds like *uber-jar* one. That's where 
the whole buzz came from.

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


Discussion: gwt-user.jar-like uber jar for T.Broyer's multi-module project.

2018-04-27 Thread vitrums
Any experienced developer tends to reuse existing components and organize 
his own code to allow reusability in future whenever it is possible. 
Division of labor further encourages a group of developers to physically 
split a big project into modules and work independently on each part. I 
think T.Broyer's multi-module project archetype for Maven introduces a 
great platform enabling these features and making versioning task look 
effortless.

However I personally start to have issues with the last part, when it comes 
to the release. Specifically, should I aggregate the build artifacts into 
one *gwt-user.jar* kind of unit? I know it's a broad topic, and there're 
multiple angles to look at this problem, one of which says "it's not Maven 
way" (though I start to doubt that I applied "Maven way" concept in the 
appropriate contex). Therefore I want to hear your advice regarding this 
matter and avoid reinventing the wheel. If there's a sample project already 
configured to do the similar task with grace, then I guess a link to github 
will be sufficient.

Imagine you're developing *gwt-user*. Inside *com\google\gwt\user* folder 
you'll find *client *direcotry and a bunch of *.gwt.xml* files such 
as *User.gwt.xml, UI.gwt.xml, TextBox.gwt.xml.* The latter contains a bunch 
of deferred binding instructions, e.g.:

  
  


  

*User* inherits *UI *and *UI *inherits *TextBox*. But then we also have a 
subfolder *datepicker *with *DatePicker.gwt.xml* and it's own *client*
 directory.

So my view on this is that you don't wanna ship *datepicker.jar* to your 
clients, but instead combine the components from all related projects and 
modules into one library.



Further in the text I'm gonna present my hack to multi-module archetype 
build configuration based on *maven-shade-plugin*, so let's get into 
details.

There were three strong candidates to do this job: *maven-jar-plugin, *
*maven-assembly-plugin* and *maven-shade-plugin*. However the latter was 
specifically made for:
- This plugin provides the capability to package the artifact in an 
*uber-jar*, including its dependencies and to shade - i.e. rename - the 
packages of some of the dependencies.
- The Shade Plugin has a single goal: *shade:shade *is bound to the *package 
*phase and is used to create a shaded jar.

In multi-module structure of my *sandbox *project I have two *gwt-lib* packaged 
modules *my-client-lib* and *my-client-lib-a*. The task is to gather their 
build artifacts inside one jar. My solution was to create a subsidiary 
*module* *sandbox-gwt* (though it could as well be another *project*) with 
the same groupId as *my-client-lib** and to include only such artifacts in 
the uber-jar. Making it this way automates the task of naming by exploiting 
${project.groupId} and ${project.version} properties.

*pom.xml* of *sandbox-gwt *module*:*

http://maven.apache.org/POM/4.0.0;
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
 4.0.0
 
   com.example.project
   sandbox
   0.0.1-SNAPSHOT
 
 net.coolcode.gwt
 sandbox-gwt

 
   
 ${project.groupId}
 my-client-lib
 ${project.version}
   
   
 ${project.groupId}
 my-client-lib-a
 ${project.version}
   
 

 
   
 
   org.apache.maven.plugins
   maven-shade-plugin
   3.1.1
   
 
   
 ${project.groupId}
   
 
 true
   
   
 
   package
   
 shade
   
 
   
 
   
 


*artifactSet* - Artifacts to include/exclude from the final artifact. 
Artifacts are denoted by composite identifiers of the general form 
*groupId:artifactId:type:classifier*.

But there's a set of techniques mentioned in different sources, which might 
do the task better?! Those include the use of:
- **
- **
- *BOM* parent to manage dependencies better. I think it also helps to keep 
versioning clean.



I also noticed, that *gwt-maven-plugin* can generate some code in <
*actual-module-name>.gwt.xml*, such as adding



In the context of a large uber-jar such as *gwt-user.jar* if it could 
establish the crossreferencing between modules based only on Maven 
dependencies, that would be interesting. E.g. to put 



inside *MyCoolCodeApp.gwt.xml*, if *my-client-lib* depends on 
*my-client-lib-a*.



Lastly I'm curious, in a context of development of *gwt-user* project it 
seems that due to an unconventional for GWT applications module structure (
*src/main/module.gwt.xml* not 

Re: About running tests in a project built via tbroyer's maven multi-module archetype

2016-12-02 Thread vitrums
Even though I can read .pom configuration files, I'm not strong in 
configuring them myself, when it comes to multi-module project. Especially 
when it comes to packaging servlets as *jar*. So I introduced the new 
module *sandbox-server-lib*. But which files should it consume from 
*sandbox**-server*? E.g. if I move only 
*com.mycompany.GreetingServiceImpl.java* under *sandbox-server-lib* I won't 
have servlet mappings, necessary for jetty to operate during tests in 
*sandbox-client* (should I duplicate some files and have them in both 
modules)? If I move */src/main/webapp,* then I'm not even sure what will be 
left for  *sandbox-server* to package as *war* and how to deploy it in 
container. And which dependencies, plugins and configurations would 
*sandbox-server-lib's* pom require (and what left from *sandbox-server* after 
all these operations)? I know I'm terribly lost :)

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


Re: About running tests in a project built via tbroyer's maven multi-module archetype

2016-12-01 Thread vitrums
It's also not clear for me why greetingService test classes must've been 
completely excluded from the *modular-webapp* archetype. Archetypes in 
general serve to unify the maximum of core best practices relevant to some 
particular project structure (tests including), don't they?

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


Re: Where can I find a sample for multi-module GWT app built with maven?

2016-11-21 Thread vitrums
Oh well, it seems that I totally overlooked GWT plugin documentation site. 
Thank you, it is exactly what I've been looking for. Perhaps, it's worth to 
add a line such as "For Eclipse IDE users refer to step-by-step 
instructions at 
http://gwt-plugins.github.io/documentation/gwt-eclipse-plugin/maven/Maven.html; 
in the aforementioned resources. I was so close to give up on everything...

On Monday, November 21, 2016 at 10:33:17 PM UTC+3, Juan Pablo Gardella 
wrote:
>
> Try to install last gwt eclipse plugin first: 
> http://gwt-plugins.github.io/documentation/
>
> Regarding launchers: 
> http://eclipsesnippets.blogspot.com.ar/2007/07/tip-creating-and-sharing-launch.html
> Basically, you have to create them.
>
> Regards,
> Juan
>
>
> On Mon, 21 Nov 2016 at 16:27 vitrums <vit...@gmail.com > 
> wrote:
>
>> Sorry, but I'm not sure where I can find these lines. Searched within my 
>> eclipse folder, but no match. Also, it looks like these settings are 
>>  global and may affect all other projects.
>>
>>
>> On Monday, November 21, 2016 at 10:07:38 PM UTC+3, Juan Pablo Gardella 
>> wrote:
>>
>>>
>>> Install GWT eclipse plugin and then use eclipse launchers to start them.
>>>
>>>
>>> *SDM launcher:*
>>>
>>> ...
>>> >> value="com.google.gwt.dev.DevMode"/>
>>> >> value="-war *YOURWRAR *-logLevel INFO -port auto -remoteUI 
>>> ${gwt_remote_ui_server_port}:${unique_id} -codeServerPort 9997 
>>> *ENTRYPOINTHERE* "/>
>>> ...
>>>
>>>
>>> Server launcher:
>>> (Execute maven goals)
>>>
>>> Regards,
>>> Juan
>>>
>>> On Mon, 21 Nov 2016 at 16:01 vitrums <vit...@gmail.com> wrote:
>>>
>>>> Thank you. I tried it before, but I had a syntax error in that line 
>>>> (missed a "-" before a key).
>>>>
>>>> I wonder now though how to run this sample app within Eclipse with 
>>>> *gwt:devmode* goal on Jetty. Examining the modules with Project 
>>>> Explorer shows, that src/main/webapp is related to **-server* module 
>>>> and therefore, *mvn install* produces the target within this module. 
>>>> Hence, running mvn *gwt:devmode* on the project opens GWT Development 
>>>> Mode window but finds no startup URL:
>>>>
>>>> [WARN] No startup URLs supplied and no plausible ones found -- 
>>>> use -startupUrl 
>>>>
>>>>
>>>> On Monday, November 21, 2016 at 9:16:15 PM UTC+3, Juan Pablo Gardella 
>>>> wrote:
>>>>
>>>>> Did you try?
>>>>>
>>>>> mvn archetype:generate \
>>>>>
>>>>> -DarchetypeCatalog=https://oss.sonatype.org/content/repositories/snapshots/
>>>>>  \
>>>>>-DarchetypeGroupId=net.ltgt.gwt.archetypes \
>>>>>-DarchetypeArtifactId=moduler-webapp \
>>>>>-DarchetypeVersion=1.0-SNAPSHOT
>>>>>
>>>>>
>>>>>
>>>>> On Mon, 21 Nov 2016 at 14:48 vitrums <vit...@gmail.com> wrote:
>>>>>
>>>> In the latest GWT 2.8.0 distribution *webAppCreator *tool generates 
>>>> *pom.xml 
>>>>>> *for a sample project from 
>>>>>> *com\google\gwt\user\tools\templates\maven\pom.xmlsrc* located in 
>>>>>> *gwt-user.jar*. The *groupId* for *gwt-maven-plugin* is now set as 
>>>>>> *net.ltgt.gwt.maven*. According to 
>>>>>> https://tbroyer.github.io/gwt-maven-plugin/index.html this project 
>>>>>> disctincts itself from *Mojo's Maven Plugin for GWT* 
>>>>>> https://gwt-maven-plugin.github.io/gwt-maven-plugin/index.html. The 
>>>>>> provided documentation is very succinct compared to Mojo's; it says 
>>>>>> little 
>>>>>> if anything about multi-moduling (provides a link at 
>>>>>> https://github.com/tbroyer/gwt-maven-archetypes/, which I can't get 
>>>>>> my head around... simply how to use it). According to the site the 
>>>>>> latest 
>>>>>> update was made in Jan, while the Mojo's docs were updated in Oct. of 
>>>>>> this 
>>>>>> year. And I could find a ready to use example of multi-module GWT app 
>>>>>> with 
>>>>>> maven at https://github.com/steinsag/gwt-maven-example, which 
>>>>>> unfortunate

Re: Where can I find a sample for multi-module GWT app built with maven?

2016-11-21 Thread vitrums
Sorry, but I'm not sure where I can find these lines. Searched within my 
eclipse folder, but no match. Also, it looks like these settings are 
 global and may affect all other projects.

On Monday, November 21, 2016 at 10:07:38 PM UTC+3, Juan Pablo Gardella 
wrote:
>
>
> Install GWT eclipse plugin and then use eclipse launchers to start them.
>
>
> *SDM launcher:*
>
> ...
>  value="com.google.gwt.dev.DevMode"/>
>  value="-war *YOURWRAR *-logLevel INFO -port auto -remoteUI 
> ${gwt_remote_ui_server_port}:${unique_id} -codeServerPort 9997 
> *ENTRYPOINTHERE* "/>
> ...
>
>
> Server launcher:
> (Execute maven goals)
>
> Regards,
> Juan
>
> On Mon, 21 Nov 2016 at 16:01 vitrums <vit...@gmail.com > 
> wrote:
>
>> Thank you. I tried it before, but I had a syntax error in that line 
>> (missed a "-" before a key).
>>
>> I wonder now though how to run this sample app within Eclipse with 
>> *gwt:devmode* goal on Jetty. Examining the modules with Project Explorer 
>> shows, that src/main/webapp is related to **-server* module and 
>> therefore, *mvn install* produces the target within this module. Hence, 
>> running mvn *gwt:devmode* on the project opens GWT Development Mode 
>> window but finds no startup URL:
>>
>> [WARN] No startup URLs supplied and no plausible ones found -- 
>> use -startupUrl 
>>
>>
>> On Monday, November 21, 2016 at 9:16:15 PM UTC+3, Juan Pablo Gardella 
>> wrote:
>>
>>> Did you try?
>>>
>>> mvn archetype:generate \
>>>
>>> -DarchetypeCatalog=https://oss.sonatype.org/content/repositories/snapshots/ 
>>> \
>>>-DarchetypeGroupId=net.ltgt.gwt.archetypes \
>>>-DarchetypeArtifactId=moduler-webapp \
>>>-DarchetypeVersion=1.0-SNAPSHOT
>>>
>>>
>>>
>>> On Mon, 21 Nov 2016 at 14:48 vitrums <vit...@gmail.com> wrote:
>>>
>> In the latest GWT 2.8.0 distribution *webAppCreator *tool generates *pom.xml 
>>>> *for a sample project from 
>>>> *com\google\gwt\user\tools\templates\maven\pom.xmlsrc* located in 
>>>> *gwt-user.jar*. The *groupId* for *gwt-maven-plugin* is now set as 
>>>> *net.ltgt.gwt.maven*. According to 
>>>> https://tbroyer.github.io/gwt-maven-plugin/index.html this project 
>>>> disctincts itself from *Mojo's Maven Plugin for GWT* 
>>>> https://gwt-maven-plugin.github.io/gwt-maven-plugin/index.html. The 
>>>> provided documentation is very succinct compared to Mojo's; it says little 
>>>> if anything about multi-moduling (provides a link at 
>>>> https://github.com/tbroyer/gwt-maven-archetypes/, which I can't get my 
>>>> head around... simply how to use it). According to the site the latest 
>>>> update was made in Jan, while the Mojo's docs were updated in Oct. of this 
>>>> year. And I could find a ready to use example of multi-module GWT app with 
>>>> maven at https://github.com/steinsag/gwt-maven-example, which 
>>>> unfortunately uses *org.codehaus.mojo's gwt-maven-plugin*. May be I 
>>>> can adapt this solution to use *net.ltgt.gwt.maven **gwt-maven-plugin 
>>>> *somehow, 
>>>> or what should I do?
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "GWT Users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to google-web-toolkit+unsubscr...@googlegroups.com.
>>>>
>>> To post to this group, send email to google-we...@googlegroups.com.
>>>
>>>
>>>> Visit this group at https://groups.google.com/group/google-web-toolkit.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "GWT Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-web-toolkit+unsubscr...@googlegroups.com .
>> To post to this group, send email to google-we...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/google-web-toolkit.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

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


Re: Where can I find a sample for multi-module GWT app built with maven?

2016-11-21 Thread vitrums
Thank you. I tried it before, but I had a syntax error in that line (missed 
a "-" before a key).

I wonder now though how to run this sample app within Eclipse with 
*gwt:devmode* goal on Jetty. Examining the modules with Project Explorer 
shows, that src/main/webapp is related to **-server* module and therefore, *mvn 
install* produces the target within this module. Hence, running mvn 
*gwt:devmode* on the project opens GWT Development Mode window but finds no 
startup URL:

[WARN] No startup URLs supplied and no plausible ones found -- use 
-startupUrl 

On Monday, November 21, 2016 at 9:16:15 PM UTC+3, Juan Pablo Gardella wrote:
>
> Did you try?
>
> mvn archetype:generate \
>
> -DarchetypeCatalog=https://oss.sonatype.org/content/repositories/snapshots/ \
>-DarchetypeGroupId=net.ltgt.gwt.archetypes \
>-DarchetypeArtifactId=moduler-webapp \
>-DarchetypeVersion=1.0-SNAPSHOT
>
>
>
> On Mon, 21 Nov 2016 at 14:48 vitrums <vit...@gmail.com > 
> wrote:
>
>> In the latest GWT 2.8.0 distribution *webAppCreator *tool generates *pom.xml 
>> *for a sample project from 
>> *com\google\gwt\user\tools\templates\maven\pom.xmlsrc* located in 
>> *gwt-user.jar*. The *groupId* for *gwt-maven-plugin* is now set as 
>> *net.ltgt.gwt.maven*. According to 
>> https://tbroyer.github.io/gwt-maven-plugin/index.html this project 
>> disctincts itself from *Mojo's Maven Plugin for GWT* 
>> https://gwt-maven-plugin.github.io/gwt-maven-plugin/index.html. The 
>> provided documentation is very succinct compared to Mojo's; it says little 
>> if anything about multi-moduling (provides a link at 
>> https://github.com/tbroyer/gwt-maven-archetypes/, which I can't get my 
>> head around... simply how to use it). According to the site the latest 
>> update was made in Jan, while the Mojo's docs were updated in Oct. of this 
>> year. And I could find a ready to use example of multi-module GWT app with 
>> maven at https://github.com/steinsag/gwt-maven-example, which 
>> unfortunately uses *org.codehaus.mojo's gwt-maven-plugin*. May be I can 
>> adapt this solution to use *net.ltgt.gwt.maven **gwt-maven-plugin *somehow, 
>> or what should I do?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "GWT Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-web-toolkit+unsubscr...@googlegroups.com .
>> To post to this group, send email to google-we...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/google-web-toolkit.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

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


Re: Where can I find a sample for multi-module GWT app built with maven?

2016-11-21 Thread vitrums
Sure, I ran

mvn archetype:generate 
DarchetypeCatalog=https://oss.sonatype.org/content/repositories/snapshots/ 
DarchetypeGroupId=net.ltgt.gwt.archetypes 
DarchetypeArtifactId=modular-webapp DarchetypeVersion=1.0-SNAPSHOT

and got

[INFO] Scanning for projects...
[INFO] 

[INFO] BUILD FAILURE
[INFO] 

[INFO] Total time: 0.070 s
[INFO] Finished at: 2016-11-21T21:23:14+03:00
[INFO] Final Memory: 5M/123M
[INFO] 

[ERROR] The goal you specified requires a project to execute but there is 
no POM in this directory (c:\temp\mvnGwtTestProjects). Please verify you 
invoked Maven from the correct directory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, 
please read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException


On Monday, November 21, 2016 at 9:16:15 PM UTC+3, Juan Pablo Gardella wrote:
>
> Did you try?
>
> mvn archetype:generate \
>
> -DarchetypeCatalog=https://oss.sonatype.org/content/repositories/snapshots/ \
>-DarchetypeGroupId=net.ltgt.gwt.archetypes \
>-DarchetypeArtifactId=moduler-webapp \
>-DarchetypeVersion=1.0-SNAPSHOT
>
>
>
> On Mon, 21 Nov 2016 at 14:48 vitrums <vit...@gmail.com > 
> wrote:
>
>> In the latest GWT 2.8.0 distribution *webAppCreator *tool generates *pom.xml 
>> *for a sample project from 
>> *com\google\gwt\user\tools\templates\maven\pom.xmlsrc* located in 
>> *gwt-user.jar*. The *groupId* for *gwt-maven-plugin* is now set as 
>> *net.ltgt.gwt.maven*. According to 
>> https://tbroyer.github.io/gwt-maven-plugin/index.html this project 
>> disctincts itself from *Mojo's Maven Plugin for GWT* 
>> https://gwt-maven-plugin.github.io/gwt-maven-plugin/index.html. The 
>> provided documentation is very succinct compared to Mojo's; it says little 
>> if anything about multi-moduling (provides a link at 
>> https://github.com/tbroyer/gwt-maven-archetypes/, which I can't get my 
>> head around... simply how to use it). According to the site the latest 
>> update was made in Jan, while the Mojo's docs were updated in Oct. of this 
>> year. And I could find a ready to use example of multi-module GWT app with 
>> maven at https://github.com/steinsag/gwt-maven-example, which 
>> unfortunately uses *org.codehaus.mojo's gwt-maven-plugin*. May be I can 
>> adapt this solution to use *net.ltgt.gwt.maven **gwt-maven-plugin *somehow, 
>> or what should I do?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "GWT Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-web-toolkit+unsubscr...@googlegroups.com .
>> To post to this group, send email to google-we...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/google-web-toolkit.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

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


Re: Where can I find a sample for multi-module GWT app built with maven?

2016-11-21 Thread vitrums
Sure, I ran

mvn archetype:generate 
DarchetypeCatalog=https://oss.sonatype.org/content/repositories/snapshots/ 
DarchetypeGroupId=net.ltgt.gwt.archetypes 
DarchetypeArtifactId=modular-webapp DarchetypeVersion=1.0-SNAPSHOT


and got


On Monday, November 21, 2016 at 9:16:15 PM UTC+3, Juan Pablo Gardella wrote:
>
> Did you try?
>
> mvn archetype:generate \
>
> -DarchetypeCatalog=https://oss.sonatype.org/content/repositories/snapshots/ \
>-DarchetypeGroupId=net.ltgt.gwt.archetypes \
>-DarchetypeArtifactId=moduler-webapp \
>-DarchetypeVersion=1.0-SNAPSHOT
>
>
>
> On Mon, 21 Nov 2016 at 14:48 vitrums <vit...@gmail.com > 
> wrote:
>
>> In the latest GWT 2.8.0 distribution *webAppCreator *tool generates *pom.xml 
>> *for a sample project from 
>> *com\google\gwt\user\tools\templates\maven\pom.xmlsrc* located in 
>> *gwt-user.jar*. The *groupId* for *gwt-maven-plugin* is now set as 
>> *net.ltgt.gwt.maven*. According to 
>> https://tbroyer.github.io/gwt-maven-plugin/index.html this project 
>> disctincts itself from *Mojo's Maven Plugin for GWT* 
>> https://gwt-maven-plugin.github.io/gwt-maven-plugin/index.html. The 
>> provided documentation is very succinct compared to Mojo's; it says little 
>> if anything about multi-moduling (provides a link at 
>> https://github.com/tbroyer/gwt-maven-archetypes/, which I can't get my 
>> head around... simply how to use it). According to the site the latest 
>> update was made in Jan, while the Mojo's docs were updated in Oct. of this 
>> year. And I could find a ready to use example of multi-module GWT app with 
>> maven at https://github.com/steinsag/gwt-maven-example, which 
>> unfortunately uses *org.codehaus.mojo's gwt-maven-plugin*. May be I can 
>> adapt this solution to use *net.ltgt.gwt.maven **gwt-maven-plugin *somehow, 
>> or what should I do?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "GWT Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-web-toolkit+unsubscr...@googlegroups.com .
>> To post to this group, send email to google-we...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/google-web-toolkit.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

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


Where can I find a sample for multi-module GWT app built with maven?

2016-11-21 Thread vitrums
In the latest GWT 2.8.0 distribution *webAppCreator *tool generates *pom.xml 
*for a sample project from 
*com\google\gwt\user\tools\templates\maven\pom.xmlsrc* located in 
*gwt-user.jar*. The *groupId* for *gwt-maven-plugin* is now set as 
*net.ltgt.gwt.maven*. According to 
https://tbroyer.github.io/gwt-maven-plugin/index.html this project 
disctincts itself from *Mojo's Maven Plugin for GWT* 
https://gwt-maven-plugin.github.io/gwt-maven-plugin/index.html. The 
provided documentation is very succinct compared to Mojo's; it says little 
if anything about multi-moduling (provides a link at 
https://github.com/tbroyer/gwt-maven-archetypes/, which I can't get my head 
around... simply how to use it). According to the site the latest update 
was made in Jan, while the Mojo's docs were updated in Oct. of this year. 
And I could find a ready to use example of multi-module GWT app with maven 
at https://github.com/steinsag/gwt-maven-example, which unfortunately uses 
*org.codehaus.mojo's gwt-maven-plugin*. May be I can adapt this solution to 
use *net.ltgt.gwt.maven **gwt-maven-plugin *somehow, or what should I do?

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


Re: Can't build maven sample GWT app, generated by webAppCreator

2016-11-17 Thread vitrums
Problem was fixed by removing the .m2 directory and all its content and 
running *mvn package* in command prompt, therefore forcing maven to 
download them again. I assume, that the original corruption had something 
to do with eclipse.

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


Re: Can't build maven sample GWT app, generated by webAppCreator

2016-11-17 Thread vitrums
Problem was fixed by removing the .m2 directory and all its content and 
running *mvn package* in command prompt, therefore forcing maven to 
download them again. I assume, that the original corruption had something 
to do with eclipse.

On Wednesday, November 16, 2016 at 6:10:04 PM UTC+3, vitrums wrote:
>
> [INFO] Scanning for projects...
> [INFO] 
> 
> [INFO] 
> 
> [INFO] Building com.example.webapp.WebApp 1.0-SNAPSHOT
> [INFO] 
> 
> [INFO] 
> [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
> WebApp ---
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] skip non existing resourceDirectory 
> C:\temp\mvnSampleGwtApp\WebApp\src\main\resources
> [INFO] 
> [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ WebApp ---
> [INFO] Changes detected - recompiling the module!
> [INFO] Compiling 5 source files to 
> C:\temp\mvnSampleGwtApp\WebApp\target\WebApp-1.0-SNAPSHOT\WEB-INF\classes
> [WARNING] error reading 
> C:\Users\vitru\.m2\repository\ant\ant\1.6.5\ant-1.6.5.jar; invalid LOC 
> header (bad signature)
> [WARNING] error reading 
> C:\Users\vitru\.m2\repository\com\ibm\icu\icu4j\50.1.1\icu4j-50.1.1.jar; 
> invalid LOC header (bad signature)
> [INFO] 
> [INFO] --- gwt-maven-plugin:1.0-rc-6:import-sources (default) @ WebApp ---
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] Copying 6 resources
> [INFO] 
> [INFO] --- maven-resources-plugin:2.6:testResources 
> (default-testResources) @ WebApp ---
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] skip non existing resourceDirectory 
> C:\temp\mvnSampleGwtApp\WebApp\src\test\resources
> [INFO] 
> [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ 
> WebApp ---
> [INFO] Changes detected - recompiling the module!
> [INFO] Compiling 2 source files to 
> C:\temp\mvnSampleGwtApp\WebApp\target\test-classes
> [WARNING] error reading 
> C:\Users\vitru\.m2\repository\ant\ant\1.6.5\ant-1.6.5.jar; invalid LOC 
> header (bad signature)
> [WARNING] error reading 
> C:\Users\vitru\.m2\repository\com\ibm\icu\icu4j\50.1.1\icu4j-50.1.1.jar; 
> invalid LOC header (bad signature)
> [INFO] 
> [INFO] --- gwt-maven-plugin:1.0-rc-6:import-test-sources (default) @ 
> WebApp ---
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] Copying 3 resources
> [INFO] 
> [INFO] --- maven-surefire-plugin:2.17:test (default-test) @ WebApp ---
> [INFO] Tests are skipped.
> [INFO] 
> [INFO] --- gwt-maven-plugin:1.0-rc-6:test (default) @ WebApp ---
> [INFO] GWT tests report directory: 
> C:\temp\mvnSampleGwtApp\WebApp\target\surefire-reports
>
> ---
>  T E S T S
> ---
> Running com.example.webapp.WebAppSuite
> Starting Jetty on port 0
>[WARN] ServletContainerInitializers: detected. Class hierarchy: empty
> Loading inherited module 'com.example.webapp.WebAppJUnit'
>Loading inherited module 'com.example.webapp.WebApp'
>   Loading inherited module 'com.google.gwt.user.User'
>  Loading inherited module 'com.google.gwt.event.Event'
> Loading inherited module 'com.google.gwt.dom.DOM'
>Loading inherited module 'com.google.gwt.safehtml.SafeHtml'
>   Loading inherited module 'com.google.gwt.http.HTTP'
>  Loading inherited module 'com.google.gwt.user.Timer'
> [ERROR] Line 19: Unexpected exception while 
> processing element 'source'
> java.lang.NoClassDefFoundError: org/apache/tools/ant/types/ZipScanner
> at 
> com.google.gwt.dev.resource.impl.DefaultFilters.getScanner(DefaultFilters.java:240)
> at 
> com.google.gwt.dev.resource.impl.DefaultFilters$4.(DefaultFilters.java:371)
> at 
> com.google.gwt.dev.resource.impl.DefaultFilters.getCustomFilter(DefaultFilters.java:370)
> at 
> com.google.gwt.dev.resource.impl.DefaultFilters.customJavaFilter(DefaultFilters.java:301)
> at 
> com.google.gwt.dev.cfg.ModuleDef.addSourcePackageImpl(ModuleDef.java:257)
> at com.google.gwt.dev.cfg.ModuleDef.addSourcePackage(ModuleDef.java:246)
> at 
> com.google.gwt.dev.cfg.ModuleDefSchema$BodySchema.addSourcePackage(ModuleDefSchema.java:860)
> at 
> com.google.gwt.dev.cfg.ModuleDefSchema$BodySchema.addSourcePackage(ModuleDefSchema.java:817)
> at 
> com.google.gwt.dev.cfg.ModuleDefSchema$BodySchema.__source_end(ModuleDefSchema.java:717)
> at sun.

Re: Can't build maven sample GWT app, generated by webAppCreator

2016-11-16 Thread vitrums
.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at 
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at 
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

testFieldVerifier(com.example.foo.client.FooTest)  Time elapsed: 0 sec  <<< 
ERROR!
com.google.gwt.core.ext.UnableToCompleteException: (see previous log 
entries)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1298)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1281)
at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:670)
at com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:421)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:247)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at 
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at 
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at 
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at 
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at 
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)


Results :

Tests in error: 
  FooTest>GWTTestCase.run:247->GWTTestCase.runTest:421 » UnableToComplete 
(see p...
  FooTest>GWTTestCase.run:247->GWTTestCase.runTest:421 » UnableToComplete 
(see p...

Tests run: 2, Failures: 0, Errors: 2, Skipped: 0

[INFO] 

[INFO] BUILD FAILURE
[INFO] 

[INFO] Total time: 3.638 s
[INFO] Finished at: 2016-11-16T20:37:31+03:00
[INFO] Final Memory: 15M/225M
[INFO] 

[ERROR] Failed to execute goal 
net.ltgt.gwt.maven:gwt-maven-plugin:1.0-rc-6:test (default) on project Foo: 
There are test failures.
[ERROR] 
[ERROR] Please refer to c:\temp\mvnSampleGwtApp\foo\target\surefire-reports 
for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, 
please read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException


On Wednesday, November 16, 2016 at 7:13:35 PM UTC+3, Thomas Broyer wrote:
>
>
>
> On Wednesday, November 16, 2016 at 4:10:04 PM UTC+1, vitrums wrote:
>>
>> [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ WebApp 
>> ---
>> [INFO] Changes detected - recompiling the module!
>> [INFO] Compiling 5 source files to 
>> C:\temp\mvnSampleGwtApp\WebApp\target\WebApp-1.0-SNAPSHOT\WEB-INF\classes
>> [WARNING] error reading 
>> C:\Users\vitru\.m2\repository\ant\ant\1.6.5\ant-1.6.5.jar; invalid LOC 
>> header (bad signature)
>> [WARNING] error reading 
>> C:\Users\vitru\.m2\repository\com\ibm\icu\icu4j\50.1.1\icu4j-50.1.1.jar; 
>> invalid LOC header (bad signature)
>>
>
> Looks like you have corrupted JARs. Try re-downloading them (delete them 
> and re-run Maven) 
>

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


Can't build maven sample GWT app, generated by webAppCreator

2016-11-16 Thread vitrums
[INFO] Scanning for projects...
[INFO] 

[INFO] 

[INFO] Building com.example.webapp.WebApp 1.0-SNAPSHOT
[INFO] 

[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
WebApp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
C:\temp\mvnSampleGwtApp\WebApp\src\main\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ WebApp ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 5 source files to 
C:\temp\mvnSampleGwtApp\WebApp\target\WebApp-1.0-SNAPSHOT\WEB-INF\classes
[WARNING] error reading 
C:\Users\vitru\.m2\repository\ant\ant\1.6.5\ant-1.6.5.jar; invalid LOC 
header (bad signature)
[WARNING] error reading 
C:\Users\vitru\.m2\repository\com\ibm\icu\icu4j\50.1.1\icu4j-50.1.1.jar; 
invalid LOC header (bad signature)
[INFO] 
[INFO] --- gwt-maven-plugin:1.0-rc-6:import-sources (default) @ WebApp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) 
@ WebApp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
C:\temp\mvnSampleGwtApp\WebApp\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ 
WebApp ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to 
C:\temp\mvnSampleGwtApp\WebApp\target\test-classes
[WARNING] error reading 
C:\Users\vitru\.m2\repository\ant\ant\1.6.5\ant-1.6.5.jar; invalid LOC 
header (bad signature)
[WARNING] error reading 
C:\Users\vitru\.m2\repository\com\ibm\icu\icu4j\50.1.1\icu4j-50.1.1.jar; 
invalid LOC header (bad signature)
[INFO] 
[INFO] --- gwt-maven-plugin:1.0-rc-6:import-test-sources (default) @ WebApp 
---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ WebApp ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- gwt-maven-plugin:1.0-rc-6:test (default) @ WebApp ---
[INFO] GWT tests report directory: 
C:\temp\mvnSampleGwtApp\WebApp\target\surefire-reports

---
 T E S T S
---
Running com.example.webapp.WebAppSuite
Starting Jetty on port 0
   [WARN] ServletContainerInitializers: detected. Class hierarchy: empty
Loading inherited module 'com.example.webapp.WebAppJUnit'
   Loading inherited module 'com.example.webapp.WebApp'
  Loading inherited module 'com.google.gwt.user.User'
 Loading inherited module 'com.google.gwt.event.Event'
Loading inherited module 'com.google.gwt.dom.DOM'
   Loading inherited module 'com.google.gwt.safehtml.SafeHtml'
  Loading inherited module 'com.google.gwt.http.HTTP'
 Loading inherited module 'com.google.gwt.user.Timer'
[ERROR] Line 19: Unexpected exception while 
processing element 'source'
java.lang.NoClassDefFoundError: org/apache/tools/ant/types/ZipScanner
at 
com.google.gwt.dev.resource.impl.DefaultFilters.getScanner(DefaultFilters.java:240)
at 
com.google.gwt.dev.resource.impl.DefaultFilters$4.(DefaultFilters.java:371)
at 
com.google.gwt.dev.resource.impl.DefaultFilters.getCustomFilter(DefaultFilters.java:370)
at 
com.google.gwt.dev.resource.impl.DefaultFilters.customJavaFilter(DefaultFilters.java:301)
at com.google.gwt.dev.cfg.ModuleDef.addSourcePackageImpl(ModuleDef.java:257)
at com.google.gwt.dev.cfg.ModuleDef.addSourcePackage(ModuleDef.java:246)
at 
com.google.gwt.dev.cfg.ModuleDefSchema$BodySchema.addSourcePackage(ModuleDefSchema.java:860)
at 
com.google.gwt.dev.cfg.ModuleDefSchema$BodySchema.addSourcePackage(ModuleDefSchema.java:817)
at 
com.google.gwt.dev.cfg.ModuleDefSchema$BodySchema.__source_end(ModuleDefSchema.java:717)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
com.google.gwt.dev.util.xml.HandlerMethod.invokeEnd(HandlerMethod.java:272)
at 
com.google.gwt.dev.util.xml.ReflectiveParser$Impl.endElement(ReflectiveParser.java:174)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown 
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
 
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)
at 

Re: Problem with GWT 2.8

2016-11-16 Thread vitrums
Math.abs(Double.NaN) < 0.0001 = false
!(Math.abs(Double.NaN) < 0.0001) = true
tested with jdk1.8.0_111, IDE Eclipse neon, gwt2.8.0, superdev mode, 
browser Chrome

On Wednesday, November 16, 2016 at 10:13:26 AM UTC+3, Kevin Langille wrote:
>
> Hi everyone,
>
> I have discovered a strange behavior in GWT 2.8. We were experiencing a 
> bug in our code and I have boiled it down to one line in the client side 
> code.
>
> The following line returns false which is expected.
>
> Math.abs(Double.NaN) < 0.0001
>
> But applying not operator to the same line also returns false.
>
> !(Math.abs(Double.NaN) < 0.0001)
>
> We are able to avoid this situation with additional checks but its seems 
> like a bug to me. Is anyone else able to confirm this issue? This was 
> working as expected in 2.7.
>
> Thanks,
> Kevin
>

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


Re: LayoutPanel question

2016-11-08 Thread vitrums
I stumbled upon this very interesting old topic today, when I tried to 
manipulate the *display* property of the container's element. I'm gonna 
demonstrate here, that this issue has few hard to deal with pitfalls.

So, the first stumbling block I ran into, was a vain attempt to change the 
*display* property. This call 
myLayoutPanel.getWidgetContainerElement(myWidget).getStyle().setDisplay(
Display.NONE);
in fact doesn't do anything. I started to dig inside the code and found 
these lines within  *com.google.gwt.layout.client.LayoutImpl::layout(Layer 
layer)*:

if (layer.visible) {
  style.clearDisplay();
} else {
  style.setDisplay(Display.NONE);
}

Obviously field *visible* is set to *true* for all children's layers of 
*LayoutPanel*. Now, the public inner class 
*com.google.gwt.layout.client.Layout$Layer* has in fact a setter for flag 
*visible*:

/**
 * Sets the layer's visibility.
 * 
 * @param visible
 */
public void setVisible(boolean visible) {
  this.visible = visible;
}

The problem is though, that *LayoutPanel* doesn't give you a layer for its 
widgets, since the accessor method is private:

private Layout.Layer getLayer(Widget child) {
  assert child.getParent() == this : "The requested widget is not a child 
of this panel";
  return (Layout.Layer) child.getLayoutData();
}

However, any *Widget* object has a public accessor for its own layout as:

/**
 * Gets the panel-defined layout data associated with this widget.
 *
 * @return the widget's layout data
 * @see #setLayoutData
 */
public Object getLayoutData() {
  return layoutData;
}

Now, whenever I want to change the display property of any widget within a 
*LayoutPanel* I can simply write:

Layout.Layer layer = (Layout.Layer) myWidgetInsideLayoutPanel.getLayoutData
();
layer.setVisible(false);

and it actually works fine.

The question is though, how safe are these calls? We get an *Object* and do 
an unsafe cast, assuming that it is in fact *Layout.Layer*. However my 
concern is, that I assume the lib gwt code to have such straight casts 
simply due to the fact, that it is an implementation detail, which is of 
cause a subject of potential future changes.

We might assume that as a workaround one can change the *visibility* 
property of the container's widget instead. But again, there's no 
guarantee, that this parameter won't be added to *Layout$Layer* and managed 
by *LayoutImpl* just like the *display* property. All in all, I feel that 
my hands are tied.

On Thursday, June 10, 2010 at 3:54:21 PM UTC+3, Stefan Bachert wrote:
>
> Hi Chris, 
>
> it is not really clear to me. 
> Did you switched of the added child, or the layer (div) containing the 
> added child. 
> The first is not suffient and will leave the layer (div). 
>
> I think, the correct method to get the layer div of any child widgets 
> is 
> getWidgetContainerElement. 
>
> Call this and set the visibiltity 
>
> Stefan Bachert 
> http://gwtworld.de 
>
>
> On Jun 9, 11:28 pm, Chris  wrote: 
> > Hi there 
> > 
> > I'm trying to hide a layer in my LayoutPanel. The idea is to have a 
> > layer act a bit like a popup, but it's not really a popup, and it 
> > makes it easier if it is a layer. 
> > 
> > I'm trying to hide it, so I toggle the layer child (a simplePanel)'s 
> > visibility property on/off, which seems to work fine, but it leaves a 
> > div element (from the layer I suppose), which means I can't click 
> > through to the elements behind it... When I look at the DOM, I get a 
> >  with all the properties from my layer, and then the  inside 
> > that is the SimplePanel I'm using. 
> > 
> > Any ideas? I guess i could just ask for the widget's parent? But that 
> > seems hacky. Am I doing something wrong? 
> > 
> > Chris

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


Re: GWT Logger: your best practices, tips and reasonings.

2016-11-08 Thread vitrums

>
>
> The common practice (with almost any Java logging framework) is to have 
> your loggers as static final fields and using the class name as the logger 
> name (some logging frameworks even have static factory methods taking a 
> java.lang.Class as "name").
>  
> Re. the common practice above, you won't generally inject loggers.
> Guice (but not GIN AFAIK) has custom support for java.util.logging.Logger 
> and will inject them without the need for any configuration: 
> https://github.com/google/guice/wiki/BuiltInBindings#loggers Note that 
> this is only to remove some boilerplate, and Guice would inject a logger 
> whose name is the name of the class it's injected in (see 1 above re. the 
> common practice for naming loggers)
>

I also think that the fact entering/exiting methods absent, pushes towards 
having a class name as the logger name's suffix. In conjunction with static 
factories, I can see how easy it is to build a hierarchy. As for GIN 3.0, 
it doesn't provide a default binding for *Logger.class*.

I have another question about the Level of messages. If I use Logger during 
debug, which level is the most appropriate for messages, that usually go in 
stdout?

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


GWT Logger: your best practices, tips and reasonings.

2016-11-07 Thread vitrums
Recently I found, that some log4j-like functionality in my client's code 
could be handy. So with the GWT logging module I can pretty much have a 
shared logging code, which is very convenient to use on both sides. The 
tutorial is here http://www.gwtproject.org/doc/latest/DevGuideLogging.html 
. However, I instantly ran into multiple questions:

1) How many loggers *(Logger.getLogger("logger-name")) *should I typically 
get away with in an average size project? What will their hierarcy and 
naming convention *("" -> "Parent-name" -> "Parent-name.Child-name") *be? And 
therefore which one should be the most common across the code for debugging 
and user's feedback during troubleshooting *(is it some 
"parent.child.grandson...Adam"?)* // *see 2)*

2) I'm developing my projects with GIN, and since a call like 
*Logger.getLogger("logger-name")* has a string constant *"logger-name"*, 
then any logger should definitely become a subject of injection (in my 
opinion). Hence, I created providers - one per *"logger-name"* - and bound 
*Logger.class* to them with an annotation, just like this:
bind(Logger.class).annotatedWith(DefaultLogger.class).toProvider(
DefaultLoggerProvider.class).in(Singleton.class);
Clients of this logger are all sorts of views, presenters and UI 
components. They usually obtain an instance by field or constructor 
injection:
@Inject @DefaultLogger private java.util.logging.Logger logger;
I would like to know the *pros and cons* of this solution from your point 
of view. Again, any best practices are very much welcome.

3) Consider e.g. an app designed within *Activities* framework. It's 
not uncommon to have some supporting logging in activities in order to 
assure the correctness of your MVP under development. Therefore methods 
such as
com.google.gwt.activity.shared.Activity::start(AcceptsOneWidget panel, 
EventBus eventBus);
might have logging lines for *entering* and *exiting*. However 
Logger::entering(String sourceClass, String sourceMethod)
and its counterpart *exiting* methods aren't supported in client. Moreover, 
a more generic method for this purpse
logp(Level level, String sourceClass, String sourceMethod, String msg)
is undefined for the type *Logger* too. Any *pretty* solution?

There might be more interesting issues concerning *java.util.logging.Logger* 
you ran into during the development of your projects. So, please feel free 
to mention them in this discussion as well, as the practices you found 
handy correspondingly.

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


Re: GWT Desktop-Notification

2016-11-07 Thread vitrums
On my taste package-by-feature strategy is more concise and generally more 
on point, than package-by-layer. In your case I would gather all event 
classes under *client.event* and have an inner static class named *Handler *for 
each corresponding *NotificationSomethingEvent *(just like the modern 
events in gwt). Therefore clients would call something like *addHandler(new 
NotificationClickEvent.Handler(){...}, NotificationClickEvent.getType());*

On Friday, February 7, 2014 at 11:26:29 AM UTC+3, Marcel K wrote:
>
> Hey,
>
> after some coding with gwt i want to publish a component that i wrote. 
> It's an api for desktop-notification and should work with Chrome, FF and 
> Safari (according to 
> https://developer.mozilla.org/en-US/docs/Web/API/notification#Browser_compatibility
> ).
>
> I would really appreciate if someone could take a look at it and maybe 
> give me some advices ;) or.. maybe even use :)
>
> https://github.com/MarZl/notification.notification-api
>
>
> Cheers
> Marcel
>

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


Re: HowTo use GWT EvenBus to schedule OpenEvent -> CloseEvent sequence

2016-10-26 Thread vitrums
Thank you for quick responses. It seems that we all resorted to Scheduler 
and control our custom events by tweaking the intrinsic logic 
of browser's event loop. I thought I could completely miss some obvious 
solution.

On Wednesday, October 26, 2016 at 7:51:19 PM UTC+3, vitrums wrote:
>
> [ Original post on StackOverflow 
> http://stackoverflow.com/questions/40130383/howto-use-gwt-evenbus-to-schedule-openevent-closeevent-sequence
>  
> ]
>
> Say we have few handlers for both events. The goal is to make sure, that 
> all *OpenEvent handlers*finish before any of *CloseEvent handlers* start 
> their job. The old *EventBus* had a reverse order flag, which sometimes 
> helped greatly in these particular cases. I.e. a handler, responsible for 
> launching some process which leads to *CloseEvent* being fired (i.e. 
> event emitter), usually registers itself to a bus first.
>
> Now, due to a synchronous nature of javascript each handler of *OpenEvent* 
> ends 
> his job before the next handler starts. In my app the first *OpenHandler* 
> added 
> to a bus is a *CloseEvent* emitter. Therefore I get an undesirable 
> sequence of calls: *1st handler of OpenEvent* -> *all CloseEvent handlers*
>  -> *the rest of OpenEvent handlers*.
>
> *My question is:* what's the best practice to establish the desirable 
> behavior? So far as a workaround I use 
> *Scheduler.scheduleDeferred(Scheduler.ScheduledCommand 
> cmd)* to enqueue*EventBus.fireEventFromSource(Event event, Object source)*
>  of *CloseEvent* call to the next browser's event loop tick.
>
> p.s. My current thoughts are as follows. I don't want to rely of *Timer*
>  or *Scheduler* (though it might be the only option, which I'm not sure 
> about). Also I have no interest in introducing any flag variables, 
> responsible for tracking which event occurred first. Instead, if one looks 
> closer into the*SimpleEventBus* code, there's a *firingDepth* counter 
> variable, which only works to delay*addHandler(...)* and 
> *removeHandler(...)* calls. It would be great, if same logic could be 
> applied to order call sequences of handlers for different events.
>

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


Re: How to bind essential singletons in multi-module GIN app and avoid duplicate binding

2016-10-26 Thread vitrums
Yes indeed, I don't provide an entry point for my lib-like module. However, 
there're handfull of other singletons one might have a necessity to have an 
access to (EventBus was just an example). E.g. 
com.google.gwt.core.client.Scheduler. Prior to GIN we had a sole option to 
obtain an instance by calling Scheduler.get(). Now I try to avoid mixing 
*GWT.create(), 
other static factories* and *@Inject *within client's code and therefore 
*prefer 
injection *anywhere possible. But here comes the same problem. Suppose, I 
*injected* the scheduler in some class within my lib-like module and 
intentionally left no binding within my lib config module. Now the client 
of my lib-like module either starts to get *"no binding found"* exceptions, 
or even worse - silently execute with new scheduler instances injected 
every time (if e.g. there was a default constructor for Scheduler).

On Wednesday, October 26, 2016 at 9:28:34 PM UTC+3, Jens wrote:
>
> Sounds like your visual components act as libraries, thus not having their 
> own GWT entry point.
>
> IMHO your visual components should not provide bindings for classes they 
> do not own. That means app wide singletons like an EventBus must be 
> provided by the app that includes the visual component.
>
> -- J.
>

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


HowTo use GWT EvenBus to schedule OpenEvent -> CloseEvent sequence

2016-10-26 Thread vitrums
[ Original post on 
StackOverflow 
http://stackoverflow.com/questions/40130383/howto-use-gwt-evenbus-to-schedule-openevent-closeevent-sequence
 
]

Say we have few handlers for both events. The goal is to make sure, that 
all *OpenEvent handlers*finish before any of *CloseEvent handlers* start 
their job. The old *EventBus* had a reverse order flag, which sometimes 
helped greatly in these particular cases. I.e. a handler, responsible for 
launching some process which leads to *CloseEvent* being fired (i.e. event 
emitter), usually registers itself to a bus first.

Now, due to a synchronous nature of javascript each handler of *OpenEvent* ends 
his job before the next handler starts. In my app the first *OpenHandler* added 
to a bus is a *CloseEvent* emitter. Therefore I get an undesirable sequence 
of calls: *1st handler of OpenEvent* -> *all CloseEvent handlers* -> *the 
rest of OpenEvent handlers*.

*My question is:* what's the best practice to establish the desirable 
behavior? So far as a workaround I use 
*Scheduler.scheduleDeferred(Scheduler.ScheduledCommand 
cmd)* to enqueue*EventBus.fireEventFromSource(Event event, Object source)*
 of *CloseEvent* call to the next browser's event loop tick.

p.s. My current thoughts are as follows. I don't want to rely of *Timer* or 
*Scheduler* (though it might be the only option, which I'm not sure about). 
Also I have no interest in introducing any flag variables, responsible for 
tracking which event occurred first. Instead, if one looks closer into the
*SimpleEventBus* code, there's a *firingDepth* counter variable, which only 
works to delay*addHandler(...)* and *removeHandler(...)* calls. It would be 
great, if same logic could be applied to order call sequences of handlers 
for different events.

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


How to bind essential singletons in multi-module GIN app and avoid duplicate binding

2016-10-26 Thread vitrums
[ Original post on 
StackOverflow 
http://stackoverflow.com/questions/40132219/how-to-bind-essential-singletons-in-multi-module-gin-app-and-avoid-duplicate-bin
 
]

It's a simple selfdescriptive question (subj).

Anyway, just to give an example. We have a main app module and some visual 
components module (some reusable module for many apps), both constructed 
with GIN. Needless to say, that such instances as *EventBus*, *Scheduler* etc. 
are usually bound as singletons and they get injected here and there. So, 
if we consider the aforementioned visual components module as a somewhat 
independent instance, which requires minimum work on a part of a client to 
get it inherited, then it should contain its own GIN configuration module, 
where it binds those singletons - same the main app configuration module 
usually has. And the compiler obviously won't let duplicates to coexist.

What's the best practice to avoid such a duplication conflict.

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


Re: Pb with activity and events (using gin)

2014-09-20 Thread vitrums
Truth be told, the knowledge about ResettableEventBus is exactly, what I 
asked for! So far it seems legit to utilize the singleton EventBus in order 
to broadcast events, while placing handlers' management upon 
ResettableEventBus.

Excuse me if my post about scheduler.scheduleDeferred() wasn't clear. What 
I meant was, that scheduler.scheduleDeferred() is in contrary NOT 
sufficient for some reason. Seems like scheduler.scheduleDeferred() defers 
task of event firing in my particular case for a shorter period than 
scheduler.scheduleFinally(). Even though the documentation may describe 
some different behavior.

On Saturday, September 20, 2014 3:13:12 AM UTC+4, Jens wrote:

 1) In the comment to your code, it's said that a Scheduler must be also 
 managed by GIN. Therefore, the question if it is a bad practice to use 
 Scheduler.get(), while the rest of the project is managed by GIN? How 
 about RootPanel.get() (or RootLayoutPanel.get()) factory calls? Seems 
 like one must replace all no-parameter calls of that kind with injections. 
 Correct me if I'm wrong.


 Depends on your testing strategy. GWTs Scheduler uses GWT.create and JSNI 
 so if you use it inside a presenter/activity you must test it with 
 GWTTestCase (slow) or use a library like gwtmockito which does some heavy 
 magic to disable GWT.create() calls. If you inject your Scheduler you can 
 use JUnit directly as you can just pass in a fake Scheduler implementation.

 So it is not a must, but IMHO a good idea to do so.

  

 2) Back to the main subject about EventBus. Actually I tried 
 scheduler.scheduleDeferred()before I started looking for solutions. 
 Seems like only scheduler.scheduleFinally() defers the event firing long 
 enough to give other activities time to append their handlers withing 
 start() method. At least in my particular case I encountered the 
 racing condition between activities for header, content and other 
 sections of my layout. Therefore, while there's no parallel computation in 
 browser, GWT approach with deferred tasks adds some unexplainable magic to 
 the process of debugging. I'm not even sure if I ever gonna prefer 
 scheduleDeferred() 
 to scheduleFinally() from now on.


 Actually it is the other way around: scheduleDeferred() delays the code 
 longer than scheduleFinally(). scheduleFinally() is executed right after 
 your normal code but before the browser gets control again, while a 
 deferred command is executed via a JS timeout so the browser had control 
 for some time before the command executes.

  

 3) I still need to fire events manually sometimes. Therefore I do inject 
 EventBus instance to some of the activities. Despite the fact start() 
 method uses different instance of EventBus, the code still works fine 
 like if it's all one single instance. This discovery confuses me a lot, 
 because buses are clearly different. How is it it even possible? And what 
 might be the best practice of using EventBus with ActivitiesPlaces + 
 GIN?


 Normally in GIN your EventBus is a singleton and you use it to initialize 
 the activity/places framework. In your Activity.start() method you get a 
 special ResettableEventBus which wraps the singleton EventBus you passed 
 into the activity framework. This ResettableEventBus clears all handlers an 
 activity has added automatically once the activity is stopped. 
 Thats why you should prefer storing the EventBus provided by the start 
 method in a field instead of injecting an EventBus again. I have often seen 
 code where people have injected an EventBus and then forgot to cleanup the 
 handlers which results in a memory leak as the singleton EventBus lives to 
 the entire app lifetime.


 -- J.



-- 
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+unsubscr...@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.


Re: Pb with activity and events (using gin)

2014-09-19 Thread vitrums
Thank you so much, Thomas. Your solution is very helpful. Though I still 
have three more questions:

1) In the comment to your code, it's said that a Scheduler must be also 
managed by GIN. Therefore, the question if it is a bad practice to use 
Scheduler.get(), while the rest of the project is managed by GIN? How about 
RootPanel.get() (or RootLayoutPanel.get()) factory calls? Seems like one 
must replace all no-parameter calls of that kind with injections. Correct 
me if I'm wrong.

2) Back to the main subject about EventBus. Actually I tried 
scheduler.scheduleDeferred()before I started looking for solutions. Seems 
like only scheduler.scheduleFinally() defers the event firing long enough 
to give other activities time to append their handlers withing start() 
method. At least in my particular case I encountered the racing condition 
between activities for header, content and other sections of my layout. 
Therefore, while there's no parallel computation in browser, GWT approach 
with deferred tasks adds some unexplainable magic to the process of 
debugging. I'm not even sure if I ever gonna prefer scheduleDeferred() to 
scheduleFinally() from now on.

3) I still need to fire events manually sometimes. Therefore I do inject 
EventBus instance to some of the activities. Despite the fact start() 
method uses different instance of EventBus, the code still works fine like 
if it's all one single instance. This discovery confuses me a lot, because 
buses are clearly different. How is it it even possible? And what might be 
the best practice of using EventBus with ActivitiesPlaces + GIN?

On Tuesday, June 4, 2013 3:06:28 PM UTC+4, Thomas Broyer wrote:



 On Tuesday, June 4, 2013 12:46:16 PM UTC+2, Tugdual Huertas wrote:

 Hi all,

 i'm facing a litlle problem using places activities and events... Have 
 tried multiple tricks but not luck .

 My problem:
 i try to fire an event from the activity but my widget does not catch it 
 since its not loaded (I mean that if i fire this event once the widget's 
 loaded everything works fine).

 Here is my Gin configuration:

 @Override
 protected void configure()
 {
bind(EventBus.class).to(SimpleEventBus.class).asEagerSingleton();
   
  
 bind(PlaceHistoryMapper.class).to(MyPlaceHistoryMapper.class).in(Singleton.class);
   
  bind(ActivityMapper.class).to(MyActivityMapper.class).in(Singleton.class);
bind(MyActivity.class);
install(new 
 GinFactoryModuleBuilder().build(MyActivityMapper.Factory.class));
 }

 @Provides
 @Singleton
 public PlaceController getPlaceController(EventBus eventBus)
 {
return new PlaceController(eventBus);
 }

 @Singleton
 @Provides
 public ActivityManager provideActivityManager(ActivityMapper 
 activityMapper, EventBus eventBus)
 {
return new ActivityManager(activityMapper, eventBus);
 }

 in MyActivity:
 @Inject
 private MyWidget myWidget;
 @Inject
 private EventBus globalEventBus;

 @Override
 public void start(AcceptsOneWidget panel, EventBus eventBus)
 {
panel.setWidget(myWidget);
MyEvent event = new MyEvent();
event.setAction(MyEvent.Action.INIT);
globalEventBus.fireEvent(event);
 }

 I also try two different ways of binding events in my widget, during 
 onLoad and in constructor:

 During onLoad:

 @Inject EventBus eventBus;

 @Override
 protected void onLoad()
 {
handlersRegistration.add(eventBus.addHandler(MyEvent.TYPE, this));
 }


 In constructor:

 private EventBus eventBus;

 @Inject
 public MyWidget(EventBus eventBus)
 {
this.eventBus = eventBus;
// registration of handlers
handlersRegistration = new ArrayListHandlerRegistration();
// register myself has a listener of different event TYPE
handlersRegistration.add(eventBus.addHandler(MyEvent.TYPE, this));

...
 }


 Am I doing something w rong or missing something?


 All adds and removes of event handlers during the dispatching of an event 
 (which is the case when the activity starts: it's in response to a 
 PlaceChangeEvent) is deferred to after the event has been dispatched all 
 handlers.
 Events however are dispatched synchronously (so that handlers can possibly 
 modify them and the sender take action depending on the event after the 
 dispatching; see setWarning for PlaceChangeRequestEvent).
 So you have to defer your fireEvent() call using the Scheduler:

 // Assuming a Scheduler has been @Inject-ed
 scheduler.scheduleFinally(new ScheduledCommand() {
   @Override
   public void execute() {
 MyEvent event = new MyEvent();
 event.setAction(MyEvent.Action.INIT);
 globalEventBus.fireEvent(event);
   }
 });

 It's a good rule to always assume you might be called as part of event 
 dispatching unless you're handling UI events (click on a button, etc.) and 
 thus always defer your event dispatching in this case.


-- 
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 

Re: Unable to intregrate gwt-ext with gwt 2.5

2013-01-06 Thread vitrums
Isn't it an issue of gwt-ext and it is better to ask their support if it 
should work with gwt 2.5?
Though I believe a little bit more detailed problem description is required 
in order to get a reasonable help.

On Sunday, January 6, 2013 8:10:08 AM UTC+4, tagoor wrote:

 Unable to intregrate  gwt-ext with gwt 2.5 

 can u please help it out 


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/yFGVEBsjQGgJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Absolute positioning relative to other widgets

2012-12-07 Thread Vitrums
I'm not exactly aware of the reason why do I repeatedly return to this 
topic. But it seem like there have been existing an issue of what is 
described here all the time for me. And I've already encountered it 
countless times on my way with implementing tooltips, popups, sliding 
menus, suggest boxes and so on.  Perhaps, it's all about the sense, that 
there must exist some sort of solution for all this stuff, that would be 
both pretty, and effective. As an example of such magic, I can give you the 
Element#scrollIntoView() method, which can scroll the area right to the 
specified element, and do whatever it's possible to ensure that the latter 
will become visible to user. If browser can do that, why wouldn't it help 
us to adjust the positioning of our absolutely positioned widgets?

So there's only one suitable solution, that I could come up with:
- supply your absolutely positioned widgets with some sort of recalculator 
instead of statically allocating it upon the construction. This 
recalculator would have methods like:

public double getLeft(); // returns absolute left, that is relative to some 
widget
public double getTop();
...etc.

Once an event, that might somehow break your layout occurred (say, window 
got resized, or the whole layout switched in some sort of sliding 
animation), make sure the objects, which were responsible for creation of 
those absolutely positioned widgets, or the widgets themselves, are 
listeners of such sort of events, and that they call recalculator's methods 
to handle the event properly. The best way not to make it too ugly is to 
have an access to one global EventBus and fire/catch those events in means 
of the latter.

Ugly? Well, in absence of other solution it's worth to try. At least this 
one works for me.

On Sunday, May 3, 2009 11:00:53 AM UTC+5, Adam T wrote:

 Hi Stephen, I feel this is just one of those challenging areas in 
 GWT.  There's no event in GWT that tells you DOM has finished layout 
 activities, but there is a point where you expect this to be the case 
 in the normal lifecycle of a widget. 

 In the Widget lifecycle there are four key points you can override 
 that in a way act as events: 

   * onAttach() - called when a widget is attached to the browser's 
 document. 
   * onLoad() - called immediately after a widget becomes attached to 
 the browser's document. 
   * onUnload() - called immediately before a widget will be detached 
 from the browser's document. 
   * onDetach() - called when a widget is detached from the browser's 
 document 

 The one of interest here is onLoad(), where it's fairly safe to assume 
 that everything DOM attribute wise is sorted out by then.  I've still 
 found it wise to give the browser some time by wrapping any dimension 
 stuff in a DeferredCommand within the onLoad() method; I'm not 100% 
 convinced it is necessary, but I like to live on the safe side in an 
 effect library I'm building (http://code.google.com/p/gwt-fx/). 

 I have to admit, I'm not aware of a onResize() method to override in 
 Widget or Composite class, so can't really comment on how that would 
 work (out of interest, where is it in standard GWT?). 

 DeferredCommand itself is a little bit of a trick, although it says 
 allows you to execute code after all currently pending event handlers 
 have completed it's really based on timers rather than hooking into 
 the browser event queue and checking all is done before firing your 
 command - that said, it works. 

 Hope that gives you a bit more info. 

 //Adam 

 On 3 Maj, 02:00, Stephen Cagle same...@gmail.com wrote: 
  First of all, Thank You Adam. This is one of those things that I spent 
  like 4 hours on and finally just asked about. 
  
  I put my absolute positioning code inside a DefferedCommand. Have not 
  seen it fail yet. So thank you, it seems to work. 
  
  Still, I do wonder. What is the deterministically appropriate way to 
  deal with this? For all I know the DefferedCommand may be the 
  appropriate way to deal with this, as it may truly guarantee that code 
  is not run till after all other events are run. Assuming that 
  repositioning stuff as things are added to the DOM is just another 
  event, then as long as DefferedCommand always guarantees that it will 
  add to the end, then it is probably correct. 
  
  However, is there some more direct way to do this. Like, could I wrap 
  a widget in something (or override some handler) such that I can 
  guarantee execution of code only after the widget has been fully 
  positioned and their currently exist not other DOM modifying events in 
  the queue? 
  
  Also, in closing, is there more information somewhere on exactly how 
  widgets are added, positioned, and rendered. I would also be 
  interested in any callbacks (or equivalent) that I can override at any 
  point in said process. Thanks all. 
  
  On May 1, 11:14 pm, Adam T adam.t...@gmail.com wrote: 
  
   sometimes it's worth wrapping any repositioning up in 

Re: enable/disable widgets?

2012-11-24 Thread Vitrums
Found difficulties in some versions of Opera with exercising CSS properties 
like .myclass[disabled] {...}. Also I haven't found any solution how to 
sink events for disabled widgets. Seems like they are totally 
non-interactive (however :hover property still does some effect) speaking 
in terms of standard events, available for handling. Manually implemented 
enabled/disabled state has been the only suitable solution, which I'd found 
till present.

There's one good article about preview native 
eventhttp://www.ibm.com/developerworks/java/library/j-gwtfu2/index.html. 
In a nutshell you may examine what current event is about and cancel it 
before browser starts any propagation. Also I found this 
articlehttp://stackoverflow.com/questions/2061699/disable-user-interaction-in-a-gwt-container
 quite 
useful to keep up on date with modern API. Here's a very concise piece of 
code:

In some singleton filter class (e.g. NativePreviewHandlerForHasEnabled):
*
private final MapElement, HasEnabled elementToWidgetMap = new 
HashMapElement, HasEnabled();

private NativePreviewHandlerForHasEnabled() {
assert instance == null : Only one instance is allowed.;
elementToWidgetMap = new HashMapElement, HasEnabled();

Event.addNativePreviewHandler(new Event.NativePreviewHandler() {
public void onPreviewNativeEvent(NativePreviewEvent pEvent) {
final Element target = 
pEvent.getNativeEvent().getEventTarget().cast();

HasEnabled widget = elementToWidgetMap.get(target);
if (widget != null  !widget.isEnabled()) {
 
 // Let it work, cause we may need to e.g. hide tool tip 
when mouse is out
 if (pEvent.getTypeInt() != Event.ONMOUSEOUT) {
 pEvent.cancel();
 }
}
}
}); 
}

public T extends Widget  HasEnabled void registerWidget(T widget) {
elementToWidgetMap.put(widget.getElement(), widget);
}
*

For our widget:

@Override
public void setEnabled(boolean enabled) {
this.enabled = enabled;
// super.setEnabled(enabled); // don't do this!
}

It's not perfect. Map can grow up fast depending on scale of your app. To 
enhance the performance store HandlerRegistration objects 
upon Event.addNativePreviewHandler call for later disposing, when the time 
comes.

On Thursday, June 17, 2010 10:27:26 PM UTC+5, Magnus wrote:

 Hi, 

 how can I enable/disable a widget (TextBox, Button, etc.)? 

 I would like to iterate all Widgets of a form and set this status. I 
 found no appropriate methods in the Widget class... 

 Magnus

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/c29e6HJ34ecJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Poor quality code produced by uiBinder when using CSSResources

2011-12-19 Thread Vitrums
That doesn't even look so hurtful as you describe it. Needless to say, 
modern smartphones would handle such kind of scripts easily without 
noticeable delay. Consider profiling your app with the Speed Tracer to make 
this discussion more meaningful. Also consider the compiler 
flag -XdisableClassMetadata to feel the real power of class obfuscation ^^

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/fbaLj5a5xo4J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: getOffsetHeight returns 0 although onload has been called

2011-11-30 Thread Vitrums
getOffsetHeight() of an element which *display* property was set to *none*will 
always return 0

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/0X-b56QdlBQJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: How to implement admin features/sections in app

2011-11-28 Thread Vitrums
what you are about to implement is something bigger than a simplified logic 
of admin/not-admin user, but rather privileged/unprivileged. Therefore in 
many cases like using CAPTCHA (robot defense), that's a matter of your 
taste as a web-designer to call the server for serialized UI elements, or 
merely ask it for an approval to actually render missing UI, which you 
already got on client since his very first http-request (or one, that sucks 
an appropriate DOM structure for this AP particularly). It's really all 
about statically keeping a session on server side until it expires and 
mapping it to some privileges (regular user, accountant, manager, 
sysadmin). To make things easier and have your servlets as *smart* content 
providers, build your business logic over some modern MVC framework.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/4-Q41jSa0f0J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Help with ClientBundle: neighbour @sprite offsets dependencies

2011-11-27 Thread Vitrums
I've got 5 sprites in a row. How can I get left offsets for the 3rd and 4th 
elements using early binding? I'm trying to do something like calculate a 
sum of 1st and 2nd images widths, using 
value('imageResource.getWidth','px') function or anything of that kind... 
but didn't manage to find any solution to evaluate those expressions( If 
there was no workaround, would there at least be a way to implement some 
custom generator as a plug-in over proprietary GWT css processing facility?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/7X0oBvytkscJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: attach listeners/handlers to widget, then do some DOM-stuff - listeners gone?

2011-11-26 Thread Vitrums
I frequently use native .onmouseover/.onmouseout events in my animations, 
and I always try to follow some limitations, which can save me from a set 
of known unpredictable behaviours concerning this matter. First of all, 
defer all your handlers attachments as much, as you're sure, that calling a 
constructor will already have the correct getAbsoluteLeft() method call 
results at this point. Second thing is that, when you process these two 
events to enable/disable some UI effects for smoothness purposes have some 
default pauses to determine whether it's still necessary to call the 
mirrored animation, or it was just a micro-break like one, when you move a 
mouse from one element of ul list to another, while this list is attached 
to the listened DOM element. Also think about using Cell... objects as a 
possible substitutions for old-school Widget ones. 

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/hogg6m8hWHoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT CSS Style Annotation

2011-11-25 Thread Vitrums
Each modern browser has its own DOM inspector. After a couple of tense 
non-stop coding month I've made a clue, that Opera-browser's got the most 
user-friendly debug tool among others. Sad to accept the fact it's got no 
GWT development plug-in. From the other hand web-kit based browsers are a 
lot faster, and it's a big part of a deal, when you debugging your app 
intensively. That is, the chromium one suffice the needs pretty close.

Concerting run-time scope annotations like the @Condition one, it's a 
sequential sacrifice of end-user processor resources upon the page-loading 
stage, since in a commonplace GWT best practice cases, this part of 
preprocessing lies upon the deferred-binding shoulders. But still, good 
job, since it's fair to mention, that far not all projects have a profit of 
cascading or MVP.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/yxdnBmzZZjcJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT CSS Style Annotation

2011-11-24 Thread Vitrums
This approach will bind your hands in further attempts to make any 
lookfeel overhaul. For some flexibility, try to use compile time constants 
for annotation values. E.g. you've got some interface Styles, which might 
extend an interface ThemeMoonsky or interface ThemeSunshine not inclusive:

/** Theme 1 */
interface ThemeMoonsky extends BasicStyles {
String BODY_BACKGROUND_COLOR = #333;
}

/** Theme 2 */
interface ThemeSunshine extends BasicStyles {
String BODY_BACKGROUND_COLOR = #F0F;
}

/** Some very generic styles */
inteface BasicStyles {
String BODY_TEXT_COLOR = black;
String HEADER_FONT = 18px bold sans-serif blue; 
}

/**
 * You styles interface, where you get all constants from.
 * Extend ThemeSunshine to have your site restyled
 */
interface Styles extends ThemeMoonsky {
// Empty body
}

somewhere in your code:

@Background(Styles.BODY_BACKGROUND_COLOR)
protected Widget getLabel() {
return label;
}


Well, you get the idea. But it's still not amenable for runtime user 
sensitive interactions ;-\

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/1Ig643gMtgcJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: ClientBundle use case issues

2011-11-24 Thread Vitrums
Hence, found only one solution by my own means:

*I.* Have different stylesheet files logically separated.

tables.css:
 .old-fashion-table { }

 

lists.css:
 .lovely-list { }


*II.* For each stylesheet define one CssResource descendant interface with 
predefined @ImportedWithPrefix annotation.

@ImportedWithPrefix(tables)
 interface TablesStyles extends CssResource {
 @ClassName(old-fashion-table)
 String oldFashionTable();
 }

 

@ImportedWithPrefix(lists)
 interface ListsStyles extends CssResource {
 @ClassName(lovely-list)
 String lovelyList();
 }


*III.* For each MyStyles interface define a strict accessor

@Source(tables.css)
 TablesStyles tablesCss();

 

@Source(lists.css)
 ListsStyles listsCss();


*IV.* When you need to refer to some class from tables.css or from 
lists.css from inside your other.css, just import MyStyles and refer to 
classes within them using appropriate prefixes 

other.css:

 .some-wierd-widget .tables-old-fashion-table { }
 .some-wierd-widget .lists-lovely-list { }


java:

 @ImportedWithPrefix(other)
 interface OtherStyles extends CssResource {
 @ClassName(some-wierd-widget)
 String someWierdWidget();
 }


 @Source(other.css)
 @Import({TablesStyles.class, ListsStyles.class})
 OtherStyles otherCss();


*V.* Run-time. Inject all the accessors and refer to imported classes by an 
according base class accessor

MyResources.INSTANCE = GWT.create(MyResources.class);

 

MyResources.INSTANCE.tablesCss().ensureInjected();
 MyResources.INSTANCE.listsCss().ensureInjected();
 MyResources.INSTANCE.otherCss().ensureInjected();
 ...
 myLovelyWidget.addStyleName(MyResources.INSTANCE.
 otherCss().someWierdWidget());
 descendantOfMyLovelyWidget.addStyleName(MyResources.INSTANCE.tablesCss().
 oldFashionTable());
 descendantOfMyLovelyWidget.addStyleName(MyResources.INSTANCE.listsCss().
 lovelyList());


It's just my vision of how it works. Correct me if I'm misspaterning or do 
some even more crazy stuff =\

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/umNTIm0yPqwJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



ClientBundle use case issues

2011-11-23 Thread Vitrums
Let's say I've inherited clean theme

inherits name='com.google.gwt.user.theme.clean.Clean'/

 
and further I made a decision to improve a bandwidth aspect of my project, 
so I need to obtain a workaround to use solely chosen styles derived 
manually from the com/google/gwt/user/theme/clean/clean.css. In a 
simplified approach the easiest sufficient way would have been something 
like allocating the style scraps right inside my own project's stylesheets, 
i.e. to append them to com/myorg/myproject.css. But according to this 
article: Bandwidth Sensitive 
Applicationshttp://code.google.com/intl/ru/webtoolkit/doc/latest/DevGuideUiCss.html#documentation
 it's 
also common to add the following into your project configuration file 
myproject.gwt.css:

inherits name='com.google.gwt.user.theme.clean.CleanResources'/

 
for resources autogeneration purposes. Once I managed to obtain some sort 
of stable scratch prototype of myClean.css, it would be fair to assume that 
on compilation I will not have to accomplish any manual copy/past routine 
like one as allocating myClean.css under 
webapplication-directory/war/myproject/gwt/clean/ folder, since it's 
where images/ directory containing all the clean theme resources lives. But 
both ways whether to add an inherits ... directive at the project config 
file, or injecting myClean.css via the link ... tag inside my host page, 
will not save me from necessity of making those manual actions.

One very different approach is to use ClientBundle facility. I couldn't 
figure out how to inject more or less big scraps of myClean.css unless I 
declare the corresponding resources accessor as @CssRerourses.NotStrict. 
Hence my code would have looked like following:

interface MyCleanResources extends ClientBundle {
MyCleanResources INSTANCE =  GWT.create(MyCleanResources.class);
 @CssResource.ImportedWithPrefix(do-not-want-any-prefix)
interface Styles extends CssResource {
 /* Definition of some strict class */
String foo();

@ClassName(gwt-MenuItem)
String gwtMenuItem();
}
 @Source(css/myClean.css)
@CssResource.NotStrict
Styles css();
}

Suppose I've also got some rules into myClean.css:

.foo { }

 

/**
 * Copyright 2008 Google Inc.
 */
.gwt-MenuBar .gwt-MenuItem {
  cursor: default;
  font-family: Arial Unicode MS, Arial, sans-serif;
}


Here I can do a bunch of things:
1) Inject resources:

MyCleanResources.INSTANCE.css().ensureInjected();


and then write something like:

navigationBlock.addStyleName(MyCleanResources.INSTANCE.css().foo());

menuItem123.addStyleName(MyCleanResources.INSTANCE.css().gwtMenuItem()); 


but not the following:

navigationBlock.addStyleName(MyCleanResources.INSTANCE.css().gwtMenuBar());


since it's not strictly declared in Styles interface

2) Import:

java:
interface MyprojectResources extends ClientBundle {
MyprojectResources INSTANCE =  GWT.create(MyprojectResources.class);
 interface Styles extends CssResource {
 /* Definition of some strict MyprojectResources.Styles class */
@ClassName(foo)
String foo();
}
 @Source(css/myproject.css)
@Import({MyCleanResources.Styles.class})
Styles css();
}

myproject.css:

.foo .do-not-want-any-prefix-gwtMenuItem {

 font-family: Verdana;

}


and use

navigationBlock.addStyleName(MyprojectResources.INSTANCE.css().foo());


but not the following:

navigationBlock.addStyleName(MyprojectResources
.INSTANCE.css().gwtMenuItem());


Hence, there're few issues I'm not capable to deal with:
1) In a case of import how can I get gwtMenuItem class at the runtime any 
other way then hardcoding it as a string literal? I really wan't to get 
strict obfuscated classes throughout my project as much as possible.

2) If I inject myClean.css, all the resources (like background style's url) 
will be assigned to the webapplication root directory, e.g.:

localhost:/myproject/war/images instead of 
localhost:/myproject/war/myproject/gwt/clean/images

which is not what I need. How can anyone deal with this paths issue, when 
he injects an external stylesheet in a manner I've shown here.

3) I really can't get it, why would anyone want to enumerate .css files 
into @Source annotation (unless we need to decrease a number of browser 
http round-trip requests, i guess). Though isn't it more accurate to 
associate any CssResource accessor with only one appropriate single source 
every time we need to include some additional stylesheet? Therefore they'll 
be injected at the runtime by a measure of user's actions progress.

Please help me out providing some examples of ClientBundle advanced 
commonplace usage, because I think I'm greatly confused.

p.s. I don't use UIBinder facility. Please, leave this scope unmentioned in 
your replies.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/mNKFmJwrdwYJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To 

Re: GWT DIV

2011-08-24 Thread Vitrums
nope, I believe FlowPanel is. Because AbsolutePanel instance implicitly adds 
a style attribute with position: relative as one of its statements, which 
already doesn't suit the request.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/LbMhpL5Tu1QJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: TabLayoutPanel: shows border of its child widgets

2011-08-23 Thread Vitrums
You can do it either by getting a direct access to the block elements that 
comprise TabLayoutPanel and further setting them appropriate classes and 
styles, or simply by overwriting the basic class' styles like this:

/**
 *Sliding panel styles
 */
.gwt-TabLayoutPanelContentContainer {
border-width: 0px;
padding: 0px;
}

.gwt-TabLayoutPanel .gwt-TabLayoutPanelContent {
border-width: 0px;
padding: 0px;
}

You always have to check if your estimated preview of the DOM structure, 
which you normally expect to get by allocating any widget, would actually 
coincide with the real one. That is, get any of DOM explorers, like firebug 
or one which is provided by Chrome browser. Then ensure yourself if you 
found every underlying issue. You're about to discover, that TabLayoutPanel 
has much more implicit implementation than you found already, like an order 
of animation vectors, when you switch a tab, or what happens to your DOM, 
when you select a tab programmatically twice in a row. Just debug it.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/zDcU6uHB2u4J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: log in tomcat with gwt - j_security_check limitation

2011-08-15 Thread Vitrums
I found this solution very handy. At least it suits my needs quite well. But 
still there's an issue with login.jsp, which might also produce an 
authentication interface for admin tools as an example. And the point is, 
that while an ordinary user gets everything what he needs, some manager with 
sysadmin role will also get this UI for login, which is not correct. And 
it can't be avoided by standard means of tomcat due to the fact, that only 
one login.jsp instance is allowed. And the DTD of web.xml doesn't support 
mapping of url specific context with different login pages =( E.g. there 
easily could be two secure1 and secure2 sections and they've got 
different access constrictions.

Actually I spent a couple of hours to figure out if I can distinguish which 
end-point url was requested within login.jsp code. And I wasn't successful 
to obtain any mean to do that. Wounder why this option is not supported by 
tomcat. Hence one probably may want to recompile tomcat with few additions 
in security code to do one of the following:
1. Whether allow web.xml to have more than one login-config element and 
make it parsed corresponding to this feature
or 2. To send an end-point href as a request header to login.jsp servlet and 
it can be used to build several brunches.

At this point I ran out of ideas. One more thing to mention, is that we 
still need login.jsp to render some handsome interface, because one may try 
to access your secured part directly rather than to ask for Welcome page. It 
became quite handy since browsers track a history and help user to choose a 
url in a combobox below the textbox while he types a domen. That's why we 
must whether redirect user to your sweet login module inside login.jsp, or 
to use login.jsp itself as a destination login url. Last means that we 
should copy/past the body of your Welcome.html and put the directory with 
compiled GWT resources into the root.

Will be greatful, if you give me a solution to maintain url-dependent 
context of login page within one tomcat webapp.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/F9mbF6kj6B4J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



inherit project's CSS to override standard gwt styles

2011-08-13 Thread Vitrums
Well I managed to solve the problem with overriding standard style
rules by inheriting my project's .css file in .gwt.xml file of my
project. When you set your user defined .css this way, it will have
the higher priority in cascading one rule than the same rule, defined
at standard gwt stylesheets. And this is often mentioned throughout
different discussions concerning CSS aspect of GWT. But...

It took a couple of hours to actually figure out how exactly to
inherit it properly, cause at first try just simply typing stylesheet
src='WebTerminal.css' / in my .gwt.xml file and commenting out link
type=text/css rel=stylesheet href=WebTerminal.css in my .html
host page didn't bring me any result.
So, the solution was to change relative path, when you set your .css
in .gwt.xml config, like this:
stylesheet src='../WebTerminal.css' /

To figure out how it works, you may add
Window.alert(GWT.getModuleBaseURL()); at the beginning of your
onModuleLoad() method. It will display something like https://
localhost:8080/myproject/resouces/webtermial/, when in fact your
hosted page URL rather look like https://localhost:8080/myproject/
resouces/WebTerminal.html.
Here myproject/resouces is a directory, that contains your .css file,
and when you set it in .gwt.xml as stylesheet src='WebTerminal.css' /
, the compiler starts looking for myproject/resouces/webtermial/
WebTerminal.css and won't find it. That's why adding ../ sometimes is
the one simple step to carry out to solve the issue.

My question is that I was not successful in attempt to find any
description of this matter in the latest documentary or throughout the
discussions taking place at this google group. Wish it was less harder
to figure out, because GWT has much more really complex problems
itself, than one, which must have had an exhausted description inside
tutorial.

I also was very unpleased to realize that some actions with upon my
widget's styles are made implicitly, when for example I assign a
FlexTable instance to a tab of TabLayOutPanel instance. There wouldn't
have been any trouble, if the solution had been like simply changing
my style properties (like assigning a class) for the table after I
added it to the panel. But the DOM structure of an element retrieved
by compiling the panel is multi-tiered and the key DIVs (like those,
which determine the borders and alignment) are not reachable from
calling panel's interface methods. And I rather have to loop over the
descendants of its DOM element representation (getElement() method of
a widget) to work with co-javascript classes, providing a shell for
real html elements.

It might seem like I've got a newbie approach to this issue, but I'd
like to know how You handle these cases. I've got a lot of UI work to
do and unfortunately CSS is not a strong part of mine ^^

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.