Re: LayoutPanel and Custom Widget

2012-01-17 Thread Uemit
Either your custom widget extends 
ResizeCompositehttp://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/ResizeComposite.html
 or 
implements RequiresResize and ProvidesResize interfaces. This will ensure 
that the onResize event is propagated to your LayoutPanel. 

You have to make sure that you put your widget in a ResizeLayoutPanel or in 
a Panel which implements ProvidesResize and make sure that there is a 
unbroken chain of ProvesResize/RequiresResize panels up to the 
RootLayoutPane.
Whenever you resize your browser LayoutPanel will resize accordingly. 


-- 
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/-/yxcKVSMLYFEJ.
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 client static variable versus Server side Session object

2012-01-10 Thread Uemit
Well it depends. 
If you use a server side session object the information (i.e. locale) will 
be probably stored in a Cookie and transmitted whenever you initiate a HTTP 
request (communicate with the backend) and it is always available on the 
backend.
If you store it as a static variable you have to add to manually to the 
request to the backend. Furthermore with Cookies you can specify a lifespan 
which goes beyond the session and the information is  also available when 
you refresh the browser. That's not possible with client side variable 
unless you use HTML5 localcache. 

to summarize:

Server side session:
Advantages: 

   - transmitted in every request (so it's always available on the backend)
   - lifespan beyond current session (via Cookie expire date)

Disadvantages:

   - Always transmitted - small overhead 


Client side static variable:
Advantages:

   - You can control when the information is transmitted

Disadvantages:

   - Information is lost if you refresh or close the browser
   








-- 
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/-/W-N6sZpK8T4J.
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 use caching with gwt

2011-12-17 Thread Uemit
@Ed: Interesting, I didn't know about the PrecrompressLinker. What's the 
difference to configuring the web-server to do gzip compression on the fly? 
I suppose the advantage is that it doesn't burden the server

-- 
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/-/xmSKRf1D5W4J.
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 use caching with gwt

2011-12-16 Thread Uemit
You have to clarify what you mean with caching? 

If you refer to caching of the javascript files that are transfered to the 
client then refer to these docs: 
 - http://code.google.com/speed/articles/caching.html
 - http://code.google.com/speed/page-speed/docs/caching.html

If you are talking about caching of data then you have several 
possibilities:
 - caching by storing in static variables
 - HTML5 Localstorage 
(http://code.google.com/webtoolkit/doc/latest/DevGuideHtml5Storage.html)
 - gwt-mobile-webkit  (http://code.google.com/p/gwt-mobile-webkit/)

-- 
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/-/6wROQ830HocJ.
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 change css value's through CssResource mechanism?

2011-11-11 Thread Uemit
If the FlexButton uses ClientBundle and CssResources you should be able to 
override it on instance level. 
Similar to how you can do it with the CellWidget where you can pass a 
different CssResource implementation in the constructor. However this 
requires that you somehow have access to the ClientBundle/CssResource file 
of your FlexButton


-- 
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/-/BnOF8UAQm44J.
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: CandleStick Chart using GWT Java API

2011-11-08 Thread Uemit
The gwt-google-api visualization api doesn't contain a GWT wrapper for the 
Candlestick Chart however it is quite straightforward to create one 
yourself. 
Here is a 
tutorialhttp://code.google.com/p/gwt-google-apis/wiki/VisualizationNewWrapper
. 
You can take the LineChart 
http://code.google.com/p/gwt-google-apis/source/browse/trunk/visualization/visualization/src/com/google/gwt/visualization/client/visualizations/corechart/LineChart.javawarpper
 
(from the corechart package) as an example. 


-- 
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/-/FFFJkRAN-iQJ.
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: Is GWT's obfuscate compilation safe enough to protect the js code?

2011-11-07 Thread Uemit
Depends. You can apply authentication and authorization on the 
server/backend to make sure that not anyone can use 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/-/U-AaJVo55toJ.
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: Is GWT's obfuscate compilation safe enough to protect the js code?

2011-11-07 Thread Uemit
@Palo G.
Actually I wasn't suggesting to protect the generated javascript but to put 
the algorithm on the server/backend and access it from the client via RPC 
or any other method. 
I think what OrNot wanted to know is whether he can somehow make sure that 
only specific user can execute the RPC call and this can be done if the RPC 
is secured via some authentication/authorization mechanism. 
I also agree security by obscurity is not the right approach. 

However I do believe there is a use case for time consuming computations on 
the client side. With each browser iteration/version Javascript Engine 
becomes faster and faster and nowadays a common desktop machine/laptop has 
enough horse power to do computational intense calculations on the client 
side. So I think more and more some computational tasks which used to be 
done on the backend will move to the client. 

-- 
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/-/c83YRnzgjYcJ.
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: Is GWT's obfuscate compilation safe enough to protect the js code?

2011-11-07 Thread Uemit
@Harpal Grover: 
Actually there might be a solution right now. You can use Native Client 
SDKhttp://code.google.com/chrome/nativeclient/to develop a C++/C application 
which runs in the browser.  The application 
will be compiled to a binary and then transmitted to the client/browser 
where it is executed in a sandbox. It is still possible to use 
a Dis-assembler in order to figure out the algorithm however it is much 
harder than obfuscated javascript code.
However until now NaCl is only supported in Chrome. 

-- 
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/-/BKKtXBypOI8J.
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 capabilities

2011-11-07 Thread Uemit
Of course you can achieve that with GWT.  Note: GWT is a client side 
toolkit. So it won't help you with the server side stuff (Spring, JSP, 
etc). 

The question is whether it is not easier to use a traditional javascript 
framework (jQuery, etc) instead of GWT because apparently you are 
developing a traditional webpage/website (multi-host page with some 
javascript behaviour). 
GWT really shines when you want to develop a desktop like interactive 
web-application (using MVP) where the backend acts only as datasource. 
That doesn't mean that it can't be used for a normal website but probably 
frameworks like jQuery are easier to use and get results than GWT. 
If you use Spring framework MVC and JSP then you will probably only use GWT 
for AJAX calls and DOM operations that can be as easily achieved with 
jQuery. 

If you plan to develop a desktop like web-app where you have one host-page 
and all the UI flow/synchronization is done on the client side then I would 
strongly recommend GWT. However if you have multiple-page website (i.e.: 
using Spring's MVC) and only want to embed some javascript code for some UI 
behaviour, GWT might not be the easiest solution. 


-- 
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/-/Cx_VCoZ8lj0J.
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: CSS optimization

2011-11-07 Thread Uemit
premature optimization is the root of all evil  
Saying that you, can find more infos about GWT's CSS optimizations in the 
official gwt 
docshttp://code.google.com/intl/de-DE/webtoolkit/doc/latest/DevGuideClientBundle.html#Optimizations
. 

-- 
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/-/Xg0v-RjT8jQJ.
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: large celltable pagination question

2011-10-24 Thread Uemit
I am actually using piriti http://code.google.com/p/piriti/ to convert 
JSON to my DTOs.  Piriti uses Generator and JSONParser internally to convert 
JSON to DTOs 


-- 
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/-/0jgXL-2GTd8J.
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: large celltable pagination question

2011-10-21 Thread Uemit
No, CellTable will only render the visible part. 
Fetching 500 rows from the server should take too long either.
I assume that the slowness is not related to the rendering in the CellTable 
but probably due to fetching and parsing of the 500 rows because you don't 
see any difference when you render 5 rows or 500. 
So it clearly must be something else. 

There are 3 possible bottlenecks:


   1. Fetching the data from the backend: if you use JSON and don't transfer 
   many fields then 500 rows shouldn't be a big issue (you can verfiy it by 
   using Firebug and checking the payload size)
   2. Parsing the fetched data: Again with JSON it should be fast enough to 
   parse 500 rows (not sure about XML)
   3. Rendering the data in a CellTable: if there is no performance 
   difference between 500 rows and 5 rows then the bottleneck must lie in one 
   of the previous areas.


I have no performance problems fetching around 2000 rows and displaying 50 
of them (using SimplePager). 


-- 
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/-/4F6zBx7p3BkJ.
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: Determine widget size after load

2011-10-20 Thread Uemit
Are you using a TabPanel or a TabLayoutPanel? I think you have to use a 
TabLayoutPanel instead of a TabPanel because the TabLayoutPanel implements 
both ProvideResize and RequireResize interfaces.
Basically you always have to a chain of Panels which implement those 
interfaces in order to properly propagate the resize event. 
If you put your Canvas Widget not in a LayoutPanel you have to set a 
specific height and width for the parent container widget in order to 
retrieve the dimensions otherwise I think getOffsetWidth 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/-/PpVwXYu7wk8J.
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: Determine widget size after load

2011-10-18 Thread Uemit
I think there are two ways to do that. 

1.) Call forceLayout() on your LayoutContainer. This will call onResize on 
all client widgets which implement the RequireResize interface.
In the onResize method of your canvas widget you can retrieve the available 
width by calling getParent().getOffsetWidth() (instead of getParent() you 
can call it on a container panel etc)

2.) When the canvas widget gets constructed you can issue a deferred command 
and set the size in it: 

Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
canvasWidget.onResize();
}
});


 

-- 
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/-/zHoHAWlk9U8J.
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: Full page in GWT or just parts?

2011-10-12 Thread Uemit
I think GWT is best utilized in a full page scenario because of code 
sharing of re-usable components.
If you go the other route and just embed GWT code in different host pages 
(i.e. application with multiple entry points) you lose the benefits of 
javascript code re-use of reusable components because every entrypoint will 
have its own module.nocache.js file which has to be transferred to the 
client. If you create a re-usable component (let's say a CellTable 
component) which is used in different places  (in both entry points) the 
same code will be part of the module.nocache.js file and thus downloaded two 
times. 
It probably doesn't make a big difference for small web-sites where some 
parts are done with GWT but for complex apps where you might re-use a lot of 
components it might be an issue. 
However in case you go with the one host page (one entry point) solution you 
will probably not use any of the your backend's flow controls (MVC) but it 
will solely act as a data-backend. 



-- 
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/-/cuYO25r6uJ8J.
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: New GWT App for hackers

2011-10-11 Thread Uemit
Really great idea. 
I haven't had really time to play around but I am looking forward to when I 
have more time ;-)

-- 
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/-/S0CI6BRuuPkJ.
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: DataGrid (GWT 2.4) not visible in HTMLPanel

2011-09-22 Thread Uemit
@Steve: 
Thanks for the confirmation. I put the DataGrid in a ResizeLayoutPanel and 
it works fine now. 

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



DataGrid (GWT 2.4) not visible in HTMLPanel

2011-09-19 Thread Uemit
I am trying to switch from CellTable to the GWT 2.4's new DataGrid 
CellWidget however I run into a problem. 
I used the CellTable inside two normal divs for styling purposes (border, 
etc). 
The UiBinder code looked as follows:

*g:HTMLPanel*
*div class={mainRes.style.box_shadow}
*
*   div class={mainRes.style.box_container}
*
*   c:CellTable ui:field=table 
addStyleNames={mainRes.style.cellTable} /*
*   /div*
*   /div*
*/g:HTMLPanel*


However with the new DataGrid this approach doesn't work anymore.  When I 
put the DataGrid inside a HTMLPanel, nothing is displayed. I checked with 
firebug and I saw that height is 0px. 
I then checked the DataGrid source and saw that it implements the 
RequireResize interface. So I assume the problem is that HTMLPanel breaks 
the  
ProvidesResizehttp://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/ProvidesResize.html
 chain. 
I tried to set the height to 100% but it didn't really work.
Is it somehow possible to put the DataGrid inside two normal divs or can I 
only place it inside a g:LayoutPanel ? 

Thanks in advance

Ümit

-- 
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/-/NBqEcf_uO7YJ.
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: Why rpc requets calls arent operated independetly(concurrently) by methods in server-side code

2011-09-08 Thread Uemit
@Juan:
I don't think that the problem is related to Javascript being single 
threaded. You can have multiple XHTMLHttpRequests running in parallel (with 
modern browsers up to 6 per domain). 

@wasyl: Can you post some code on how you call the server requests ? Are you 
using RPC ? How are the emails downloaded into the server-side db? is that 
done entirely on the server side?


-- 
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/-/MgcsM2orfEsJ.
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 RequestBuilder + Servlet issue

2011-09-02 Thread Uemit
So you want to send some data to the servlet and want to display a PDF 
(which is generated by the servlet based on the data sent) in the browser?

There are two ways of how to do it: 

1.) Using RequestBuilder you could generate a AJAX call to your Servlet (as 
you did it). However in the callback method of the RequestBuilder you will 
get the response from the servlet (probably the PDF binary data) and then 
you could use that to open a new window with the binary PDF data.

however I think the easier approach is the following:

2.) Have either a form or a URL which points to the URL of the servlet 
responsible for generating the PDF. The data you want to pass to the servlet 
can bei either passed by POST (form) or GET (url) and in the servlet make 
sure that response headers are set properly (application/PDF). 

second appraoch is easier. 


-- 
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/-/YleAom9t2JQJ.
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: What content management system are you using with GWT?

2011-08-24 Thread Uemit
Well I think that content management systems are more like classical 
web-sites with mostly static content whereas GWT is a toolkit  aimed for 
developing web-applications rather than classical web-sites (tough it can 
also be used for that). 
So that's probably the reason why not many content management systems rely 
on GWT.  
Furthermore development of most of the popular CMS began before GWT came to 
live and usually you switch the underlying framework if there is no real 
reason for it. 
However that doesn't mean that future CMS won't/can't rely on GWT. 
In most cases the use case for a web-application is so specific that you 
have to do user management/authentication yourself and this is actually done 
mostly on the backend side. 

Concerning having common components (discussion board etc) on your site I 
see two scenarios/solutions:

1.) Somebody develops those components as GWT standalone components with a 
specific API so that it can easily be integrated into existing GWT apps 
(similar to those plugin systems in CMS)
2.) Just take a third party component and put it in an iframe or theme it 
similar to your GWT app and have a separate URL for that. 




-- 
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/-/kkdnbmsrBkcJ.
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: RPC vs other methods

2011-08-24 Thread Uemit
Well your two choices are not real choices. You have to use both more or 
less.
IMHO I would recommend following steps:

1.) have some kind of a cron jobs which runs on the backend and queries all 
those 10,000 servers in regular intervals and stores the information in a 
SQL database or some other storage system.
2.) Use RPC, Requestfactory or RequestBuilder (i.e. JSON) to retreive the 
the server information from the SQL database/storage systems as soon as a 
user visits the server-list page.
3.) Use a CellTable with a SimplePager and AsyncDataProvider to avoid 
transfering the entire server list to the client. 

-- 
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/-/vlIXlX7IsIcJ.
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: What content management system are you using with GWT?

2011-08-23 Thread Uemit
I think serendipity relies/works with GWT:
http://uptick.com.au/content/serendipity-working-gwt-platform-and-smartgwt

-- 
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/-/uaox4PCIx9AJ.
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: CellTable + Editor displaying only those rows based on a flag in the bean

2011-08-22 Thread Uemit
You will probably use an AbstractDataProvider instance to fill the 
CellTable. You have to create a helper method which retrieves the list of 
beans based on the flag and sets it in the AbstractDataProvider (or 
ListDataProvider). 
Something like this:

final ListDataProviderUser dataProvider = new ListDataProviderUser();

ListUser listToDisplay = new ArrayListUser();

for (User user: userList) {

if (user.isActive())

   listToDisplay.add(user);

}

dataProvider.setList(listToDisplay);

dataProvider.addDataDisplay(cellList);


-- 
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/-/w5FzaKysbXoJ.
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: CellTable custom footer

2011-08-22 Thread Uemit
Hi John 

I do have a question regarding redrawing the entire DataGrid/CellTable when 
new data is pushed in. 
I tried to implement a SearchTextBoxes in the ColumnHeader for filtering the 
data which is displayed in the CellTable. 
As soon as I type a character into the SearchTextBox in one of the column 
headers I filter the ListDataProvider and the CellTable is refreshed. 
However the refresh/redraw of the celltable causes the SearchTextBox input 
to lose its focus and currently in GWT 2.3 there is no way to specify that 
the SearchTextBox gets the focus back which leads to painful user experience 
(the user has to click into the SearchTextBox again to type in the next 
character). 

I have posted this question in Stackoverflow (
http://stackoverflow.com/questions/6422896/celltable-with-custom-header-containing-searchbox-and-focus-problem)
 
but got no responses. 

https://lh5.googleusercontent.com/-QSUJ0kixSwc/TlIhZUqdDGI/AFs/o48fsjiC5Yc/celltable_search_header.png
I solved this problem by creating another table above my CellTable,  putting 
the Searchboxes there and trying to align them to my CellTable headers. But 
that doesn't seem to be a really good way to do it (check screenshot). 

Can this problem be solved with the new CellWidget API in 2.4 ?


-- 
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/-/pFoH_rTnnb8J.
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: Controlling Size(screen) on Mobile Device

2011-08-22 Thread Uemit
Well, the whole resolution independent web development is really cumbersome 
especially with GWT like web-application UI. 

Static web-sites either stick to the static (i.e. 960 grid system) or 
fluid/liquid (floating) UI design. 
With the static design the content size is always the same no matter of the 
resolution you are viewing the web-page. This is done because there is an 
optimal text length. If you expand text-content to the complete size of the 
display it becomes really hard to read with high resolution displays. So 
static web-pages tend to stick the fixed sized layouts. However there is 
also a move to liquid/fluid layouts where you resize the layout based on the 
viewport. 
Check out this articles for more information: 
http://coding.smashingmagazine.com/2009/06/02/fixed-vs-fluid-vs-elastic-layout-whats-the-right-one-for-you/
http://www.maxdesign.com.au/articles/liquid/

These two concepts work well in the desktop context where you can expect 
screen resolutions  1024px.
However in the mobile context you have to expect lower screen sizes. 

So there are two solutions to that:
You can either use liquid/fluid design. However this doesn't always work 
well because the sections in of your web-app will be to small and the user 
has to zoom in and out constantly. 
For example on a tablet it might be viable to have a navigation panel on the 
left side and a content panel on the right (DockLayoutPanel). However on a 
mobile phone it might be better to just have the navigation panel  and on 
clicking an item the content panel is displayed. 

The second solution is to use different View implementations based on the 
UserAgent (device). 
There was a talk on the last Google IO conference on that and a sample 
project on how to implement it. 

http://www.google.com/events/io/2011/sessions/using-gwt-and-eclipse-to-build-great-mobile-web-apps.html
http://code.google.com/p/google-web-toolkit/source/browse/#svn%2Ftrunk%2Fsamples%2Fmobilewebapp

Developing a GWT web-app which works on all desktop resolutions as well as 
on mobile devices are real challenger. Actually it is difficult enough to 
achieve this if you only want to optimize for different desktop resolutions, 
especially if you use
Charts which require explicit sizes. 
The MVP pattern can help to have different view implementations and still 
avoid redundant code. 

-- 
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/-/cFqHQYRzFEUJ.
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: Help to set Chart Height in Visualization API

2011-07-28 Thread Uemit
As far as I know it is not possible. You have to set explicit sizes for 
google charts (at least for the height). 

-- 
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/-/npkEHT-Cix8J.
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: JQuery like animation

2011-07-04 Thread Uemit
If you don't care much about old browsers you can also use CSS3 
transitions/animations for simple stuff. 
I used it in a GWT project (i.e. ProgressBar) and it works really well. 
i.e.: http://aatiis.me/demos/pure-css-progress-bar



-- 
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/-/pc9_H6dESdsJ.
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: Facebook like Chat App with GWT

2011-06-28 Thread Uemit
Check out ijab. It is based on GWT and look really like the Facebook Chat

http://opensource.ijab.im/


-- 
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/-/p3rzeYNQZOsJ.
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: CellTable, Custom Header and Focus Problem

2011-06-28 Thread Uemit
I played a little bit around and tried to override the resetFocus method on 
the SearchCell but this method is never called. I suppose this only works if 
the Cell used in a row context and not in a header context?
My approach is somehow run schedule a deffered command which sets the focus 
but that's doesn't seem to be a really clean approach.
Is there maybe a better approach?

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



CellTable, Custom Header and Focus Problem

2011-06-20 Thread Uemit
Hi all
I am trying to implement a CellTable with a custom Column Header which 
displays a SearchBox (simple Textbox) below the normal Column Text for 
searching purposes. Something like that:

|   Header 1|   Header 2  |
|  SEARCHBOX  | SEARCHBOX |
---
|ROW 1 
--
|ROW 2 

As soon as the user types in a character into the SearchBox a 
RangeChangeEvent is fired which leads to a server requests and the CellTable 
is updated with the new filtered list. 
Basically everything works fine. 
However as soon as the CellTable is refreshed (after typing in a character 
into the searchbox) also the SearchBox loses its focus and the user has to 
click with the mouse again into the SearchBox which is a little bit clumsy. 
This is probably related to the fact that the render method of the custom 
header and its cell is called after the CellTable refresh. Is there any way 
how to set the focus back to the SearchBox? I tried to set tabindex=0 but it 
didn't help. 
The important code is in the SearchCell class. In override the 
onBrowserEvent function and in the *keyup *part I set the boolean flag 
isChanged = True. In the *blur *part I set it back to False. How can I check 
this flag and set the focus on the SearchBox again?


*Custom Header Class:*

public static class SearchHeader extends HeaderSearchTerm {
@Override
public void render(Context context, SafeHtmlBuilder sb) {
super.render(context, sb);
}
private SearchTerm searchTerm;
public SearchHeader(SearchTerm searchTerm,ValueUpdaterSearchTerm 
valueUpdater) {
super(new SearchCell());
setUpdater(valueUpdater);
this.searchTerm = searchTerm;
}
@Override
public SearchTerm getValue() {
return searchTerm;
}
 }


*Custom Search Cell (used in the custom Header)*
*
*

public static class SearchCell extends AbstractCellSearchTerm {

interface Template extends SafeHtmlTemplates {
@Template(div style=\\{0}/div)
SafeHtml header(String columnName);

@Template(div style=\\input type=\text\ 
value=\{0}\//div)
SafeHtml input(String value);
}

   private static Template template;
   private boolean isChanged = false;

   public SearchCell() {
   super(keydown,keyup,change,blur);
   if (template == null) {
   template = GWT.create(Template.class);
   }
   }

   @Override
   public void render(com.google.gwt.cell.client.Cell.Context context,
   SearchTerm value, SafeHtmlBuilder sb) {
   sb.append(template.header(value.getCriteria().toString()));
   sb.append(template.input(value.getValue()));
   }

@Override
public void onBrowserEvent(Context context,Element parent, 
SearchTerm value,NativeEvent event,ValueUpdaterSearchTerm valueUpdater) {
if (value == null)
return;
super.onBrowserEvent(context, parent, value, event, 
valueUpdater);

  if (keyup.equals(event.getType()))
  {
  isChanged = true;
  InputElement elem = getInputElement(parent);
  value.setValue(elem.getValue());
  if (valueUpdater != null)
  valueUpdater.update(value);
  }
  else if (blur.equals(event.getType())) {
  isChanged =false;
  }
 }

  protected InputElement getInputElement(Element parent) {
  Element elem = 
parent.getElementsByTagName(input).getItem(0);
  assert(elem.getClass() == InputElement.class);
  return elem.cast();
  }
}

-- 
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/-/aZDrRSejucAJ.
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: OutlineView Widget

2011-06-09 Thread Uemit
You could use the CellTree Widget and create an implementation of 
the AbstractCell where you override the render method and create this kind 
of structure.


-- 
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/-/tJmWlmJ2MlUJ.
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: pass variable from JavaScript to GWT

2011-05-13 Thread Uemit
Your JSNI call looks fine. 
However if you try to run the Java function from outside the GWT context, 
then you have to build a bridge (
http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsJSNI.html#calling
)

Try to debug it with some alert('xyz') statements.



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



Aw: GWT Visualization Performance/Optimization

2011-04-30 Thread Uemit
We were using 5 scatter charts each of them displaying around 2000 points 
and it worked pretty well and it didn't really take long to render it (maybe 
a sec oder so).

The Google Visualization scatter charts use SVG which doesn't scale that 
well with increasing number of objects. 
If performance is really important you can try to use a scatterplot which is 
based on canvas. 
We successfully switched from the google visualization scatter charts to 
dygraph (http://dygraphs.com/). Dygraph is based on cavnas and performs 
really good and hase also zooming and other useful features. 
They even support Google Visualization DataTable as datasource. 

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



Re: Use of processing.js with GWT

2011-03-25 Thread Uemit
Yes I am using processing.js with GWT.
I wrote a simple GWT wrapper for processing.js you can check it out here: 

https://github.com/timeu/processing-js-gwt

There are three ways to load processing code (you have to call them on the 
instance of the wrapper):

load(ExternalTextResource code ,final Runnable onLoad)
loadFromUrl(String url,final Runnable onLoad)
load(String code,final Runnable onLoad)

*The onLoad Callback will be called as soon as the processing code is 
loaded.
*
*
*
*There is also an abstract *ProcessingInstance *class for interaction with 
the Processing code. *
*
*
*Hope this helps*

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



Feedback on different backends for GWT

2011-03-22 Thread Uemit
 feedback. Maybe somebody has experience 
with both backend or with that use case.

thanks in advance

Uemit

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



Re: Need Feedback on charts frameworks for GWT

2011-03-22 Thread Uemit
I think it doesn't make any difference if you use MVP architecture or not 
for charts. You will treat them as any other widgets. 

If you need default charts (scatterchart, barchart, etc) I can recommend to 
use google's visualization API (
http://code.google.com/apis/charttools/index.html).
For time-series charts I use Dygraphs (http://dygraphs.com/) and I forked 
the project and modified it a little bit so I can also use it as a 
scatterchart. 

There are some other charting libraries but for most of them you have to 
write your own GWT wrappers or directly interact with JSNI:

SVG:
http://raphaeljs.com/
http://vis.stanford.edu/protovis/
http://www.highcharts.com


Canvas:
http://dygraphs.com/
http://www.rgraph.net/
http://www.zingchart.com/flash-and-html5-canvas/








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



Re: math performance

2011-03-18 Thread Uemit
You can check the compiled code and see how the mathematical calculations 
are translated into javascript. 
For these kind of complex calculations the Native Client SDK ( 
http://code.google.com/p/nativeclient-sdk/) would be a perfect fit but 
unfortunately it is only supported in the latest chrome version. 
But I generally agree that nowadays client processing power is really no 
issue and as the performance of the javascript engines significantly 
increase from version to version it definitely makes sense to make use of 
that. 


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



Re: One Session(HTTP) for multiple GWT-Modules?

2011-03-17 Thread Uemit
It depends how session management is done on the client.  If you use cookies 
to store the session id it should make no difference as long as you 
communicate with the same domain (Cookies are domain specific).
If you open gmail in two tabs in your browser you won't have to authenticate 
twice only one time right?. Both gmail instances will share the session. 




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



Re: GWT Graphics (SmartGWT)

2011-03-14 Thread Uemit
There are several ways to solve that. 
1.) Doing it HTML way (the way you did it). I am not sure why it takes 20 
seconds (btw how did you create the rectangles?). 
You might look into the cell widgets ( they provide better performance 
for dynamically creating large amounts of cells). 
2.) SVG Graphics.
There are some 3rd party libraries (like RaphaelJS) you can use or if 
its really just rectangles you can create it yourself easily. Advantage of 
SVG is vector graphics (scaling) and easy to implement handlers on the 
objects (i.e. clickhandler on seat). 
However SVG might not scale well with large amounts of objects because 
you have to deal with 5000 DOM objects (for each seat one svg element) 
though there might be some workaround for that (re-using similar objects, 
etc).

3.) Canvas. 
 Probably scales best with large number of objects. However dealing with 
eventhandlers is not as easy as with SVG or HTML. GWT 2.2 introduces the 
canvas API (so you could use it natively in GWT). Alternatively there are 
also some 3rd party libraries (processingjs,
etc). 

Disadvantage with SVG and Canvas is browser compatibility especially with 
IEs. In GWT 2.2 the canvas API only supports I.E  9.0 (chrome safari and 
firefox work fine). ExCanvas provides support for I.E. 0.9 but you have 
to incorporate it yourself and performance is not really that good.

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



Re: Highcharts - updating chart with data

2011-03-04 Thread Uemit
A couple of things:
1.) I am not sure if it is possible to access the series array of the 
JavaScriptObject instance option, the way you have done it. In hosted mode 
it should complain that there is no field series in options because options 
is a generic JavaScriptObject. 
2.) You probably have to make sure the options instance you store in your 
wrapper is the same object as the actual one which is stored in the 
Highcharts chart instance.

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



Re: Deferred Binding, Gin in library/widget ?

2011-02-28 Thread Uemit
But in case I use a app-wide URL I still have to inject the URL into my 
DataSource class right? 
I could use Field Injection but isn't constructor injection the recommended 
way to do it ?

I think it boils down to the question: What is the best practice if you want 
to develop a standalone library which doesn't care if the user uses DI or 
any other method to pass resources and dependencies into my library classes?

Sorry that I repeat the question but do I have to annotate the constructor 
with @Inject if I want to allow for constructor based DI or is there any 
other way (to avoid dependency to the guice/gin  in my library)?

Thanks in advance

cheers
Uemit



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



Re: Deferred Binding, Gin in library/widget ?

2011-02-25 Thread Uemit
@Brian: 
I agree, after thinking a little bit more about that problem and taking your 
comments into account I think that deferred binding might not be really 
suitable for my use case.

I also agree that the best approach is to set the datasource in the 
constructor thus enabling users to use Dependency injection if they want. 
But do I have to annotate the constructor with @Inject in order to allow 
for DI ? (because in that case I would create a dependency to gin and guice 
in my standalone library which i want to avoid). 


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



Re: Deferred Binding, Gin in library/widget ?

2011-02-25 Thread Uemit
Hi Phillipe

Thanks for the interesting comments. I am still trying to fully understand 
dependency injection and sometimes I am not sure that I have ;-) 
I agree that dependency injection is more powerful and flexible compared to 
deferred binding. 

So the three cases you described apply when I want to mix deferred binding 
with DI? 
After thinking a little bit about my problem and taking Biran's previous 
comments into account I decided against deferred binding and for designing 
the API so it can be used with DI (dependency injection). 
I haven't really decided whether the url is going to be an application wide 
resources or if it can be set to different values on an instance base. But 
does it really make a difference in regards to DI? 

In both cases I would try to inject the URL as a constructor injection? (I 
could use annotated dependency injection for different URLs in the app I 
guess?)

The HttpDataSource class is a special implementation of the DataSouce and 
doesn't necessary mix with different datasource implementations. For example 
I might add a HTML5 LocalStoreDataSource which doesn't need an URL 
ressources but might take something else in the constructor.  

In your opinion what is the best DI setup for this use-case?
And do I have to annotate my DataSource constructors with @Inject if I want 
to enable DI? This would create a dependency to GIN/GUICE in my library 
which I want to avoid. 

thanks in advance 

Uemit


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



Re: Deferred Binding, Gin in library/widget ?

2011-02-24 Thread Uemit
@Brian

I see your point but I am not entirely convinced yet that using either 
GIN/deferred binding might not be beneficial for my use case.
Just for the record: I think it makes sense to allow the user to choose the 
specific datasource implementation at compile time, because once the 
datasource is set it isn't changed throughout the application (at least for 
an instance of my widget).

Of course users of the widget/library should be able to implement their own 
datasources. But then again they can define it for a widget at compile time.
I also plan to  provide say 3 different datasource implementations packaged 
with my library/widget. 
Of course it is possible to use setDataSource()  to set the datasource but 
isn't it nicer and easier to test if I use GIN to inject the DataSource ?

Maybe deferred binding is probably too much overkill for that use case 
(tough it also used in the gwt-log library to configure different Loggers) , 
especially if you might have different instances of that widget in your 
applications which might use different datasource implementations (deferred 
binding would only allow one type of datasource implementation).

However using dependency injection might be a compromise. I could use 
annotations to inject different datasource implementations. 

Not sure if that makes sense.

cheers

Uemit


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



Re: JSNI and Generic Types

2011-02-22 Thread Uemit
I tried the JSNI call that Thomas suggested and it works (GPE doesn't 
display any errors and it also compiles fine):

@mycustomnamespace.event.CustomHighlightEvent::fire(Lcom/google/gwt/event/logical/shared/HasHighlightHandlers;L
java/lang/Object;)(view,data);

So I replaced my DTO type  *Lmycustomnamespace.model.MyCustomDTO; *with *L**
java/lang/Object; *

I am not sure why GPE does't autocomplete that correctly but in case 
somebody has the same issue, just replace the autocompleted generic types 
with the erased ones (thanks Thomas for the hint).

cheers
Uemit





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



JSNI and Generic Types

2011-02-21 Thread Uemit
Hi everyone 

I am trying to implement a custom HighlightEventHandler for a GWT wrapper 
for a third party visualization library and I run into some problems 
concerning JSNI and generic types. Let me try to explain.
I want to implement a CustomHighlightHandler for my wrapper. GWT already has 
a HighlightHandler interface which uses a generic type to allow 
customization. So I am going to extends these interfaces to implement my 
custom highlight handler.

The main classes/interfaces look like this:

CustomHighlingtHandler:

public interface CustomHighlightHandler  extends 
HighlightHandlerCustomHighlightEvent{
}

CustomHighlightEvent:

public class CustomHighlightEvent extends HighlightEventMyCustomDTO {
 protected HighlightGeneEvent(MyCustomDTO highlighted) {
super(highlighted);
}
}

So in my wrapper I have to wire the events with my third party visualization 
library. I have to use JSNI to do that and here I run into problems:


I use following JSNI code to wire up the EventHandler:

public final native void sinkNativeEvent(HasHandlers view) /*-{
   var callback_func = function(data) {
var dataDTO = 
@mycustomnamespace.model.MyCustomDTO::new(Ljava/lang/String)(data;
   
@mycustomnamespace.event.CustomHighlightEvent::fire(TS;TV;)(view,dataDTO);
  }
  this.api_addEventHandler(callback_func);
}


So if I use the inherited static fire function from gwt's HighlightEvent the 
compiler complains that the JSNI call has non valid parameters . So it seems 
that Generic types are not supported by JSNI. Is that right?
A workaround for that problem is to define an additional static fire 
function in my CustomHighlightEvent which have non generic types as function 
parameters and use that in the JSNI:

add this function to CustomHighlightEvent:

public static void fire(HasHighlightHandlersMyCustomDTO source,MyCustomDTO 
data)   {
 CustomHighlightEvent event = new CustomHighlightEvent(data);
 source.fireEvent(event);
}

and in the JSNI I can then use following call:

@mycustomnamespace.event.CustomHighlightEvent::fire(Lcom/google/gwt/event/logical/shared/HasHighlightHandlers;Lmycustomnamespace.model.MyCustomDTO;)(view,data);

I am not sure if thats the best workaround or what's the best approach for 
this?

thanks in advance

Uemit

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



Re: JSNI and Generic Types

2011-02-21 Thread Uemit
@Thomas:
Thanks for the quick response.
The Google Plugin for Eclipse actually does suggest/autocomplete to  
@mycustomnamespace.event.CustomHighlightEvent::fire(*TS;TV;*
)(view,dataDTO); 
I assume it does so because I call the static fire method of the 
HighlightEvent class which looks like this:

public static V,S extends 
HasHighlightHandlershttp://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/event/logical/shared/HasHighlightHandlers.htmlV
 
 
HasHandlershttp://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/event/shared/HasHandlers.html
 
void *fire*(S source,V highlighted)

The compiler complains that I have to use valid parameters for JSNI.(haven't 
tried in production mode tough).  
If I change the parameters of the static fire method manually to the actual 
types that I use (*
Lcom/google/gwt/event/logical/shared/HasHighlightHandlers;Lmycustomnamespace.model.MyCustomDTO;
*) GPE marks the line with an error (can't find method *fire *with the 
specific parameters). To be honest I haven't tried to run the code 
regardless of the GPE error. I will try tomorrow and report my findings. 

So if I understand it correctly. 
In JSNI methods I have to replace any references to generic types with the 
actual types. GWT/Java compiler replaced the generics with the coresponding 
types during compile time and because JSNI is basically something like 
compiled code, it doesn't know what to do with the generic types?

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



Re: Deferred Binding, Gin in library/widget ?

2011-02-21 Thread Uemit
Sorry for the thread bump: 

So I was thinking a little bit more about this problem. 

Both GIN and deferred binding respectively allow for customization of the 
widget's datasource during compile time. 
With gin I have a litte bit more flexibility (creating factory, singleton, 
etc)? For my personal taste the nicer/cleaner approach seems to be to use 
deferred binding to configure it. 

Is it actually possible to allow both? Configuration by either deferred 
binding or gin? 
And I still don't know how to solve the problem wiith the non-default 
constructor with either gin or deferred binding. In case of gin I might use 
a Factory but I am not sure if there is not a better approach. 

thanks in advance

Uemit

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



Re: Network visualization with GWT

2011-02-15 Thread Uemit
Apparently somebody wrote a small wrapper for InfoVis: 

https://groups.google.com/forum/#!searchin/javascript-information-visualization-toolkit/GWT/javascript-information-visualization-toolkit/8F3MmHz6-rA/h_a7Thtg07kJ

http://weltermann17.wordpress.com/2009/07/02/jit-gwt-a-low-cost-solution-2/

But as far as I know InfoVis uses canvas so it won't fit the requirements. 
Alternatively you could use Protovis (http://vis.stanford.edu/protovis/) or 
Raphael (http://raphaeljs.com/) but I don't think they provide a GWT 
wrapper. 


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



Re: Network visualization with GWT

2011-02-15 Thread Uemit
@Thomas:

You are right. 
It uses excanvas.js so it should also work with  IE 9.0 versions. 



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



Deferred Binding, Gin in library/widget ?

2011-02-11 Thread Uemit
Hi everyone

I am struggling  a little bit with the concept of deferred binding and/or 
dependency injection in libraries/widgets. 
I try to come up with the best approach for following problem:
I implemented a visualization widget (composite) that takes in some data and 
displays it. 

I want to separate the way the data is retrieved from the actual 
visualization part. So I added a generic interface DataSource which looks 
like this:

public interface DataSource {
public void fetch(int start, int end, boolean getFeatures, 
GeneomeDataSourceCallback callback);  
}

and I add a setter to my Widget:   public void setDataSource(DataSource 
source) { this.source = source}

In oder to support http like datasources I also added an abstract class 
which implements the DataSource Interface and takes an URL in its default 
constructor: 

public abstract class HttpDataSource implements DataSource {

protected String url;

public HttpDataSource(String url) {
   this.url = url;
}
}

My specific DataSouce extends this abstract class and implements the fetch 
method of the interface:

public class MyDataSource extends HttpDataSource {

  public MyDataSource(String url) {
 super(url);
  }
}

This works well. I can create an instance of the MyDataSource class pass it 
to the setter of my widget. 
Now I want to make the widget somewhat configurable. I know that this can be 
done by either Dependency Injection or Deferred Bindings. 

So one approach would be to allow the user of the widget to set the 
DataSource in the Module XML file (similar to the way it is done in the 
gwt-log library: 
http://code.google.com/p/gwt-log/source/browse/trunk/Log/src/com/allen_sauer/gwt/log/gwt-log-impl.gwt.xml
)
replace-with class=MyDataSource
when-type-is class=DataSource /
when-property-is name=source value=MyDataSourceName /
  /replace-with

However I don't know if that is possible because by passing a url into the 
constructor of MyDataSource I have a state and I am not sure how this works 
with deferred binding.
On a side note: would it be possible to have the url also configured in the 
module's XML file?

I am also worried if people who use this widget/library can implement their 
own DataSource and pass it to the widget (doesn't it interfere with the 
deferred binding?) 

I suppose another solution would be using dependency injection in the parent 
application which uses the visualization widget/library ( how can the url be 
passed, etc? I probably have to inject a Factory?)

Which one of these two solutions is better and in general does it make sense 
to use deferred binding or GIN to solve this problem?


thanks in advance

Uemit

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