Package com.google.gwt.user.client.ui

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


        layoutC.setWidget( 2,
                           1,
                           generateButton );

        // Wrap the content in a DecoratorPanel
        DecoratorPanel decPanel = new DecoratorPanel();
        decPanel.setWidget( layoutC );
        return decPanel;
    }
View Full Code Here


  private final Button deleteButton;
  private FlexTable contactsTable;
  private final FlexTable contentTable;

  public ContactsView() {
    DecoratorPanel contentTableDecorator = new DecoratorPanel();
    initWidget(contentTableDecorator);
    contentTableDecorator.setWidth("100%");
    contentTableDecorator.setWidth("18em");

    contentTable = new FlexTable();
    contentTable.setWidth("100%");
    contentTable.getCellFormatter().addStyleName(0, 0, "contacts-ListContainer");
    contentTable.getCellFormatter().setWidth(0, 0, "100%");
    contentTable.getFlexCellFormatter().setVerticalAlignment(0, 0, DockPanel.ALIGN_TOP);

    // Create the menu
    HorizontalPanel hPanel = new HorizontalPanel();
    hPanel.setBorderWidth(0);
    hPanel.setSpacing(0);
    hPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
    addButton = new Button("Add Contact");
    hPanel.add(addButton);
    deleteButton = new Button("Delete Contact");
    hPanel.add(deleteButton);
    contentTable.getCellFormatter().addStyleName(0, 0, "contacts-ListMenu");
    contentTable.setWidget(0, 0, hPanel);

    // Create the contacts list
    contactsTable = new FlexTable();
    contactsTable.setCellSpacing(0);
    contactsTable.setCellPadding(0);
    contactsTable.setWidth("100%");
    contactsTable.addStyleName("contacts-ListContents");
    contactsTable.getColumnFormatter().setWidth(0, "15px");
    contentTable.setWidget(1, 0, contactsTable);

    contentTableDecorator.add(contentTable);
  }
View Full Code Here

        } );

        layoutA.setWidget( 3,
                           1,
                           continueButton );
        DecoratorPanel decPanel = new DecoratorPanel();
        decPanel.setWidget( layoutA );
        return decPanel;
    }
View Full Code Here

            }
        } );
        layoutB.setWidget( 5,
                           1,
                           generateButton );
        DecoratorPanel decPanel = new DecoratorPanel();
        decPanel.setWidget( layoutB );
        return decPanel;
    }
View Full Code Here

        layoutC.setWidget( 2,
                           1,
                           generateButton );

        // Wrap the content in a DecoratorPanel
        DecoratorPanel decPanel = new DecoratorPanel();
        decPanel.setWidget( layoutC );
        return decPanel;
    }
View Full Code Here

public class PTDecoratorPanel extends PTSimplePanel {

    @Override
    public void create(final PTInstruction create, final UIService uiService) {
        init(create, uiService, new DecoratorPanel());
    }
View Full Code Here

    tags = new ArrayList<Tag>();
    maxNumberOfTags = 20;
    minOccurences = 1;
    maxOccurences = 1;
    step = 1;// 'average' difference between each occurence
    DecoratorPanel dec = new DecoratorPanel();
    dec.setWidget(cloud);
    initWidget(dec);
  }
View Full Code Here

    ScrollPanel staticTreeWrapper = new ScrollPanel(staticTree);
    staticTreeWrapper.ensureDebugId("cwTree-staticTree-Wrapper");
    staticTreeWrapper.setSize("300px", "300px");

    // Wrap the static tree in a DecoratorPanel
    DecoratorPanel staticDecorator = new DecoratorPanel();
    staticDecorator.setWidget(staticTreeWrapper);

    // Create a dynamically generated tree and a container to hold it
    final Tree dynamicTree = createDynamicTree();
    dynamicTree.ensureDebugId("cwTree-dynamicTree");
    ScrollPanel dynamicTreeWrapper = new ScrollPanel(dynamicTree);
    dynamicTreeWrapper.ensureDebugId("cwTree-dynamicTree-Wrapper");
    dynamicTreeWrapper.setSize("300px", "300px");

    // Wrap the dynamic tree in a DecoratorPanel
    DecoratorPanel dynamicDecorator = new DecoratorPanel();
    dynamicDecorator.setWidget(dynamicTreeWrapper);

    // Combine trees onto the page
    Grid grid = new Grid(2, 3);
    grid.setCellPadding(2);
    grid.getRowFormatter().setVerticalAlign(1, HasVerticalAlignment.ALIGN_TOP);
View Full Code Here

              && layoutData.preferredSize <= 1.0) {
            northHeight = (int) (height * layoutData.preferredSize);
          }
          height += northHeight;
          if (layoutData.hasDecoratorPanel()) {
            final DecoratorPanel decPanel = layoutData.decoratorPanel;
            height += (decPanel.getOffsetHeight() - north.getOffsetHeight());
          }
        }

        height += spacing;
      }

      if (south != null) {
        BorderLayoutData layoutData = (BorderLayoutData) getLayoutData(south);

        if (layoutData.collapse) {
          height += WidgetHelper.getPreferredSize(southCollapsedImageButton).height;
        } else {
          int southHeight = (int) layoutData.preferredSize;
          if (layoutData.preferredSize == -1.0) {
            southHeight = WidgetHelper.getPreferredSize(south).height;
          } else if (layoutData.preferredSize > 0.0
              && layoutData.preferredSize <= 1.0) {
            southHeight = (int) (height * layoutData.preferredSize);
          }
          height += southHeight;
          if (layoutData.hasDecoratorPanel()) {
            final DecoratorPanel decPanel = layoutData.decoratorPanel;
            height += (decPanel.getOffsetHeight() - south.getOffsetHeight());
          }
        }

        height += spacing;
      }

      Dimension westSize = null;

      if (west != null) {
        BorderLayoutData layoutData = (BorderLayoutData) getLayoutData(west);

        if (layoutData.collapse) {
          width += WidgetHelper.getPreferredSize(westCollapsedImageButton).width;
        } else {
          int westWidth = (int) layoutData.preferredSize;
          if (layoutData.preferredSize == -1.0) {
            westWidth = WidgetHelper.getPreferredSize(west).width;
          } else if (layoutData.preferredSize > 0.0
              && layoutData.preferredSize <= 1.0) {
            westWidth = (int) (width * layoutData.preferredSize);
          }
          width += (int) Math.round(westWidth);
          if (layoutData.hasDecoratorPanel()) {
            final DecoratorPanel decPanel = layoutData.decoratorPanel;
            width += (decPanel.getOffsetWidth() - west.getOffsetWidth());
          }
        }

        width += spacing;
      }

      Dimension eastSize = null;

      if (east != null) {
        BorderLayoutData layoutData = (BorderLayoutData) getLayoutData(east);

        if (layoutData.collapse) {
          width += WidgetHelper.getPreferredSize(eastCollapsedImageButton).width;
        } else {
          int eastWidth = (int) layoutData.preferredSize;
          if (layoutData.preferredSize == -1.0) {
            eastWidth = WidgetHelper.getPreferredSize(east).width;
          } else if (layoutData.preferredSize > 0.0
              && layoutData.preferredSize <= 1.0) {
            eastWidth = (int) (width * layoutData.preferredSize);
          }
          width += (int) Math.round(eastWidth);
          if (layoutData.hasDecoratorPanel()) {
            final DecoratorPanel decPanel = layoutData.decoratorPanel;
            width += (decPanel.getOffsetWidth() - east.getOffsetWidth());
          }
        }

        width += spacing;
      }

      Dimension centerSize = WidgetHelper.getPreferredSize(center);
      width += centerSize.width;

      if (west != null && westSize == null) {
        westSize = WidgetHelper.getPreferredSize(west);
      }
      if (east != null && eastSize == null) {
        eastSize = WidgetHelper.getPreferredSize(east);
      }

      if (west != null && east != null) {
        height += Math.max(Math.max(westSize.height, eastSize.height),
            centerSize.height);
      } else if (west != null) {
        height += Math.max(westSize.height, centerSize.height);
      } else if (east != null) {
        height += Math.max(eastSize.height, centerSize.height);
      } else {
        height += centerSize.height;
      }

      BorderLayoutData layoutData = (BorderLayoutData) getLayoutData(center);
      if (layoutData != null && layoutData.hasDecoratorPanel()) {
        final DecoratorPanel decPanel = layoutData.decoratorPanel;
        width += (decPanel.getOffsetWidth() - center.getOffsetWidth());
        height += (decPanel.getOffsetHeight() - center.getOffsetHeight());
      }

      result.width = width;
      result.height = height;

View Full Code Here

      throw new IllegalArgumentException(
          "Adding a DecoratorPanel is not allowed!");
    }
    BaseLayout.setLayoutData(widget, layoutData);
    if (layoutData.hasDecoratorPanel()) {
      final DecoratorPanel decPanel = layoutData.decoratorPanel;
      decPanel.setWidget(widget);
      decPanel.setVisible(widget.isVisible());
      add(decPanel);
    } else {
      add(widget);
    }
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.DecoratorPanel

Copyright © 2018 www.massapicom. 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.