I will try to fix that today (I am planing to make a release on Saturday
with the new Actions API, that has also the disabled MenuItem you asked
for, so I hope to include a fix for that issue too.
If you find something or even a workaround let me know.
Thanks,
George.
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "gwt-mosaic" group.
> To post to this group, send email to gwt-m...@googlegroups.com
> To unsubscribe from this group, send email to
> gwt-mosaic+...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/gwt-mosaic?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
I'm sending below a demo code using GridLayout. Will be very usefull
if I could change to BorderLayout to use the split the panels in all
regions.
Thanks!
import org.gwt.mosaic.ui.client.ToolBar;
import org.gwt.mosaic.ui.client.ToolButton;
import org.gwt.mosaic.ui.client.WindowPanel;
import org.gwt.mosaic.ui.client.layout.BoxLayout;
import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
import org.gwt.mosaic.ui.client.layout.GridLayout;
import org.gwt.mosaic.ui.client.layout.GridLayoutData;
import org.gwt.mosaic.ui.client.layout.LayoutPanel;
import org.gwt.mosaic.ui.client.layout.BoxLayout.Orientation;
import org.gwt.mosaic.ui.client.layout.BoxLayoutData.FillStyle;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.gen2.table.client.FixedWidthFlexTable;
import com.google.gwt.gen2.table.client.FixedWidthGrid;
import com.google.gwt.gen2.table.client.ScrollTable;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class George implements EntryPoint {
/**
* This is the entry point method.
*/
public void onModuleLoad() {
final WindowPanel w = new WindowPanel("WindowPanel");
w.setSize("512px", "384px");
w.setAnimationEnabled(true);
w.setWidget(createContent());
Button b = new Button("Show WindowPanel");
b.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
w.center();
}
});
RootPanel.get().add(b);
}
private Widget createContent() {
final LayoutPanel vbox = new LayoutPanel(new
BoxLayout(Orientation.VERTICAL));
vbox.setPadding(0);
vbox.setWidgetSpacing(0);
final ToolBar toolBar = new ToolBar();
vbox.add(toolBar, new BoxLayoutData(FillStyle.HORIZONTAL));
toolBar.add(new ToolButton("Button 1"));
toolBar.add(new ToolButton("Button 2"));
toolBar.addSeparator();
toolBar.add(new ToolButton("Button 3"));
final LayoutPanel grid = new LayoutPanel(new GridLayout(3, 3));
vbox.add(grid, new BoxLayoutData(FillStyle.BOTH));
grid.add(newScrollTable1(), new GridLayoutData(3, 1, true));
grid.add(newScrollTable1(), new GridLayoutData(1, 2, true));
grid.add(newScrollTable1(), new GridLayoutData(2, 1, true));
grid.add(newScrollTable1(), new GridLayoutData(2, 1, true));
return vbox;
}
private Widget newScrollTable1() {
final FixedWidthFlexTable headerTable = new FixedWidthFlexTable();
final FixedWidthGrid dataTable = new FixedWidthGrid();
final ScrollTable scrollTable = new ScrollTable(dataTable, headerTable);
scrollTable.setCellPadding(3);
scrollTable.setCellSpacing(1);
scrollTable.setResizePolicy(ScrollTable.ResizePolicy.FILL_WIDTH);
headerTable.setText(0, 0, "NAME");
headerTable.setText(0, 1, "VALUE");
// Redraw the scroll table
scrollTable.redraw();
dataTable.resize(0, 2);
// Just adding some trivial data
for (int i = 0; i < 15; i++) {
dataTable.insertRow(i);
dataTable.setHTML(i, 1, "task " + i);
}
return scrollTable;
}
}
try this:
import org.gwt.mosaic.ui.client.ToolBar;
import org.gwt.mosaic.ui.client.ToolButton;
import org.gwt.mosaic.ui.client.WindowPanel;
import org.gwt.mosaic.ui.client.layout.BorderLayout;
import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
import org.gwt.mosaic.ui.client.layout.BoxLayout;
import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
import org.gwt.mosaic.ui.client.layout.LayoutPanel;
import org.gwt.mosaic.ui.client.layout.BorderLayout.Region;
import org.gwt.mosaic.ui.client.layout.BoxLayout.Orientation;
import org.gwt.mosaic.ui.client.layout.BoxLayoutData.FillStyle;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.gen2.table.client.FixedWidthFlexTable;
import com.google.gwt.gen2.table.client.FixedWidthGrid;
import com.google.gwt.gen2.table.client.ScrollTable;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class Main implements EntryPoint {
/**
* This is the entry point method.
*/
public void onModuleLoad() {
final WindowPanel w = new WindowPanel("WindowPanel");
w.setSize("512px", "384px");
w.setAnimationEnabled(true);
w.setWidget(createContent());
Button b = new Button("Show WindowPanel");
b.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
w.center();
}
});
RootPanel.get().add(b);
}
private Widget createContent() {
final LayoutPanel vbox = new LayoutPanel(
new BoxLayout(Orientation.VERTICAL));
vbox.setPadding(0);
vbox.setWidgetSpacing(0);
final ToolBar toolBar = new ToolBar();
vbox.add(toolBar, new BoxLayoutData(FillStyle.HORIZONTAL));
toolBar.add(new ToolButton("Button 1"));
toolBar.add(new ToolButton("Button 2"));
toolBar.addSeparator();
toolBar.add(new ToolButton("Button 3"));
final LayoutPanel b1 = new LayoutPanel(new BorderLayout());
vbox.add(b1, new BoxLayoutData(FillStyle.BOTH));
final LayoutPanel b2 = new LayoutPanel(new BorderLayout());
b2.setPadding(0);
b1.add(newScrollTable1(), new BorderLayoutData(Region.NORTH, .3, 10,
300, true));
b1.add(newScrollTable1(), new BorderLayoutData(Region.WEST, .3, 10,
300, true));
b1.add(b2);
b2.add(newScrollTable1(), new BorderLayoutData(Region.NORTH, .4, 10,
300, true));
b2.add(newScrollTable1(), new BorderLayoutData(true));
return vbox;
}
private Widget newScrollTable1() {
final FixedWidthFlexTable headerTable = new FixedWidthFlexTable();
final FixedWidthGrid dataTable = new FixedWidthGrid();
final ScrollTable scrollTable = new ScrollTable(dataTable, headerTable);
scrollTable.setCellPadding(3);
scrollTable.setCellSpacing(1);
scrollTable.setResizePolicy(ScrollTable.ResizePolicy.FILL_WIDTH);
headerTable.setText(0, 0, "NAME");
headerTable.setText(0, 1, "VALUE");
// Redraw the scroll table
scrollTable.redraw();
dataTable.resize(0, 2);
// Just adding some trivial data
for (int i = 0; i < 15; i++) {
dataTable.insertRow(i);
dataTable.setHTML(i, 1, "task " + i);
}
return scrollTable;
}
}
Kind Regards,
George.
the issue is fixed in SVN:
http://code.google.com/p/gwt-mosaic/source/detail?r=511
Thanks,
George.