《gwt各个panal中英简介()》由会员分享,可在线阅读,更多相关《gwt各个panal中英简介()(21页珍藏版)》请在金锄头文库上搜索。
1、Class AbsolutePanelpublic class AbsolutePanelextends ComplexPanelimplements InsertPanel.ForIsWidgetAn absolute panel positions all of its children absolutely, allowing them to overlap.绝对绝对面板位置所有的子控件,使他们能够重叠。Note that this panel will not automatically resize itself to allow enough room for its absolu
2、tely-positioned children.注意,这个面板不会自动调整本身允许足够的空间为其absolutely-positioned子控件。It must be explicitly sized in order to make room for them.必须明确大小,以腾出空间。Once a widget has been added to an absolute panel, the panel effectively owns the positioning of the widget.一旦一个小部件添加到一个绝对的面板,面板有效“拥有” 小部件的定位。Any existing
3、 positioning attributes on the widget may be modified by the panel.任何现有的部件定位属性可以修改面板。Class FlexTablepublic class FlexTableextends HTMLTableA flexible table that creates cells on demand.一个灵活的表上创建细胞的需求。It can be jagged (that is, each row can contain a different number of cells) and individual cells ca
4、n be set to span multiple rows or columns.它可以是锯齿状(即每一行可以包含不同数量的细胞 )和单个细胞可以跨越多个行或列。Examplepublic class FlexTableExample implements EntryPoint public void onModuleLoad() / Tables have no explicit size - they resize automatically on demand.FlexTable t = new FlexTable();/ Put some text at the tables ext
5、remes. This forces the table to be/ 3 by 3.t.setText(0, 0, upper-left corner); t.setText(2, 2, bottom-right corner);/ Lets put a button in the middle.t.setWidget(1, 0, new Button(Wide Button);/ .and set its column span so that it takes up the whole row.t.getFlexCellFormatter().setColSpan(1, 0, 3);Ro
6、otPanel.get().add(t);Class FlowPanelpublic class FlowPanelextends ComplexPanelimplements InsertPanel.ForIsWidgetA panel that formats its child widgets using the default HTML layout behavior.面板格式子部件使用默认的HTML布局的行为。Class HorizontalPanelpublic class HorizontalPanelextends CellPanelimplements HasAlignmen
7、t, InsertPanel.ForIsWidgetA panel that lays all of its widgets out in a single horizontal column.一个面板,将所有的部件在一个水平列。Class VerticalPanelpublic class VerticalPanelextends CellPanelimplements HasAlignment, InsertPanel.ForIsWidgetA panel that lays all of its widgets out in a single vertical column.一个面板,将
8、所有的部件在一个垂直列。Class Gridpublic class Gridextends HTMLTableA rectangular grid that can contain text, html, or a child Widget within its cells.一个矩形网格,可以包含文本、html或子小部件在其细胞。It must be resized explicitly to the desired number of rows and columns.它必须显式地调整所需的行和列的数量。Examplepublic class GridExample implements
9、EntryPoint public void onModuleLoad() / Grids must be sized explicitly, though they can be resized later.Grid g = new Grid(5, 5);/ Put some values in the grid cells.for (int row = 0; row declaration.这个小部件将只在标准模式下工作,要求运行的HTML页面有一个明确的声明。Class DockPanelpublic class DockPanelextends CellPanelimplements
10、HasAlignmentA 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 Wi
11、dgets contained within a DockPanel cannot be sized using percentages.子控件小部件包含在一个DockPanel不能使用百分比大小。Setting a child widgets height to 100% will NOT cause the child to fill the available height.设定一个子控件小部件的身高100%不会导致子控件来填补可用的高度。If you need to work around these limitations, use DockLayoutPanel instead,
12、but understand that it is not a drop in replacement for this class.相反,如果你需要绕过这些限制,使用DockLayoutPanel,但是明白 ,这不是一个替代这个类。It requires standards mode, and is most easily used under a RootLayoutPanel (as opposed to a RootPanel).它需要标准模式,最容易使用RootLayoutPanel下(而不是RootPanel)。See Also:DockLayoutPanelClass DockL
13、ayoutPanelpublic class DockLayoutPanelextends ComplexPanelimplements AnimatedLayout, RequiresResize, ProvidesResizeA 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
14、will only work in standards mode, which requires that the HTML page in which it is run have an explicit declaration.这个小部件将只在标准模式下工作,要求运行的HTML页面有一个明确的声明。Examplepublic class DockLayoutPanelExample implements EntryPoint public void onModuleLoad() / Attach five widgets to a DockLayoutPanel, one in each
15、direction. Lay/ them out in em units.DockLayoutPanel p = new DockLayoutPanel(Unit.EM);p.addNorth(new HTML(north), 2);p.addSouth(new HTML(south), 2);p.addEast(new HTML(east), 2);p.addWest(new HTML(west), 2);p.add(new HTML(center); / Attach the LayoutPanel to the RootLayoutPanel. The latter will liste
16、n for/ resize events on the window to ensure that its children are informed of/ possible size changes.RootLayoutPanel rp = RootLayoutPanel.get();rp.add(p);Class HTMLPanelpublic class HTMLPanelextends ComplexPanelA panel that contains HTML, and which can attach child widgets to identified elements within that HTML.一个面板,其中包含HTML, 可以附加子部件发现了在 HTML的元素。Class DeckPanelpublic class DeckPanelextends Comp