CtabFolder and stack layout - swt

I am just wondering is there anyway to use both stack layout and CTabFolder as I have my application built using stack layout and composites and I now want to change it to CTabFolder. how would I do this or can it be done?
Regards,
Ann.

Of course, the tabs can contain Composites with any layout you want. You can't set a layout on CTabFolder itself, because it has its own layout.

Related

How can I create a custom vertical stack scroll for flutter web

I am trying to achieve this vertical stack scroll or vertical stack ListView (if there is a different term used for this kind of scrolls, please share it) for a web app, but I haven't found any package that does anything close to it
Is there some built in widget or a package that can help me achieve this?

Resize the screen in GWT

I am developing a GWT Web application and I would like to include the resize capability into the container. For that, I am implementing a combination of Vertical and Horizontal Panels within a FlowPanel which is resizable. Well, the code for the resize method is the following:
Window.addResizeHandler(new ResizeHandler() {
#Override
public void onResize(ResizeEvent event) {
flowPanel.setHeight(event.getHeight()+"px");
flowPanel.setWidth(event.getWidth()+"px");
}
});
However, when I change the size of the windows, the size of the web elements does not change. Do you know how to implement it?
Thank you very much in advance!!!
You may want to review your layout solution. There are very few cases when you need to use a ResizeHandler. Typically, you can achieve a desired layout either by using a LayoutPanel (or Horizontal/Vertical panels) that automatically resize with the window, or by using CSS. Then your layout will respond well to any changes in a browser window, and you don't need to write any code for that to happen.
EDIT:
In order for a widget to resize automatically, the parent widget must implement ProvidesResize, and the child widget must implement Resizable. FlowPanel does not implement either. Once you use it, the chain of resizing events is broken.
Typically, I use a LayoutPanel for my outmost container. It occupies the entire browser window when added to the RootPanel, and it adjusts with the Window. Vertical and Horizontal panels are similar.
use,
window.getClientWidth();
window.getClientHeight();
Based on your component size you can -/+ px and use.

What is the logic of DockPanel & DockLayoutPanel in GWT? I'm confused

look at this DockPanel http://gwt.googleusercontent.com/samples/Showcase/Showcase.html#!CwDockPanel
& it's code:
dock.add(new HTML(constants.cwDockPanelNorth1()), DockPanel.NORTH);
dock.add(new HTML(constants.cwDockPanelSouth1()), DockPanel.SOUTH);
dock.add(new HTML(constants.cwDockPanelEast()), DockPanel.EAST);
dock.add(new HTML(constants.cwDockPanelWest()), DockPanel.WEST);
dock.add(new HTML(constants.cwDockPanelNorth2()), DockPanel.NORTH);
dock.add(new HTML(constants.cwDockPanelSouth2()), DockPanel.SOUTH);
Is it similar to the BorderLayout in Java? or it is different?
How to set layout using DockLayoutPanel in UiBinder for the below picture:
Why don't they add the Center? I am confused, also how to set docklayout for the above picture in UiBinder?
Diffrences between DockPanel and DockLayouPanel
DockLayoutPanel
A panel that lays its child widgets out "docked" at its outer edges,
and allows its last widget to take up the remaining space in its
center. This widget will only work in standards mode, which requires
that the HTML page in which it is run have an explicit
declaration.
DockPanel
A panel that lays its child widgets out "docked" at its outer edges,
and allows its last widget to take up the remaining space in its
center. This widget has limitations in standards mode that did not
exist in quirks mode. The child Widgets contained within a DockPanel
cannot be sized using percentages. Setting a child widget's height to
100% will NOT cause the child to fill the available height.
If you need to work around these limitations, use DockLayoutPanel
instead, but understand that it is not a drop in replacement for this
class. It requires standards mode, and is most easily used under a
RootLayoutPanel (as opposed to a RootPanel).
DockLayoutPanel is similar to BorderLayout.
To add something in center use add with no params:
dockLayoutPanel.add(widget);
This will take all remaining space.
The center widget should be added last. Otherwise you get an exception.
The Layout you want to create can't be done with just one DockLayoutPanel.

How to put gwt panels and widgets in CellList?

I want to put a complex layout with text-fields and operation buttons for each cell in a CellList. So I want to put a GWT panel to organize the widgets.
Is it possible to put gwt panels and widgets in CellList? I tried to extend AbstractCell and override render(). But seems only HTML can be rendered. I didn't find a way to render normal gwt panels and widgets.
CompositeCell seems going through List> automatically, you can not arrange widget as you wish. Also, I don't know whether normal widgets like PushButton can be used in CompositedCell.
Please give me a sample if you tried this before? Thanks a lot.
It is not possible to put GWT widgets or Panels in a CellWidgets.
CellWidgets are designed for rapid rendering of large amounts of data.
If you don't have that use case you can still use a FlexTable.
Otherwise you have to create a CompositeCell or AbstractCell and implement the render and event handling methods yourself.

GWT DataGrid automatic height

I'm trying to insert a gwt datagrid in my application. If i set a static height (500px) everything works nice. But i want to make the dataGrid auto adjust to screen size. With height 100% i get a blank screen.
i've also tried to put the datagrid into a resizeLayoutPanel with the same results.
any tips?
All RequiresResize widgets should be given an explicit size, or be added to ProvidesResize widgets (up to a RootLayoutPanel or a ProvidesResize widget with an explicit size; the only exception is ResizeLayoutPanel which doesn't implement ProvidesResize because it couldn't honor the contract for its header and footer widgets, but it definitely honors it for the center widget).
So the question is: where did you add your DataGrid and/or ResizeLayoutPanel?
Thomas Broyer is correct. Nonetheless I found something of interest concerning the DataGrid (it does not happen in CellTable).
If you are using a DeckPanel and if you are creating the DataGrid on a hidden Panel of this DeckPanel, than the data of the DataGrid will not be visible if you show the panel of the DataGrid.
I found only one workaround: call addDataDisplay of your DataProvider "after" the panel was made visible.