Contribution: FlexTable with Model support

2013-06-25 Thread Maik Riechert
Hi guys,

Recently I stumbled upon the high-performance CellTable. In particular, I 
like its model-based approach compared to FlexTable's or Grid's 
't.setText(x,y,content)'. In my case, I don't care about performance 
(internal app) and I'd rather like to use all the Widget goodness that I'm 
used to. So, as a result, I added model support to FlexTable which then 
allows me to do the following:

ModelFlexTableModel table = new ModelFlexTableModel();

table.addColumn(new FlexColumnModel() {
@Override
public Widget createWidget(Model row) {
return new Label(row.getName());
}
}, Name);

table.addColumn(new FlexColumnModel() {
@Override
public Widget createWidget(Model row) {
return new InlineHTML(div style='background-color:
+ row.getColor() + ; width:50px;height:50px'/div);
}
}, Color);

table.addColumn(new FlexColumnModel() {
@Override
public Widget createWidget(final Model row) {
Button remove = new Button(Remove);
remove.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
table.removeRow(row);
}
});
return remove;
}
});

table.addRow(new Model(red, #ff));
table.addRow(new Model(green, #00ff00));

where the Model class is:

public class Model {
private final String name;
private final String color;

public Model(String name, String color) {
this.name = name;
this.color = color;
}

public String getName() {
return name;
}

public String getColor() {
return color;
}
}


Maybe someone finds this useful. The downside is that the nice default 
styling of CellTable is missing, and other features of it like paging etc. 
So it's not a CellTable replacement but rather a nicer-to-use FlexTable if 
you have a model anyway.

Code is at https://gist.github.com/neothemachine/5857263

Cheers
Maik

-- 
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/groups/opt_out.




Re: Dynamic CompositeCell

2013-06-24 Thread Maik Riechert
I have the same problem at the moment. I can't use a CellTree because I 
actually want this to be a column of a CellTable. And as CellTree is not a 
Cell itself, this is not possible as far as I see.

Is there any other way than going down to HTML and doing everything on my 
own?

What I want is a column where each cell contains a variable number of 
labelled Checkboxes (label through text attribute of the Checkbox widget).

Am Freitag, 27. April 2012 16:09:52 UTC+2 schrieb Alfredo Quiroga-Villamil:

 If you have an n number of values that should be represented in one 
 single column, I would go for a tree. Its ability to expand nodes when 
 needed, gives the user a chance to have it expanded or collapsed. So 
 in your case the column would contain: 

 Top Of Tree 
   CheckBox 1 
   CheckBox 2 
   CheckBox 3 
   CheckBox n 

 Regards, 

 Alfredo 

 On Wed, Apr 25, 2012 at 9:16 PM, Aoxiang Cui 
 cuiao...@google.comjavascript: 
 wrote: 
  The title is too short, let me explain and simplify my situation. 
  
  Say, I have a dto which contains a list of Booleans. I need a column 
 whose 
  cell looks like below: 
  
  item_1  checkbox_1 
  item_2  checkbox_2 
  ... 
  item_n  checkbox_n 
  
  If n is a fixed number, it is fine to use CompositeCell. The problem is 
 we 
  don't know the size of list and each cell can have different list size. 
  Is there any way to extend CompositeCell so as to make it support my 
  situation. Or maybe I should write a new Cell? 


-- 
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/groups/opt_out.




Re: Dynamic CompositeCell

2013-06-24 Thread Maik Riechert

Jens wrote:
You have to implement your own custom Cell for use in CellTable. 
Letting a cell render a dynamic list of checkboxes doesn't sound that 
hard to me.


GWT can't provide cells for every possible use case.
Well, ok, I probably will do that for the checkboxes. But in my mind 
this allows for nearly no reuse. If instead there would be something 
like a CompositeCell where the number and type of child cells depend on 
the row value, then this would be reusable in lots of cases. And 
considering that this issue pops up quite some times on the internet I 
guess it would be useful.


To be honest, I find creating custom Cells hard, because it feels low 
level and also because Cells are completely different to use compared to 
their counterpart widgets (e.g. Checkbox vs. CheckboxCell). That's why 
I'm happy if there's something existing I can just use or plug together 
(like the CompositeCell for fixed Cell number).


Do you think it would be hard to create a DynamicCompositeCell for 
variable Cells? I don't have much experience with cells yet, only with 
regular widgets, but I'd like to tackle that challenge if I get a little 
help or advice.


Cheers
Maik

--
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/groups/opt_out.




Re: JUnitShell.getModuleUrl() produces invalid URL for IPv6 addresses

2013-06-19 Thread Maik Riechert
Just for reference, the bug is filed at:
http://code.google.com/p/google-web-toolkit/issues/detail?id=8210

-- 
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/groups/opt_out.




Re: JUnitShell: Why is the log level overriden to WARN?

2013-06-18 Thread Maik Riechert

Thomas Broyer wrote:
You definitely *can* change the log level from the command line, WARN 
is just the default value.
Arguments are passed to JUnitShell through the gwt.args system 
property, the same you use to set your custom RunStyle: 
-Dgwt.args=-logLevel DEBUG -out www-test -runStyle 
com.example.PhantomJS:/path/to/phantomjs


Hmm, I already tried setting the logLevel through the maven configuration:
https://github.com/neothemachine/KineticGWT/blob/master/pom.xml#L122

Am I doing something wrong?

--
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/groups/opt_out.




JUnitShell.getModuleUrl() produces invalid URL for IPv6 addresses

2013-06-18 Thread Maik Riechert
Hi,

it seems the JUnitShell is generating invalid URLs if IPv6 is used:

http://2607:f700:8000:12d:dd58:687b:744c:800c:48579/...

You can observe this here:
https://travis-ci.org/neothemachine/KineticGWT/builds/8191369#L881

The URL should be 
http://[2607:f700:8000:12d:dd58:687b:744c:800c]:48579/...

Is this a known issue? I couldn't find anything related to that.


Cheers
Maik

-- 
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/groups/opt_out.




JUnitShell: Why is the log level overriden to WARN?

2013-06-17 Thread Maik Riechert
Hi,

when developing JUnit runstyles I want to do info/trace logging, e.g.:

shell.getTopLogger().log(TreeLogger.TRACE, Letting PhantomJS fetch  + 
url);

I have to change all those logging outputs to at least WARN to see 
anything. This is caused by the following code in JUnitShell I guess:

  // Override log level to set WARN by default..
  registerHandler(new ArgHandlerLogLevel(options) {
@Override
protected Type getDefaultLogLevel() {
  return TreeLogger.WARN;
}
  });

My question is: Why? I find it very strange that I can't set a custom log 
level via command line argument or system property. What is the reasoning 
behind this and can it be changed?

Cheers
Maik

-- 
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/groups/opt_out.




Re: [gwt-contrib] Re: Developing a new remote RunStyle for PhantomJS

2013-01-21 Thread Maik Riechert
Just created another run style for local testing via PhantomJS. It works 
surprisingly well! 
(https://github.com/neothemachine/gwt-phantomjs-junit-runstyle)

Am Dienstag, 15. Januar 2013 11:22:45 UTC+1 schrieb Thomas Broyer:



 On Tuesday, January 15, 2013 10:27:57 AM UTC+1, Maik Riechert wrote:

  I see, it's probably perfectly applicable to Travis CI (I would just 
 start the phantomjs webdriver server before executing tests) but what about:

 http://code.google.com/p/google-web-toolkit/issues/detail?id=7768


 Ah, good catch! Patches welcome! ;-)


-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Re: [gwt-contrib] Re: Developing a new remote RunStyle for PhantomJS

2013-01-15 Thread Maik Riechert
I see, it's probably perfectly applicable to Travis CI (I would just 
start the phantomjs webdriver server before executing tests) but what about:


http://code.google.com/p/google-web-toolkit/issues/detail?id=7768

Am 15.01.2013 02:29, schrieb Thomas Broyer:
Note that, while probably not applicable to Travis CI, there's 
GhostDriver (WebDriver for PhantomJS) which should allow you to use 
the Selenium RunStyle to drive PhantomJS.


On Monday, January 14, 2013 8:59:14 PM UTC+1, Maik Riechert wrote:

Hi all,

As htmlunit isn't suited for all testing scenarios (in particular
layout specific ones), I'd like to use PhantomJS as an alternative
(production mode only). It is a headless webkit engine and can be
easily controlled with JS files, meaning that the new RunStyle
would fork a shell process phantomjs pageload.js where
pageload.js would be written to disk beforehand containing:

var page = require('webpage').create();
var url = 'http://host/gwt...';
page.open(url, function (status) {
  //Page is loaded!
  phantom.exit();
});

This is particularly great for CI, in my case Travis CI, as it
already has phantomjs installed. Is there a way that I can write a
new RunStyle class and make it available as a kind of plugin? Or
do I really have to submit it as a patch and hope that it gets
included in the official GWT distribution?

Thanks for your support!
Maik

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors 


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Re: [gwt-contrib] Re: Developing a new remote RunStyle for PhantomJS

2013-01-15 Thread Maik Riechert

Am 15.01.2013 11:22, schrieb Thomas Broyer:



On Tuesday, January 15, 2013 10:27:57 AM UTC+1, Maik Riechert wrote:

I see, it's probably perfectly applicable to Travis CI (I would
just start the phantomjs webdriver server before executing tests)
but what about:

http://code.google.com/p/google-web-toolkit/issues/detail?id=7768
http://code.google.com/p/google-web-toolkit/issues/detail?id=7768


Ah, good catch! Patches welcome! ;-)


Alright, I did a quick prototype based on the selenium run style and 
guess what, it works!


https://github.com/neothemachine/gwt-webdriver-junit-runstyle

It's a shame though that the gwt-maven-plugin doesn't support arbitrary 
run styles. I guess I'll open an issue on GitHub for that.


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

[gwt-contrib] Developing a new remote RunStyle for PhantomJS

2013-01-14 Thread Maik Riechert
Hi all,

As htmlunit isn't suited for all testing scenarios (in particular layout 
specific ones), I'd like to use PhantomJS as an alternative (production 
mode only). It is a headless webkit engine and can be easily controlled 
with JS files, meaning that the new RunStyle would fork a shell process 
phantomjs pageload.js where pageload.js would be written to disk 
beforehand containing:

var page = require('webpage').create();
var url = 'http://host/gwt...';
page.open(url, function (status) {
  //Page is loaded!
  phantom.exit(); 
});

This is particularly great for CI, in my case Travis CI, as it already has 
phantomjs installed. Is there a way that I can write a new RunStyle class 
and make it available as a kind of plugin? Or do I really have to submit it 
as a patch and hope that it gets included in the official GWT distribution?

Thanks for your support!
Maik

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Re: [gwt-contrib] Developing a new remote RunStyle for PhantomJS

2013-01-14 Thread Maik Riechert

Ah, great! Someone should document that, at least I didn't find it anywhere.

Am 14.01.2013 21:12, schrieb Matthew Dempsky:
You can write your own RunStyle class and then run the JUnit shell 
with -runStyle your.fully.qualified.PhantomJSRunStyle.



On Mon, Jan 14, 2013 at 11:59 AM, Maik Riechert 
neothemach...@googlemail.com mailto:neothemach...@googlemail.com 
wrote:


Hi all,

As htmlunit isn't suited for all testing scenarios (in particular
layout specific ones), I'd like to use PhantomJS as an alternative
(production mode only). It is a headless webkit engine and can be
easily controlled with JS files, meaning that the new RunStyle
would fork a shell process phantomjs pageload.js where
pageload.js would be written to disk beforehand containing:

var page = require('webpage').create();
var url = 'http://host/gwt...';
page.open(url, function (status) {
  //Page is loaded!
  phantom.exit();
});

This is particularly great for CI, in my case Travis CI, as it
already has phantomjs installed. Is there a way that I can write a
new RunStyle class and make it available as a kind of plugin? Or
do I really have to submit it as a patch and hope that it gets
included in the official GWT distribution?

Thanks for your support!
Maik
-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors



--
http://groups.google.com/group/Google-Web-Toolkit-Contributors 


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Remote debugging with gwt:debug works, with Eclipse it doesn't

2012-12-13 Thread Maik Riechert
Hi,

I am trying to debug a GWT app which is deployed on a Glassfish 3 server. 
When I use gwt:debug from command line, everything works as expected. 
However, I want to use it directly in Eclipse and therefore created a run 
configuration with Debug as - Web application (running on an external 
server), where the args are:

-war /home/.../workspace/project/.../target/admin -remoteUI 
${gwt_remote_ui_server_port}:${unique_id} -startupUrl 
http://my.remote.server/ -logLevel INFO -noserver -codeServerPort 9997 
a.b.c.Application

When I access a page, I get the following exception:

16:15:41.142 [ERROR] [a.b.c.Application] Generator 
'com.google.gwt.user.rebind.rpc.ServiceInterfaceProxyGenerator' threw an 
exception while rebinding 'a.b.c.services.AdminService'
java.lang.UnsupportedOperationException: isProdMode is only available from 
GeneratorContextExt.
at 
com.google.gwt.core.ext.GeneratorContextExtWrapper.isProdMode(GeneratorContextExtWrapper.java:91)
at 
com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.logReachableTypes(SerializableTypeOracleBuilder.java:1496)
at 
com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.build(SerializableTypeOracleBuilder.java:843)
at 
com.google.gwt.user.rebind.rpc.ProxyCreator.create(ProxyCreator.java:306)
at 
com.google.gwt.user.rebind.rpc.ServiceInterfaceProxyGenerator.generateIncrementally(ServiceInterfaceProxyGenerator.java:60)
at com.google.gwt.core.ext.GeneratorExt.generate(GeneratorExt.java:52)
at 
com.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(IncrementalGenerator.java:40)
at 
com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:657)
at 
com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
at 
com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:79)
at 
com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:276)
at 
com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:141)
at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:595)
at 
com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:465)
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
at com.google.gwt.core.client.GWT.create(GWT.java:97)
at a.b.c.Application.onModuleLoad(Application.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:406)
at 
com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
at 
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526)
at 
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
at java.lang.Thread.run(Thread.java:679)

The project uses GWT 2.4, but I guess this wasn't an issue that was fixed 
in 2.5, right?

Do you have any idea why this isn't working? I do have the GWT 2.4 SDK 
installed and setup in Eclipse.

Cheers
Maik

-- 
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/-/aO_HxAzYqY0J.
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.



[gwt-contrib] Adding wrap method to Canvas and/or make constructor protected

2012-10-25 Thread Maik Riechert
Hi,

I'm using 2.5.0rc2 and find the Canvas class not useable if I use JS 
libraries through JSNI which give me canvas elements (I'm contributing to 
KineticGWT, a wrapper for KineticJS). There's no wrap() method like in the 
other widget classes and I can't even solve it by subclassing Canvas, as 
the constructor is private: private Canvas(CanvasElement element).

This issue has been raised a year ago here:

https://groups.google.com/d/topic/google-web-toolkit/xNA8wPpp9RY/discussion

Could this be fixed for the final 2.5.0?

Cheers
Maik

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Re: Create Canvas widget from CanvasElement

2012-10-22 Thread Maik Riechert
I stumbled upon the same thing today.

I'm a contributor to KineticGWT which is a JSNI wrapper around the 
KineticJS library. In this library, the canvas elements are created by the 
library itself and I only get them. So I thought, when doing something like 
layer.getCanvas() it would be best to use the Canvas widget, but still, as 
of 2.5.0rc2 the constructor is private and there's no wrapper method. This 
sucks! I'll see if it's already been mentioned in gwt-contributors.

Cheers
Maik

-- 
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/-/yVEsWLmLvOYJ.
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.