Exemplo n.º 1
0
  @Override
  protected Widget getContent() {

    VerticalPanel panel = new VerticalPanel();
    Paragraph introduction =
        new Paragraph(
            "Vous trouverez ci-dessous une"
                + " liste de questions que vous pourriez vous poser à propos de"
                + " cette application.");
    introduction.addStyleName("indent");
    panel.add(introduction);

    DecoratedStackPanel stackPanel = new DecoratedStackPanel();
    panel.add(stackPanel);

    String question;
    HTML answer;
    String header;
    String image = new String();
    FAQResourcesBundle resources = GWT.create(FAQResourcesBundle.class);
    XMLReader xml = new XMLReader(resources.FAQ());

    for (int i = 0; i < xml.getLength(); ++i) {
      question = new String(xml.getQuestion(i));
      answer = new HTML(xml.getAnswer(i));
      answer.addStyleName("justify");
      image = xml.getImage(i);
      header = new String(getHeaderString(question, this.getImage(image)));
      stackPanel.add(answer, header, true);
    }

    return panel;
  }
Exemplo n.º 2
0
 private void addStackPanel() {
   DecoratedStackPanel sPanel = new DecoratedStackPanel();
   sPanel.setWidth("450px");
   for (int i = 1; i <= 5; i++) {
     Widget tabContent = new TabPanelSampleContent(i);
     String tabLabel = "Panel " + i;
     sPanel.add(tabContent, tabLabel);
   }
   RootPanel.get("stack-panel").add(sPanel);
 }
Exemplo n.º 3
0
  /** Initialize this example. */
  @ShowcaseSource
  @Override
  public Widget onInitialize() {
    // Get the images
    Images images = (Images) GWT.create(Images.class);

    // Create a new stack panel
    DecoratedStackPanel stackPanel = new DecoratedStackPanel();
    stackPanel.setWidth("200px");

    // Add the Mail folders
    String mailHeader = getHeaderString(constants.cwStackPanelMailHeader(), images.mailgroup());
    stackPanel.add(createMailItem(images), mailHeader, true);

    // Add a list of filters
    String filtersHeader =
        getHeaderString(constants.cwStackPanelFiltersHeader(), images.filtersgroup());
    stackPanel.add(createFiltersItem(), filtersHeader, true);

    // Add a list of contacts
    String contactsHeader =
        getHeaderString(constants.cwStackPanelContactsHeader(), images.contactsgroup());
    stackPanel.add(createContactsItem(images), contactsHeader, true);

    // Return the stack panel
    stackPanel.ensureDebugId("cwStackPanel");
    return stackPanel;
  }