Example usage for com.google.gwt.user.client.ui PushButton setTabIndex

List of usage examples for com.google.gwt.user.client.ui PushButton setTabIndex

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui PushButton setTabIndex.

Prototype

@Override
    public void setTabIndex(int index) 

Source Link

Usage

From source file:cl.uai.client.toolbar.RotatePagesDialog.java

License:Open Source License

public RotatePagesDialog() {
    this.setHTML(MarkingInterface.messages.SortPages());
    this.addStyleName(Resources.INSTANCE.css().commentdialog());

    int pages = EMarkingWeb.markingInterface.getMarkingPagesInterface().getNumPages();

    this.setPixelSize(300, 300);

    scrollpanel = new ScrollPanel();
    scrollpanel.setPixelSize(300, 300);//from  w ww .  j  ava 2 s. c o m

    apanel = new VerticalPanel();
    for (int i = 0; i < pages; i++) {
        PushButton btnPage = new PushButton(MarkingInterface.messages.RotatePage(i + 1));
        btnPage.setTabIndex(i + 1);
        btnPage.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                PushButton btn = (PushButton) event.getSource();
                selectedPage = btn.getTabIndex();
                cancelled = false;
                hide();
            }
        });
        apanel.add(btnPage);
    }
    scrollpanel.add(apanel);

    this.setModal(true);
    this.setAutoHideEnabled(false);
    this.setGlassEnabled(true);

    vpanel = new VerticalPanel();
    vpanel.add(new Label(MarkingInterface.messages.RotatePagesInstructions()));
    vpanel.add(scrollpanel);

    // Basic save/cancel buttons
    HorizontalPanel hpanel = new HorizontalPanel();

    Button cancelButton = new Button(MarkingInterface.messages.Cancel());
    cancelButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            cancelled = true;
            hide();
        }
    });

    hpanel.add(cancelButton);

    vpanel.add(hpanel);
    vpanel.setCellHorizontalAlignment(hpanel, HasHorizontalAlignment.ALIGN_RIGHT);

    this.setWidget(vpanel);
}

From source file:com.vaadin.client.ui.richtextarea.VRichTextToolbar.java

License:Apache License

private PushButton createPushButton(ImageResource img, String tip) {
    final PushButton pb = new PushButton(new Image(img));
    pb.addClickHandler(handler);/*from w  w  w.j  av a2 s  .  c  om*/
    pb.setTitle(tip);
    pb.setTabIndex(-1);
    return pb;
}

From source file:org.vaadin.risto.mathquill.client.ui.external.VRichTextToolbar.java

License:Apache License

protected PushButton createPushButton(ImageResource img, String tip) {
    final PushButton pb = new PushButton(new Image(img));
    pb.addClickHandler(getHandler());/*from   w w  w . j  ava 2  s  .c o m*/
    pb.setTitle(tip);
    pb.setTabIndex(-1);
    return pb;
}