Re: Right Click Cell Table

2011-12-09 Thread John Maitland
Thanks, all works! I already have a custom
DefaultSelectionEventManager for double clicking. I had to override
handleMultiSelectionEvent as it only works for click and keyup
explicitly. A single selection model would work as is.

-- 
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: Right Click Cell Table

2011-12-09 Thread John Maitland
So put the contextmenu event on the cell itself rather than sinking an
event on the celltable?

John

On Dec 9, 11:18 am, Thomas Broyer  wrote:
> I think you need a CellPreviewEvent.Handler (have a look at
> DefaultEventSelectionManager) so that a "contextmenu" event turns into a
> SelectAction.SELECT or SelectAction.TOGGLE (depending on whether the Ctrl
> or Meta key is down). The current code should correctly change selection on
> a "click" event, whichever the button (left, right or middle).
> Or maybe your cell is handling selection itself? (isSelectionHandled
> returns true)

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



Right Click Cell Table

2011-12-09 Thread John Maitland
Is it possible that on right click, that the cell is also selected?

If I sink ONCONTEXTMENU, it will provide a context menu event, which
won't render the cell selected. For the cell to be selected, I need a
click event from the cell itself.

Many thanks,

John

-- 
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: Adding Buttons to DialogBox

2011-11-28 Thread John Maitland
Thanks Vid, I've simplified the above code for this post and have
multiple buttons. But looking into what setWidget on the
DecoratorPanel, I realised that I need to override the following:

@Override
protected void doAttachChildren() {
try {
super.doAttachChildren();
} finally {
// See comment in doDetachChildren for an explanation of
this call
okButton.asWidget().onAttach();
}
}

@Override
protected void doDetachChildren() {
try {
super.doDetachChildren();
} finally {
/*
* We need to detach the caption specifically because it is
not part of
* the iterator of Widgets that the {@link SimplePanel}
super class
* returns. This is similar to a {@link ComplexPanel}, but
we do not want
* to expose the caption widget, as its just an internal
implementation.
*/
okButton.asWidget().onDetach();
}
}

Thanks,

John

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



Adding Buttons to DialogBox

2011-11-25 Thread John Maitland
Could anyone suggest why the Click Event doesn't fire in the following
example code?

Many thanks

John

public class OKDialog extends DialogBox {

public OKDialog() {

Button okButton = new Button("OK");

//add a button in dialogBottomCenterInner div
Element bottomMiddle = getCellElement(2, 1);

okButton.removeFromParent();
remove(okButton);

// Add the buttons to the top row of the decorator panel. We
need to
// logically adopt the caption so we can catch click events.
DOM.appendChild(bottomMiddle,
okButton.asWidget().getElement());
adopt(okButton.asWidget());

okButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
GWT.log("Clicked!");
}
});
   }
}

-- 
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: RequestContext Overhead

2011-08-31 Thread John Maitland
I agree that it looks like the overhead is per-requestcontext. This is
also reflected in the size of the abstract request factory vs the
abstract request context.

-- 
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 help with parallel build (ant)

2011-08-30 Thread John Maitland
Have a look at local workers flag, it will compile the permutations in
parallel:

http://code.google.com/webtoolkit/doc/latest/DevGuideCompilingAndDebugging.html#DevGuideCompilerOptions

John

-- 
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: RequestContext Overhead

2011-08-30 Thread John Maitland
Thanks Thomas. And the code sharing between request contexts is done
at the RequestFactory level or between request factories. For example,
if I have a entity proxy that is used on multiple request factories
would that be shared? This is important if you wanted to code split an
entire request factory compared to passing a reference from the
initial fragment (i.e. one giant request factory, lots of request
contexts vs lots of request factories with one contexts).

John

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



RequestContext Overhead

2011-08-30 Thread John Maitland
Is there a overhead to having multiple RequestContexts inside a
RequestFactory? I know with RPC, there was a overhead of having
multiple async services.

John

-- 
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: Drop file from the OS into a GWT application

2011-06-27 Thread John Maitland
Have a look at this session from Google I/O 2011 on HTML 5:

http://www.google.com/events/io/2011/sessions/html5-showcase-for-web-developers-the-wow-and-the-how.html

I'm not sure if this has native supported in GWT, but if not look at
JSNI.

John

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



Grid Cell Widget Possible?

2011-06-27 Thread John Maitland
Does anyone have any ideas of how to create a cell based grid, i.e. a
layout similar to the Grid widget?

Many Thanks,

John

-- 
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: SimpleBeanEditorDriver and MVP

2011-03-06 Thread John Maitland
The driver is auto generated by the GWT compiler and therefore should
belong in the view. Any code that call GWT.create should really belong
in the view or your presenter will have to use the slow GWTTestCase.

-- 
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: SimpleBeanEditorDriver and MVP

2011-03-03 Thread John Maitland
As Jeff said, I would put it in the view. You might want to look at
the following Issue in how to structure your View interface to access
your editor driver in the presenter.

John

http://code.google.com/p/google-web-toolkit/issues/detail?id=5727&can=1&q=editor&sort=-id&colspec=ID%20Type%20Status%20Owner%20Milestone%20Summary%20Stars

-- 
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: Split points for method having return type other than void

2011-02-22 Thread John Maitland
You could also use a 'proxy' version of the return type.

-- 
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 2.2 / RequestFactory - Can domain objects be interfaces as opposed to concrete classes?

2011-02-20 Thread John Maitland
I would personal like to see a layer that considered base types,
beyond Object of the concrete type. However it seems that Entity
should really just be simple POJOs, even if the interface is just
exposing getter and setters. Maybe someone from the GWT team will have
some inspiration on this subject for a future release.

-- 
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 2.2 / RequestFactory - Can domain objects be interfaces as opposed to concrete classes?

2011-02-18 Thread John Maitland
I had the same problem and managed to implement a new
ServiceLayerDecorator. See..

http://groups.google.com/group/google-web-toolkit/browse_thread/thread/36d0ed4f87be/45af985914ac1780?lnk=gst&q=maitland#45af985914ac1780

Regards,

John

-- 
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: EntityProxy for an interface

2011-01-15 Thread John Maitland
Thanks for the advise. After using getTop().resolveClientType this
open up further compilications, not least a circular dependency in the
layers. However, the next problem was intergrating this with a custom
Locator, which resolves the domain class with the BaseProxy and not
the actual proxy for the domain class (therefore above code doesnt
work with BaseProxy). Therefore I put in a further cache map the
ProxyFor class to the client class.

Problem solved!

-- 
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: EntityProxy for an interface

2011-01-09 Thread John Maitland
Frustratingly, as I know I'm so close, all my entities (both the
implementation and the interface) only contain getter and setter
(simple POJO for use in Hibernate). All my data access methods
currently reside in the entity service, as recommended. Now in the
entity service, I could do a horrible cast from the interface back to
its implementation and send that back to the client. However I have a
custom ServiceLayerDecorator, to use Spring to create my Locators (for
the find method), and hence I can override the following...

@Override
public  Class resolveClientType(Class
domainClass, Class clientType, boolean required) {
ProxyFor a = clientType.getAnnotation(ProxyFor.class);

if (a != null && a.value().isAssignableFrom(domainClass)) {
return super.resolveClientType(a.value(), clientType,
required);
}
return super.resolveClientType(domainClass, clientType,
required);
}

Do you see any problems with this approach? It works for the above
example.

John

P.S. Also using a ServiceLocator to intergrate with Spring. Spring and
GWT play nicely together now.

-- 
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-tool...@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: EntityProxy for an interface

2011-01-08 Thread John Maitland
David,
Thank you for the reply. I already have a Locator and a
ServiceLocator, but left it out of the above example for simplicity.
After reading the source, all the entity proxies map to classes and
not interfaces. Hence, if your AppUser class was defined as an
interface and a implementation:

public interface AppUser extends DatastoreObject {
String getEmail()
void setEmail(String email)
}

public class AppUserImpl extends DatastoreObjectImpl implements
AppUser {

}

@ProxyFor(value=AppUser.class, locator=ObjectifyLocator.class)
public interface AppUserProxy extends DatastoreObjectProxy {
String getEmail();
}

Then I don’t think this arrangement would currently work because of
the getSupertypes in the RequestFactoryInterfaceValidator class.
Therefore, by ‘must reference the Entity itself’ you mean an
implementation (the type of the actual object from the service) and
it’s not possible to supply an interface in the @ProxyFor?

John

p.s. I ask because my implementations are in a separate data access
layer and are only exposes through its interfaces, called by my
services.

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



EntityProxy for an interface

2011-01-07 Thread John Maitland
I’m having a problem using the new RequestFactory feature in 2.1.1
when trying to serialise an object, using the EntityProxy, with using
it's interface. If I have the following entity proxy, entity interface
and its implementation, a ‘UnexpectedException: The domain type
com.server.MyEntity cannot be sent to the client’.

@ProxyFor(value = MyEntity.class)
public interface MyEntityProxy extends EntityProxy {
String getAProperty();
}

public class MyEntityImpl implements MyEntity {

}

public interface MyEntity {
   String getAProperty();
}

This doesn’t work, because the getSupertypes method in the
RequestFactoryInterfaceValidator return a list of the following types:
   - Lcom/server/MyEntityImpl
   - Ljava/lang/Object;
   - Lcom/server/MyEntity

And getEntityProxyTypeName in RequestFactoryInterfaceValidator breaks
from the supertypes upcast loop if an object type is found before the
required type defined on the entityproxy (i.e. never reaches my
interface).

If I change the value of the ProxyFor from the interface to its
implementation then it works (i.e. @ProxyFor(MyEntityImpl.class),
which is not desirable.

Does anyone know if this is possible or a limitation?

Regards,
John

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



Create Namespace Aware XML Elements on client

2010-10-11 Thread John Maitland
I'm trying to create XML document on the client, which is namespace
aware, but on Firefox any namespace attributes are not included in the
element. I believe firefox requires the new nodes to be created by
calling createElementNS, but this is not present at
XMLParserImpl.java. Has anyone else seen this, is it possible, or is
this a bug/oversight? Can this be archived by changing the doctype for
the page?

Any help would be greatly appreciated.

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