Examples of DockPanel


Examples of com.google.gwt.user.client.ui.DockPanel

public class ContactDialog extends SimpleDialog {

    public ContactDialog(Contact contact) {
        super("Edit contact: " + contact.getName().getFullName(), "Close");

        DockPanel panel = new DockPanel();
        panel.add(contact.getImage(), DockPanel.WEST);

        FlexTable table = new FlexTable();
        panel.add(table, DockPanel.CENTER);

        Label label = new Label("First name: ");
        label.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
        table.setWidget(0, 0, label);
        table.setWidget(0, 1, new ActiveTextBox(contact, "name.firstName", new DefaultErrorMessageCallback()));
View Full Code Here

Examples of com.google.gwt.user.client.ui.DockPanel

        mailList.setWidth("100%");
        mailDetail.setWidth("100%");

        // Create a dock panel that will contain the menu bar at the top,
        // the shortcuts to the left, and the mail list & details taking the rest.
        DockPanel outer = new DockPanel();
        outer.add(topPanel, DockPanel.NORTH);
        outer.add(shortcuts, DockPanel.WEST);
        outer.add(rightPanel, DockPanel.CENTER);
        outer.setWidth("100%");

        outer.setSpacing(4);
        outer.setCellWidth(rightPanel, "100%");

        // Hook the window resize event, so that we can adjust the UI.
        Window.addWindowResizeListener(this);

        // Get rid of scrollbars, and clear out the window's built-in margin,
View Full Code Here

Examples of com.google.gwt.user.client.ui.DockPanel

     * Constructs a new CenterPanel with a given widget to wrap.
     *
     * @param content The widget this panel should wrap.
     */
    public CenterPanel(Widget content) {
        container = new DockPanel();
        if (content != null) {
            setContent(content);
        }
        initWidget(container);
    }
View Full Code Here

Examples of com.google.gwt.user.client.ui.DockPanel

    private final Label message;
    private MessageBox() {
        super(false, true);
        setAnimationEnabled(true);
       
        DockPanel panel = new DockPanel();
        panel.setStyleName("messageBox");
        panel.setHorizontalAlignment(DockPanel.ALIGN_CENTER);

        header = new HTML();
        header.addStyleName("messageBox-caption");
       
        Button close = new Button("OK");
        close.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                hide();
            }
        });
        close.setEnabled(true);
        close.setFocus(true);
       
        message  = new Label();
        message.addStyleName("messageBox-content");
       
        panel.add(header, DockPanel.NORTH);
        panel.add(close, DockPanel.SOUTH);
        panel.add(message, DockPanel.CENTER);
       
        setWidget(panel);
    }
View Full Code Here

Examples of com.google.gwt.user.client.ui.DockPanel

    public MatchWindow(final OpenTrader session, final Tradable tradable, final List<Match> matches) {
        super(false, true);
        this.session = session;
        setAnimationEnabled(true);
       
        DockPanel panel = new DockPanel();
        panel.setHorizontalAlignment(DockPanel.ALIGN_CENTER);

        final HTML header = new HTML();
        final boolean ask = (tradable instanceof Ask);
        String txt = (matches.isEmpty() ? "No" : ""+matches.size()) + " matching "+ (ask ? "Bid" : "Ask") + " for "
                   + toString(tradable) + "<br>";
        header.setHTML(txt);
        header.addStyleName("table-caption");
       
        Button close = new Button(matches.isEmpty() ? "OK" : "Cancel");
        close.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                hide();
            }
        });

        FlexTable body = new FlexTable();
        final RadioButton[] buttons = new RadioButton[matches.size()];
        if (!matches.isEmpty()) {
            for (int i = 0;  i < matches.size(); i++) {
                Match match = matches.get(i);
                Tradable t2 = ask ? match.getBid() : match.getAsk();
                Trader cpty = ask ? match.getBid().getBuyer() : match.getAsk().getSeller();
                buttons[i] = new RadioButton("matches");
                buttons[i].setValue(i == 0);
                body.setWidget(i, 0, buttons[i]);
                body.setWidget(i, 1, FormatUtil.formatPrice(t2.getPrice()));
                body.setWidget(i, 2, FormatUtil.formatVolume(t2.getVolume()));
                body.setText(i, 3, " by " + cpty.getName());
            }
           
            Button act = new Button(ask ? "Sell" : "Buy");
            act.setFocus(true);
            body.setWidget(matches.size()+1, 1, act);
            act.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event) {
                    for (int i = 0; i < buttons.length; i++) {
                        if (buttons[i].getValue()) {
                            Match match = matches.get(i);
                            Tradable t = ask ? match.getAsk() : match.getBid();
                            session.getService().trade(match, new TradeCallback(t));
                            hide(true);
                        }
                    }
                }
            });
            body.setWidget(matches.size()+1, 2, close);
        } else {
            body.setWidget(0,0, new HTML("<p>Open a new browser page and login with a different Trader name<br>"
                    + "to create a matching " + (ask ? "Bid" : "Ask") + "<p>"));
           
            close.setFocus(true);
            body.setWidget(1, 0, close);
            body.getFlexCellFormatter().setAlignment(1,0,
                    HasHorizontalAlignment.ALIGN_CENTER,
                    HasVerticalAlignment.ALIGN_MIDDLE);
        }
       
       
        panel.add(header, DockPanel.NORTH);
        panel.add(body, DockPanel.CENTER);
        setWidget(panel);
    }
View Full Code Here

Examples of com.google.gwt.user.client.ui.DockPanel

public class SoftScrollAreaExample extends BoundVerticalPanel<Object>{

  public SoftScrollAreaExample(){
    super(new BoundWidgetTypeFactory(), null);
    DockPanel scroll = new DockPanel();

        final SoftScrollArea ssp = new SoftScrollArea();
        scroll.add(ssp, DockPanel.CENTER);
        ssp.setWidth("500px");
        ssp.setHeight("500px");
        VerticalPanel vp = new VerticalPanel();
        vp.add(new Image(GWT.getModuleBaseURL() + "crested_butte.jpg"));

        final Button visible = new Button("ensure visible test");
        vp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
        vp.add(visible);

        vp.add(new Image(GWT.getModuleBaseURL() + "crested_butte.jpg"));
        vp.add(new Image(GWT.getModuleBaseURL() + "crested_butte.jpg"));
        vp.add(new Image(GWT.getModuleBaseURL() + "crested_butte.jpg"));

        ssp.setWidget(vp);

        SoftScrollbar bar = new SoftAnimatedScrollbar(ssp);
        //bar.setLowerWidget( new Image( GWT.getModuleBaseURL()+"gwtip.png") );
        //bar.setHigherWidget( new Image( GWT.getModuleBaseURL()+"gwtip.png") );
        //bar.setBarWidget( new Image( GWT.getModuleBaseURL()+"crested_butte.jpg") );
        bar.setHeight("400px");

        VerticalPanel control = new VerticalPanel();
        Button pageDown = new Button("down",
                new ClickListener() {
                    public void onClick(Widget sender) {
                        ssp.pageDownAnimated();
                    }
                });
        pageDown.setSize("50px", "50px");

        Button pageUp = new Button("up",
                new ClickListener() {
                    public void onClick(Widget sender) {
                        ssp.pageUpAnimated();
                    }
                });
        pageUp.setSize("50px", "50px");
        control.add(pageUp);
        control.add(bar);
        control.add(pageDown);
        scroll.add(control, DockPanel.EAST);

        HorizontalPanel hcontrol = new HorizontalPanel();
        SoftHorizontalScrollbar hbar = new SoftAnimatedHorizontalScrollbar(ssp);
        hbar.setWidth("400px");

        //hbar.setLowerWidget( new Image( GWT.getModuleBaseURL()+"gwtip.png") );
        //hbar.setHigherWidget( new Image( GWT.getModuleBaseURL()+"gwtip.png") );
        //hbar.setBarWidget( new Image( GWT.getModuleBaseURL()+"crested_butte.jpg") );
        Button pageLeft = new Button("<<",
                new ClickListener() {
                    public void onClick(Widget sender) {
                        ssp.pageLeftAnimated();
                    }
                });
        pageLeft.setSize("50px", "50px");

        Button pageRight = new Button(">>",
                new ClickListener() {
                    public void onClick(Widget sender) {
                        ssp.pageRightAnimated();
                    }
                });
        pageRight.setSize("50px", "50px");
        hcontrol.add(pageLeft);
        hcontrol.add(hbar);
        hcontrol.add(pageRight);
        scroll.add(hcontrol, DockPanel.SOUTH);

        Button checkEnsure = new Button("checkEnsure",
                new ClickListener() {
                    public void onClick(Widget sender) {
                        ssp.ensureVisibleAnimated(visible);
View Full Code Here

Examples of com.google.gwt.user.client.ui.DockPanel

    toolbar.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
    toolbar.setSpacing(0);
    toolbar.setBorderWidth(0);
    toolbar.setStyleName(TOOLBAR_STYLE_NAME);
   
    title = new DockPanel();
    title.setStyleName(TITLE_STYLE_NAME);
    title.add(titleLabel, DockPanel.CENTER);
    title.setCellVerticalAlignment(titleLabel, DockPanel.ALIGN_MIDDLE);
    title.setCellWidth(titleLabel, "100%");
    title.add(toolbar, DockPanel.EAST);
View Full Code Here

Examples of com.google.gwt.user.client.ui.DockPanel

  private Screen2 screen2;

  public MainPane(ClientState clientState, ServiceRegistry serviceRegistry) {
        super(clientState, serviceRegistry);

        DockPanel mainPanel = new DockPanel();
    mainPanel.setBorderWidth(5);     
    mainPanel.setSize("100%", "100%");
   
      headerPane = new HeaderPane("GWT Maven Sample", clientState, serviceRegistry);
        mainPanel.add(headerPane, DockPanel.NORTH);
      mainPanel.setCellHeight(headerPane, "30px");
    mainPanel.setCellHorizontalAlignment(headerPane, DockPanel.ALIGN_CENTER);
    mainPanel.setCellVerticalAlignment(headerPane, DockPanel.ALIGN_MIDDLE);
     
      statusBarPane = new StatusBarPane();
    mainPanel.add(statusBarPane, DockPanel.SOUTH);
    mainPanel.setCellHeight(statusBarPane, "25px");
    mainPanel.setCellHorizontalAlignment(statusBarPane, DockPanel.ALIGN_CENTER);
    mainPanel.setCellVerticalAlignment(statusBarPane, DockPanel.ALIGN_MIDDLE);
       
    HorizontalSplitPanel horizontalSplitPanel = new HorizontalSplitPanel();
    horizontalSplitPanel.setSplitPosition("150px");
    centerPane = new SimplePanel();
    centerPane.add(new Label("right panel"));
    horizontalSplitPanel.setRightWidget(centerPane);
    menuPanel = new MenuPanel(serviceRegistry, this);
   
    horizontalSplitPanel.setLeftWidget(menuPanel);
    mainPanel.add(horizontalSplitPanel, DockPanel.CENTER);
     
    screen1 = new Screen1(clientState, serviceRegistry);
    screen2 = new Screen2(clientState, serviceRegistry);
    initWidget(mainPanel);
  }
View Full Code Here

Examples of com.google.gwt.user.client.ui.DockPanel

    panel.setHorizontalAlignment(VerticalPanel.ALIGN_LEFT);
    panel.setVerticalAlignment(VerticalPanel.ALIGN_TOP);
    WikiLoaderPanel.HTML_PANEL.loadHTML(title);
    panel.setWidth("100%");

    DockPanel dp = new DockPanel();
    // dp.add(list, DockPanel.WEST);
    dp.add(panel, DockPanel.CENTER);
    dp.setCellVerticalAlignment(panel, HasAlignment.ALIGN_TOP);
    dp.setCellWidth(panel, "100%");
    fTabs.add(dp, "article");

    WIKI_EDITOR_BODY.setCharacterWidth(80);
    WIKI_EDITOR_BODY.setVisibleLines(10);
    VerticalPanel editPanel = new VerticalPanel();
View Full Code Here

Examples of com.google.gwt.user.client.ui.DockPanel

          mainPane.showScreen2();
        }
      }
    };
   
    DockPanel main = new DockPanel();

    menuTree.addItem("Screen 1");
    menuTree.addItem("Screen 2");
    main.add(menuTree, DockPanel.NORTH);
    initWidget(main);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.