JMockit compatible with GWTTestCase?

2012-12-28 Thread James Scott
Hello all-

I'm trying to use JMockit in a GWTTestCase (JUnit 3, for what it's worth) 
and I'm not having any luck. I have jmockit.jar on my classpath for the 
test, but when I run it, I get this error message:

[ERROR] Line 50: No source code is available for type 
mockit.NonStrictExpectations; did you forget to inherit a required module?

Line 50 is where I have my NonStrictExpectations declared in my test case. 
Right now, it's empty.

I tried TRACE-level logging of the unit test run in Eclipse, and I get 
similar "no source code available" errors for other classes in the 
application GWT client code, but those are not under test and not in the 
same module as the code under test, so I don't think those are interfering.

My classpath includes my Eclipse output dir, GWT jars, jmockit.jar and 
junit.jar. Is there something else that should be in the classpath?

Thanks,

JLS

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



Remediating older GWT code with GWT 2.3 XsrfProtectedService - any experiences?

2012-11-28 Thread James Scott
Hi all-

We're looking at remediating an existing GWT application with the CSRF/XSRF 
protection features introduced with GWT 2.3. Has anybody else done this, 
and do you have any experiences/advice to share? I'm looking particularly 
for testing advice. How did you validate that the XSRF protection is 
working?

Thanks,

JLS

-- 
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/-/g2E9z219I5wJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: TabLayoutPanel inside HeaderPanel - tab body doesn't show

2012-01-15 Thread James Scott
Wrapping the TabLayoutPanel in a ResizeLayoutPanel, and then adding
the RLP as the content widget of the HeaderPanel, resulted in nothing
rendering in the content area.

Here's my test code for my original case - I'm adding the HeaderPanel
directly to the RootLayoutPanel.

public class TestHeaderEntryPoint implements EntryPoint {

@Override
public void onModuleLoad() {
HeaderPanel hp = new HeaderPanel();
TabLayoutPanel tp = new TabLayoutPanel(3, Unit.EM);
tp.add(new Label("This is tab 1"), "tab 1");
tp.add(new Label("This is tab 2"), "tab 2");
hp.setHeaderWidget(new Label("this is the header"));
hp.setContentWidget(tp);
hp.setFooterWidget(new Label("this is the footer"));
RootLayoutPanel.get().add(hp);
}
}

When I set a breakpoint in HeaderPanel.forceLayout I see that
remainingHeight is > 0 and (content instanceof RequiresResize) is
true, so I see content.onResize() get called...the tabs display, but
the tab body doesn't.

Possibly interesting aside: When I declared the HeaderPanel and
TabLayoutPanel in a UiBinder .ui.xml, I saw that content ended up as
type FlowPanel, so HeaderPanel.forceLayout didn't call
content.onResize(). But the effect was the same - tabs display, but
tab bodies don't.


JLS

On Jan 15, 5:45 am, Thomas Broyer  wrote:
> I've read a few times people complaining about HeaderPanel. Have you tried
> putting a ResizeLayoutPanel between the HeaderPanel and your
> TabLayoutPanel? It shouldn't be necessary, but there might be a bug in
> HeaderPanel.
>
> Also, out of curiosity, is your HeaderPanel in a ProvidesResize widget? (up
> to a RootLayoutPanel or a panel with an explicit size in pixels)

-- 
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: TabLayoutPanel inside HeaderPanel - tab body doesn't show

2012-01-14 Thread James Scott
I've applied the patch from the code review referenced in comment 3 on
issue 7065, and it didn't fix the bug. I verified that the
DeckLayoutPanel.onLoad() method implementation added by the patch gets
called, but the tab body is still not rendered when the TabLayoutPanel
is contained in a HeaderPanel.

Even worse, applying the full patch from 
http://gwt-code-reviews.appspot.com/1601804/
(which also changes Layout/LayoutImpl/LayoutImplIE6) causes IE7 to
render a blank page - using dev tools to inspect the DOM shows that
the elements are there but with size 0x0.

I very well might be doing something wrong (this is my first time
building GWT from source) but it doesn't look like the patch addresses
the issue.

JLS


On Jan 4, 5:14 am, Thomas Broyer  wrote:
> Seehttp://code.google.com/p/google-web-toolkit/issues/detail?id=7065

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



TabLayoutPanel inside HeaderPanel - tab body doesn't show

2012-01-03 Thread James Scott
I'm updating a module originally done in GWT 1.7 to GWT 2.4, and I'm
having a problem with a TabLayoutPanel inside a HeaderPanel. When I
add the TabLayoutPanel to the content area of the HeaderPanel, the tab
content does not appear. Inspecting the HTML shows that the tab
content divs have 0 height.

I think this is a bug, and that's a serious bummer. HeaderPanel sounds
like exactly what we need to replace the Rube Goldberg resize listener
stuff we had to do in a composite using the old widgets.
DockLayoutPanel appears to work OK with TabPanel, but isn't suitable
for this application because we have some resizable elements in the
header area. HeaderPanel handles those just fine...but the main
content of the page doesn't display due to this apparent problem with
TabLayoutPanel.

Am I missing something?

JLS

-- 
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.4 - problems with space key handling and FieldUpdater for TextInputCell inside CompositeCell in CellTree

2011-12-29 Thread James Scott
Looks like it boils down to events. After looking at the TextInputCell
and AbstractInputCell source, I added "focus" and "change" events to
the list of events consumed by the CompositeCell, and that addressed
both issues.

Incidentally, I tried out the EditTextCell in the CompositeCell, and
to get that working, I needed to add "keyup" and "keydown" events to
the CompositeCell.

Clearly I do not yet have my mind wrapped around how the events are
propagated in a CompositeCell, but at least I've solved my immediate
problems.

JLS

On Dec 28, 3:49 pm, James Scott  wrote:
> Hi all-
>
> I feel like I'm missing something obvious here, but I haven't been
> able to figure this out. In short, I have a CellTree whose leaf nodes
> are populated with CompositeCells. Each CompositeCell has an
> ImageResourceCell, a TextCell, and a TextInputCell. These are
> displaying in the tree correctly. I have attached an onClick event to
> the ImageResourceCell that deletes the item from the tree, and that
> works as expected. The intent for the TextInputCell is to display a
> field from the entity associated with the cell, and update the field
> on the entity when the user changes the value in the TextInputCell.
>
> However, I'm having a couple of problems with the TextInputCell.
> First, when I type in the TextInputCell, the space key is ignored -
> well, it's probably being consumed by something else but the upshot is
> that when I type a space character, it doesn't appear in the
> TextInputCell. I thought this might have to do with the SelectionModel
> or KeyboardSelectionPolicy on the CellTree, but I've set the tree to
> KeyboardSelectionPolicy.DISABLED and the TreeViewModel to
> NoSelectionModel and it's still happening.[snip]

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



GWT 2.4 - problems with space key handling and FieldUpdater for TextInputCell inside CompositeCell in CellTree

2011-12-28 Thread James Scott
Hi all-

I feel like I'm missing something obvious here, but I haven't been
able to figure this out. In short, I have a CellTree whose leaf nodes
are populated with CompositeCells. Each CompositeCell has an
ImageResourceCell, a TextCell, and a TextInputCell. These are
displaying in the tree correctly. I have attached an onClick event to
the ImageResourceCell that deletes the item from the tree, and that
works as expected. The intent for the TextInputCell is to display a
field from the entity associated with the cell, and update the field
on the entity when the user changes the value in the TextInputCell.

However, I'm having a couple of problems with the TextInputCell.
First, when I type in the TextInputCell, the space key is ignored -
well, it's probably being consumed by something else but the upshot is
that when I type a space character, it doesn't appear in the
TextInputCell. I thought this might have to do with the SelectionModel
or KeyboardSelectionPolicy on the CellTree, but I've set the tree to
KeyboardSelectionPolicy.DISABLED and the TreeViewModel to
NoSelectionModel and it's still happening.

Furthermore, the up, down and right arrow keys are also ignored, but
the left arrow key causes the CellTree to disappear entirely.

Curiously, if I override the onBrowserEvent in the TextInputCell to
show a Window.alert, the space character DOES make its way into the
TextInputCell, but the alert doesn't affect what happens on arrow key.

Second - the point of having the TextInputCell there is that I want to
update the entity object associated with that tree node. In the
HasCell that describes the TextInputCell, I overrode getFieldUpdater
to return a reference to the object that should do the updating, but
its update method apparently never gets called. Do I need to do
something in the CompositeCell's or TextInputCell's onBrowserEvent to
invoke the update myself?

Code below - sorry for the length.

JLS

//construct composite cell for code descriptions
List> descripHasCells = new
ArrayList>();
descripHasCells.add(new HasCell() {

private ImageResourceCell cell = new 
ImageResourceCell();

public Cell getCell() {
return cell;
}

public FieldUpdater 
getFieldUpdater() {
return null;
}

public ImageResource getValue(CcdDTO object) {
return pImages.delete();
}
});

descripHasCells.add(new HasCell() {
private TextCell cell = new TextCell();

@Override
public Cell getCell() {
return cell;
}

@Override
public FieldUpdater 
getFieldUpdater() {
return null;
}

@Override
public String getValue(CcdDTO value) {
if (value instanceof CcdGroupDTO) {
return ((CcdGroupDTO)value).getGroupName();
} else {
return "All";
}
}
});

descripHasCells.add(new HasCell() {
private TextInputCell cell = new TextInputCell() {
@Override
public Set getConsumedEvents() {
HashSet events = new 
HashSet();
events.add("click");
events.add("keydown");
return events;
}

// uncomment this and the space key appears in 
the text input,
after the alert
//  public void onBrowserEvent(Context context, 
Element elem,
String value, NativeEvent event, ValueUpdater arg4) {
//  Window.alert("text input event:" + 
event.getType());
//  };
};

@Override
public Cell getCell() {
return cell;
}

@Override
public FieldUpdater 
getFieldUpdater() {
 

Re: OPTGROUP

2008-10-22 Thread James Scott

On Aug 28, 3:15 am, Karl <[EMAIL PROTECTED]> wrote:
> How can i create aoptgroupinside a combobox?

ListBox does not have an optgroup API, so you need to get the select
element from your ListBox and use the DOM API to add the optgroup.

Something like this:
List options = new ArrayList();
//omitted: fill options with the strings you want to see
in the select list
ListBox lb = new ListBox();
SelectElement select = lb.getElement().cast();
OptGroupElement groupElement =
Document.get().createOptGroupElement();
groupElement.setLabel("My group");

for (String option : options) {
OptionElement optElement =
Document.get().createOptionElement();
//setText results in blank options in IE6/7, use
setInnerText
optElement.setInnerText(option.getName());
groupElement.appendChild(optElement);
}

select.appendChild(groupElement);

Hope that helps,

James

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---