public class ScrollPanelDemo implements EntryPoint { public void onModuleLoad() { FormPanelExample formPanelExample = new FormPanelExample(); ScrollPanel scrollPanel = new ScrollPanel(formPanelExample); scrollPanel.setSize("500px", "200px"); RootPanel.get().add(scrollPanel); } }
ScrollPanel myScrollPanel = new ScrollPanel(); myScrollPanel.setSize("2112px", "150px"); // Arbitrary width. myScrollPanel.getElement().getStyle().setProperty("width", "100%"); // or "auto"
DockPanel dock = new DockPanel(); dock.setStyleName("cw-DockPanel"); dock.setSpacing(4); dock.setHorizontalAlignment(DockPanel.ALIGN_CENTER); // Add text all around 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); // Add scrollable text in the center HTML contents = new HTML(constants.cwDockPanelCenter()); ScrollPanel scroller = new ScrollPanel(contents); scroller.setSize("400px", "100px"); dock.add(scroller, DockPanel.CENTER);
LayoutPanel lp = new LayoutPanel(); lp.add(whatever1); lp.add(whatever2); lp.setWidgetLeftWidth(whatever1, 0, Unit.PCT, 50, Unit.PCT); lp.setWidgetRightWidth(whatever2, 0, Unit.PCT, 50, Unit.PCT); ScrollPanel scrollPanel = new ScrollPanel(lp); scrollPanel.setSize("200px", "100px"); DecoratorPanel decoratorPanel = new DecoratorPanel(); decoratorPanel.add(scrollPanel); RootPanel.get("gwtContainer").add(decoratorPanel);
/** * @return the widget */ public Widget asWidget() { _bindingConfiguration = DOM.createElement("pre"); //$NON-NLS-1$ Element code = DOM.createElement("code"); //$NON-NLS-1$ code.appendChild(_bindingConfiguration); HTML html = new HTML(); html.getElement().appendChild(code); html.setSize("100%", "100%"); //$NON-NLS-1$ //$NON-NLS-2$ ScrollPanel panel = new ScrollPanel(); panel.setStyleName("fill-layout-width"); //$NON-NLS-1$ panel.add(html); panel.setSize("100%", "100%"); //$NON-NLS-1$ //$NON-NLS-2$ return panel; }
public LayeredAbsoluteStackPanel() { m_stacksPanel.add( m_stackPanel ); m_stacksPanel.setWidth( "100%" ); m_scroll.setWidget( m_stacksPanel ); m_scroll.setSize( "100%", "100%" ); m_backgroundCanvas.setSize( "100%", "100%" ); m_canvas.add( m_backgroundCanvas, 0, 0 ); m_canvas.add( m_scroll, 0, spaceHeight ); m_canvas.setSize( "100%", "100%" ); m_focusPanel.add( m_canvas ); m_focusPanel.addMouseWheelHandler( this ); m_focusPanel.addMouseMoveHandler( this ); m_focusPanel.addKeyUpHandler( this ); m_focusPanel.addStyleName( "AroundPanel" ); m_focusPanel.setSize( "100%", "100%" ); initWidget( m_focusPanel ); }
public LayeredAbsoluteStackPanel() { m_stacksPanel.add( m_stackPanel ); m_stacksPanel.setWidth( "100%" ); m_scroll.setWidget( m_stacksPanel ); m_scroll.setSize( "100%", "100%" ); m_backgroundCanvas.setSize( "100%", "100%" ); m_canvas.add( m_backgroundCanvas, 0, 0 ); m_canvas.add( m_scroll, 0, spaceHeight ); m_canvas.setSize( "100%", "100%" ); m_focusPanel.add( m_canvas ); m_focusPanel.addMouseWheelHandler( this ); m_focusPanel.addMouseMoveHandler( this ); m_focusPanel.addKeyUpHandler( this ); m_focusPanel.addStyleName( "AroundPanel" ); m_focusPanel.setSize( "100%", "100%" ); initWidget( m_focusPanel ); }
listHeight += height; table.setSize(table.getOffsetWidth() + "px", listHeight + "px"); table.setScrollPosition(scrollPosition); DOM.setStyleAttribute(table.getElement(), "maxHeight", "");
documentsTableScroller.setSize("100%", "100%"); documentsTableScroller.setWidget(documentsTable); splitPanel.addNorth(documentsTableScroller, 200); //px