Example usage for com.google.gwt.user.client.ui DockPanel CENTER

List of usage examples for com.google.gwt.user.client.ui DockPanel CENTER

Introduction

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

Prototype

DockLayoutConstant CENTER

To view the source code for com.google.gwt.user.client.ui DockPanel CENTER.

Click Source Link

Document

Specifies that a widget be added at the center of the dock.

Usage

From source file:org.pentaho.gwt.widgets.client.toolbar.ToolbarButton.java

License:Open Source License

/**
 * Constructs a toolbar button with an image, currently hardcoded to 16x16
 * //  w ww. j a v a 2  s.c  o m
 * @param img
 *          GWT Image object
 */
public ToolbarButton(Image img) {
    this.image = img;
    this.currentImage = img;
    button.add(this.image, DockPanel.CENTER);
    button.setCellHorizontalAlignment(this.image, DockPanel.ALIGN_CENTER);
    button.setCellVerticalAlignment(this.image, DockPanel.ALIGN_MIDDLE);

    button.setStyleName(stylePrimaryName);
    eventWrapper.add(button);

    addStyleMouseListener();
}

From source file:org.pentaho.gwt.widgets.client.toolbar.ToolbarButton.java

License:Open Source License

/**
 * Sets the enabled status of the button.
 * /*www . ja v a2  s .c  o  m*/
 * @param enabled
 *          boolean flag
 */
public void setEnabled(boolean enabled) {
    boolean prevState = this.enabled;
    this.enabled = enabled;
    if (enabled) {
        button.removeStyleName(stylePrimaryName + "-disabled"); //$NON-NLS-1$

        if (prevState == false && disabledImage != null) {
            // was disabled, remove old image and put in the enabled one
            button.remove(currentImage);
            button.add(calculateApporiateImage(), DockPanel.CENTER);
            button.setCellHorizontalAlignment(this.image, DockPanel.ALIGN_CENTER);
            button.setCellVerticalAlignment(this.image, DockPanel.ALIGN_MIDDLE);
        }

    } else {
        button.addStyleName(stylePrimaryName + "-disabled"); //$NON-NLS-1$

        if (prevState == true && disabledImage != null) {
            // was enabled, remove old image and put in the disabled one
            button.remove(currentImage);
            button.add(calculateApporiateImage(), DockPanel.CENTER);
            button.setCellHorizontalAlignment(this.disabledImage, DockPanel.ALIGN_CENTER);
            button.setCellVerticalAlignment(this.disabledImage, DockPanel.ALIGN_MIDDLE);
        }
    }
}

From source file:org.pentaho.gwt.widgets.client.toolbar.ToolbarButton.java

License:Open Source License

/**
 * Sets the image displayed on this button.
 * /*www. j a  v a 2  s .c  o  m*/
 * @param img
 *          GWT Image
 */
public void setImage(Image img) {
    this.image = img;
    button.remove(currentImage);
    Image curImage = calculateApporiateImage();
    button.add(curImage, DockPanel.CENTER);
    button.setCellHorizontalAlignment(curImage, DockPanel.ALIGN_CENTER);
    button.setCellVerticalAlignment(curImage, DockPanel.ALIGN_MIDDLE);
}

From source file:org.pentaho.gwt.widgets.client.toolbar.ToolbarButton.java

License:Open Source License

/**
 * Sets the image to be displayed on this button when disabled (greyed out).
 * //from  w w  w. j  a va2 s.  com
 * @param img
 *          GWT Image
 */
public void setDisabledImage(Image img) {
    if (!isEnabled()) {
        // was enabled, remove old image and put in the disabled one
        this.disabledImage = img;
        button.remove(currentImage);
        Image curImage = calculateApporiateImage();
        button.add(curImage, DockPanel.CENTER);
        button.setCellHorizontalAlignment(curImage, DockPanel.ALIGN_CENTER);
        button.setCellVerticalAlignment(curImage, DockPanel.ALIGN_MIDDLE);
    }
}

From source file:org.pentaho.gwt.widgets.client.toolbar.ToolbarToggleButton.java

License:Open Source License

protected void updateSelectedStyle() {
    if (selected) {
        button.addStyleName(stylePrimaryName + "-down"); //$NON-NLS-1$
        if (this.downImage != null) {
            button.remove(currentImage);
            button.add(calculateApporiateImage(), DockPanel.CENTER);
        }//from w  ww .  j a v a  2 s.  co  m
    } else {
        if (this.downImage != null) {
            button.remove(currentImage);
            button.add(calculateApporiateImage(), DockPanel.CENTER);
        }

        button.removeStyleName(stylePrimaryName + "-down"); //$NON-NLS-1$
        button.removeStyleName(stylePrimaryName + "-down-hovering"); //$NON-NLS-1$
    }
}

From source file:org.pentaho.gwt.widgets.client.wizards.AbstractWizardDialog.java

License:Open Source License

/**
 * layout()//from w  w w.  j  av a 2 s.c om
 * 
 * Lays out the GUI elements. Should only be called ONCE during the objects lifecycle
 */
protected void layout() {
    // Create the overall container to be displayed in the dialog

    SimplePanel deckWrapper = new SimplePanel();
    deckWrapper.setHeight("100%");
    deckWrapper.setWidth("100%");
    deckWrapper.setStyleName("dialog-content");

    DockPanel content = new DockPanel();

    // Create the Steps and add it to the content
    stepsList = new VerticalPanel();
    stepsList.add(new Label(Messages.getString("dialog.steps")));
    steps.setVisibleItemCount(STEPS_COUNT);
    stepsList.add(steps);
    // steps.setSize("30%", "100%");
    content.add(stepsList, DockPanel.WEST);

    // Add the wizardPanels to the Deck and add the deck to the content
    // wizardDeckPanel.setSize("70%", "100%");
    deckWrapper.setWidget(wizardDeckPanel);
    content.add(deckWrapper, DockPanel.CENTER);
    wizardDeckPanel.addStyleName(WIZARD_DECK_PANEL);

    // Add the control buttons
    HorizontalPanel wizardButtonPanel = new HorizontalPanel();
    wizardButtonPanel.setSpacing(2);
    // If we have only one button then we dont need to show the back and next button.
    wizardButtonPanel.add(backButton);
    wizardButtonPanel.add(nextButton);
    wizardButtonPanel.add(finishButton);
    wizardButtonPanel.add(cancelButton);
    wizardButtonPanel.addStyleName(WIZARD_BUTTON_PANEL);

    HorizontalPanel wizardButtonPanelWrapper = new HorizontalPanel();
    wizardButtonPanelWrapper.setWidth("100%"); //$NON-NLS-1$
    wizardButtonPanelWrapper.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    wizardButtonPanelWrapper.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
    wizardButtonPanelWrapper.add(wizardButtonPanel);

    content.add(wizardButtonPanelWrapper, DockPanel.SOUTH);
    content.setCellVerticalAlignment(wizardButtonPanelWrapper, HasVerticalAlignment.ALIGN_BOTTOM);

    // Add the content to the dialog
    add(content);
    content.setWidth("100%"); //$NON-NLS-1$
    content.setHeight("100%"); //$NON-NLS-1$
    content.setCellHeight(deckWrapper, "98%");
}

From source file:org.pentaho.pac.client.AdminConsoleMasterDetailsPanel.java

License:Open Source License

public AdminConsoleMasterDetailsPanel() {
    add(leftPanel, DockPanel.WEST);//  w  ww .  j a v  a  2 s.  co m
    leftPanel.setHeight("100%"); //$NON-NLS-1$

    add(rightPanel, DockPanel.CENTER);
    rightPanel.setWidth("100%"); //$NON-NLS-1$
    rightPanel.setHeight("100%"); //$NON-NLS-1$
    setCellHeight(rightPanel, "100%"); //$NON-NLS-1$
    setCellWidth(rightPanel, "100%"); //$NON-NLS-1$
}

From source file:org.pentaho.pac.client.AdminConsoleMasterPanel.java

License:Open Source License

public AdminConsoleMasterPanel() {
    Label spacer = new Label();
    verticalPanel.add(spacer);//w ww.  j  av  a  2s. c  om
    verticalPanel.setCellHeight(spacer, "20px"); //$NON-NLS-1$   

    verticalPanel.add(buttonPanel);
    buttonPanel.setStyleName("leftTabPanel"); //$NON-NLS-1$

    spacer = new Label();
    verticalPanel.add(spacer);
    verticalPanel.setCellHeight(spacer, "50"); //$NON-NLS-1$

    Grid grid = new Grid(3, 1);
    grid.setWidth("100%"); //$NON-NLS-1$
    grid.setHeight("100%"); //$NON-NLS-1$
    grid.setCellPadding(0);
    grid.setCellSpacing(0);
    grid.getCellFormatter().setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_TOP);

    grid.getCellFormatter().setStyleName(0, 0, "deckPanel-nw"); //$NON-NLS-1$
    grid.getCellFormatter().setStyleName(1, 0, "deckPanel-cw"); //$NON-NLS-1$
    grid.getCellFormatter().setStyleName(2, 0, "deckPanel-sw"); //$NON-NLS-1$

    grid.setWidget(1, 0, verticalPanel);

    add(grid, DockPanel.CENTER);
}

From source file:org.pentaho.pac.client.common.ui.GroupBox.java

License:Open Source License

public GroupBox(String title) {
    this.setStylePrimaryName("GroupBox"); //$NON-NLS-1$

    this.title = new Label(title);
    this.title.setStylePrimaryName("groupBoxHeader"); //$NON-NLS-1$

    grid = new Grid(3, 3);
    grid.setWidth("100%"); //$NON-NLS-1$
    grid.setHeight("100%"); //$NON-NLS-1$
    grid.setCellPadding(0);//  w  ww . ja  v a2  s  .  co  m
    grid.setCellSpacing(0);

    grid.setWidget(0, 1, this.title);

    grid.getCellFormatter().setStyleName(0, 0, "groupbox-nw"); //$NON-NLS-1$ 
    grid.getCellFormatter().setStyleName(0, 1, "groupbox-n"); //$NON-NLS-1$
    grid.getCellFormatter().setStyleName(0, 2, "groupbox-ne"); //$NON-NLS-1$ 
    grid.getCellFormatter().setStyleName(1, 0, "groupbox-w"); //$NON-NLS-1$
    grid.getCellFormatter().setStyleName(1, 1, "groupbox-c"); //$NON-NLS-1$
    grid.getCellFormatter().setStyleName(1, 2, "groupbox-e"); //$NON-NLS-1$
    grid.getCellFormatter().setStyleName(2, 0, "groupbox-sw"); //$NON-NLS-1$
    grid.getCellFormatter().setStyleName(2, 1, "groupbox-s"); //$NON-NLS-1$
    grid.getCellFormatter().setStyleName(2, 2, "groupbox-se"); //$NON-NLS-1$

    this.add(grid, DockPanel.CENTER);

}

From source file:org.pentaho.pac.client.common.ui.toolbar.ToolbarButton.java

License:Open Source License

/**
 * Constructs a toolbar button with an image, currently hardcoded to 16x16
 * /*  w  ww  . ja  v  a 2s .  c  o  m*/
 * @param img GWT Image object 
 */
public ToolbarButton(Image img) {
    this.image = img;
    button.add(this.image, DockPanel.CENTER);
    button.setCellHorizontalAlignment(this.image, DockPanel.ALIGN_CENTER);
    button.setCellVerticalAlignment(this.image, DockPanel.ALIGN_MIDDLE);

    button.setStyleName(stylePrimaryName);
    eventWrapper.add(button);

    addStyleMouseListener();
}