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

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


        sections.add(new SectionPanel(section));
    }

    @Override
    public void addSidebarSection(final SidebarSectionData section) {
        FlowPanel sidebarSection = new FlowPanel();
        sidebarSection.addStyleName("homepage-sidebar-section");
        sidebarSection.add(new HTML(TEMPLATES.sidebarSectionHeader(section.getTitle())));
        FlowPanel links = new FlowPanel();
        links.addStyleName("homepage-sidebar-links");
        sidebarSection.add(links);
        for (Map.Entry<String, String> linkText : section.getLinks().entrySet()) {
            String href = linkText.getKey();
            String text = linkText.getValue();

            // No template / new HTML() here. We don't want nested divs. Otherwise :last-child rules won't work!
            AnchorElement link = Document.get().createAnchorElement();
            link.setHref(href);
            link.setTarget("_blank");
            link.setClassName("homepage-link");
            link.setInnerText(text);
            links.getElement().appendChild(link);
        }
        sidebarSections.add(sidebarSection);
    }
View Full Code Here


   * Preferred constructor.
   */
  public AceEditor() {
    elementId = "_aceGWT" + nextId;
    nextId++;
    FlowPanel div = new FlowPanel();
    div.getElement().setId(elementId);
    initWidget(div);
  }
View Full Code Here

     */
    private void createEditableLabel(String labelText,
            ChangeListener onUpdate, String okButtonText,
            String cancelButtonText) {
        // Put everything in a VerticalPanel
        FlowPanel instance = new FlowPanel();

        if (labelText == null || labelText.length() < 1) {
            labelText = "Click to edit me";
        }

        // Create the Label element and add a ClickListener to call out
        // Change method when clicked
        text = new Label(labelText);
        text.setStylePrimaryName("editableLabel-label");

        text.addClickListener(new ClickListener() {
            public void onClick(Widget sender) {
                changeTextLabel();
            }
        });
        text.addMouseListener(new MouseListenerAdapter() {
            public void onMouseEnter(Widget sender) {
                text.addStyleDependentName(HOVER_STYLE);
            }

            public void onMouseLeave(Widget sender) {
                text.removeStyleDependentName(HOVER_STYLE);
            }
        });

        // Create the TextBox element used for non word wrapped Labels
        // and add a KeyboardListener for Return and Esc key presses
        changeText = new TextBox();
        changeText.setStyleName("editableLabel-textBox");

        changeText.addKeyboardListener(new KeyboardListenerAdapter() {
            public void onKeyPress(Widget sender, char keyCode,
                    int modifiers) {
                // If return then save, if Esc cancel the change,
                // otherwise do nothing
                switch (keyCode) {
                case 13:
                    setTextLabel();
                    break;
                case 27:
                    cancelLabelChange();
                    break;
                }
            }
        });

        // Create the TextAre element used for word-wrapped Labels
        // and add a KeyboardListener for Esc key presses (not return in
        // this case)

        changeTextArea = new TextArea();
        changeTextArea.setStyleName("editableLabel-textArea");

        changeTextArea.addKeyboardListener(new KeyboardListenerAdapter() {
            public void onKeyPress(Widget sender, char keyCode,
                    int modifiers) {
                // If Esc then cancel the change, otherwise do nothing
                switch (keyCode) {
                case 27:
                    cancelLabelChange();
                    break;
                }
            }
        });

        // Set up Confirmation Button
        confirmChange = createConfirmButton(okButtonText);

        if (!(confirmChange instanceof SourcesClickEvents)) {
            throw new RuntimeException(
                    "Confirm change button must allow for click events");
        }

        ((SourcesClickEvents) confirmChange)
                .addClickListener(new ClickListener() {
                    public void onClick(Widget sender) {
                        setTextLabel();
                    }
                });

        // Set up Cancel Button
        cancelChange = createCancelButton(cancelButtonText);
        if (!(cancelChange instanceof SourcesClickEvents)) {
            throw new RuntimeException(
                    "Cancel change button must allow for click events");
        }

        ((SourcesClickEvents) cancelChange)
                .addClickListener(new ClickListener() {
                    public void onClick(Widget sender) {
                        cancelLabelChange();
                    }
                });

        // Put the buttons in a panel
        FlowPanel buttonPanel = new FlowPanel();
        buttonPanel.setStyleName("editableLabel-buttonPanel");
        buttonPanel.add(confirmChange);
        buttonPanel.add(cancelChange);

        // Add panels/widgets to the widget panel
        instance.add(text);
        instance.add(changeText);
        instance.add(changeTextArea);
View Full Code Here

    public VerticalLabel(String text) {

        if (allImages == null) {
            createMap();
        }
        mainPanel = new FlowPanel();
        mainPanel.setStylePrimaryName("vertical-label");
        setText(text);

        initWidget(mainPanel);
    }
View Full Code Here

        // create service
        this.messagesServiceAsync = GWT.create(MessagesService.class);

        // create view
        messagePanel = new FlowPanel();

        header = new Label();
        messagePanel.add(header);

        messageBox = new MessageBox();
View Full Code Here

    protected void update(List<Message> messages) {
        clear();

        for (Message message : messages) {
            Panel panel = new FlowPanel();
            panel.setStyleName("message");

            Label messageText = new Label(message.getText());
            messageText.setStyleName("messageText");
            panel.add(messageText);

            Button button = new Button("Delete");
            button.addStyleName("deleteButton");
            button.addClickHandler(new DeleteClickHandler(message.getId()));

            panel.add(button);

            add(panel);
        }
    }
View Full Code Here

    public void show(Widget widget, Position position, String style) {
        NotificationTypeConfiguration styleSetup = getUiState(style);
        setWaiAriaRole(styleSetup);

        FlowPanel panel = new FlowPanel();
        if (hasPrefix(styleSetup)) {
            panel.add(new Label(styleSetup.prefix));
            AriaHelper.setVisibleForAssistiveDevicesOnly(panel.getElement(),
                    true);
        }

        panel.add(widget);

        if (hasPostfix(styleSetup)) {
            panel.add(new Label(styleSetup.postfix));
            AriaHelper.setVisibleForAssistiveDevicesOnly(panel.getElement(),
                    true);
        }
        setWidget(panel);
        show(position, style);
    }
View Full Code Here

  public Form() {
    this(null);
  }

  public Form(String title) {
    FlowPanel panel = new FlowPanel();

    if(title != null) {
      Label formTitle = new Label(title);
      formTitle.addStyleName("claymus-h2");
      panel.add(formTitle);
    }

    panel.add(this.fields);

    this.buttons.addStyleName("claymus-toolbar");
    panel.add(this.buttons);

    initWidget(panel);

    setStyleName("claymus-gwt-Form");
  }
View Full Code Here

  protected FormField(String label, Widget widget, boolean required, String helpText, String... regex) {
    this.widget = widget;
    this.required = required;
    this.regex = regex;

    FlowPanel panel = new FlowPanel();

    if(label != null) {
      Label fieldLabel = new Label(label);
      fieldLabel.addStyleName("claymus-h3");
      panel.add(fieldLabel);
    }

    panel.add(widget);

    if(helpText != null) {
      Label fieldLabel = new Label(helpText);
      fieldLabel.addStyleName("claymus-sub-text");
      fieldLabel.addStyleName("claymus-faded-text");
      panel.add(fieldLabel);
    }

    initWidget(panel);

    setStyleName("claymus-gwt-FormField");
View Full Code Here

    // the scrollable.
    ScrollPanel scrollable = new ScrollPanel();
    scrollable.getElement().setTabIndex(-1);
    final Widget pager = createPager(view);
    if (pager != null) {
      FlowPanel flowPanel = new FlowPanel();
      flowPanel.add(view);
      flowPanel.add(pager);
      scrollable.setWidget(flowPanel);
    } else {
      scrollable.setWidget(view);
    }
    scrollable.setStyleName(style.cellBrowserColumn());
View Full Code Here

TOP

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

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.