Java Code Examples for com.google.gwt.user.client.ui.VerticalPanel#add()

The following examples show how to use com.google.gwt.user.client.ui.VerticalPanel#add() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
private void createLyricsDialog()
{
	lyricsDialog = new DialogBox();
	VerticalPanel vPanel = new VerticalPanel();
	vPanel.setHeight( "100%" );
	vPanel.setHorizontalAlignment( VerticalPanel.ALIGN_CENTER );
	vPanel.setVerticalAlignment( VerticalPanel.ALIGN_MIDDLE );
	lyricsDialog.add( vPanel );
	
	lyrics = new HTML();
	ScrollPanel scrollPanel = new ScrollPanel();
	scrollPanel.setWidth( "300px" );
	scrollPanel.setHeight( "250px" );
	scrollPanel.add( lyrics );
	vPanel.add( scrollPanel );
	
	Button close = new NativeButton( "Close" );
	close.addClickListener( new ClickListener() {
		public void onClick( Widget arg0 ) {
			lyricsDialog.hide();
		}
	} );
	vPanel.add( close );
}
 
Example 2
public TemplateWidget(TemplateInfo info, String hostUrl) {
  setTemplate(info, hostUrl);

  panel = new VerticalPanel();
  panel.add(title);
  title.getElement().getStyle().setFontWeight(Style.FontWeight.BOLD);
  panel.add(subtitle);
  descriptionHtml.setHTML(info.description);
  panel.add(descriptionHtml);
  panel.add(image);
  SimplePanel wrapper = new SimplePanel();
  wrapper.getElement().getStyle().setOverflowY(Style.Overflow.SCROLL);
  wrapper.add(panel);
  initWidget(wrapper);
  setStylePrimaryName("ode-ContextMenu");
  setHeight("355px");
}
 
Example 3
Source Project: swellrt   File: DialogBox.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates dialog box.
 *
 * @param popup - UniversalPopup on which the dialog is based
 * @param title - title placed in the title bar
 * @param innerWidget - the inner widget of the dialog
 * @param dialogButtons - buttons
 */
static public void create(UniversalPopup popup, String title, Widget innerWidget, DialogButton[] dialogButtons) {
  // Title
  popup.getTitleBar().setTitleText(title);

  VerticalPanel contents = new VerticalPanel();
  popup.add(contents);

  // Message
  contents.add(innerWidget);

  // Buttons
  HorizontalPanel buttonPanel = new HorizontalPanel();
  for(DialogButton dialogButton : dialogButtons) {
    Button button = new Button(dialogButton.getTitle());
    button.setStyleName(Dialog.getCss().dialogButton());
    buttonPanel.add(button);
    dialogButton.link(button);
  }
  contents.add(buttonPanel);
  buttonPanel.setStyleName(Dialog.getCss().dialogButtonPanel());
  contents.setCellHorizontalAlignment(buttonPanel, HasHorizontalAlignment.ALIGN_RIGHT);
}
 
Example 4
Source Project: appinventor-extensions   File: Ode.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * The "Final" Dialog box. When a user chooses to end their session
 * due to a conflicting login, we should show this dialog which is modal
 * and has no exit! My preference would have been to close the window
 * altogether, but the browsers won't let javascript code close windows
 * that it didn't open itself (like the main window). I also tried to
 * use document.write() to write replacement HTML but that caused errors
 * in Firefox and strange behavior in Chrome. So we do this...
 *
 * We are called from invalidSessionDialog() (above).
 */
private void finalDialog() {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.finalDialogText());
  dialogBox.setHeight("100px");
  dialogBox.setWidth("400px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML(MESSAGES.finalDialogMessage());
  message.setStyleName("DialogBox-message");
  DialogBoxContents.add(message);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
Example 5
Source Project: swcv   File: AppUtils.java    License: MIT License 6 votes vote down vote up
public static DialogBox createShadow()
{
    final DialogBox box = new DialogBox();
    VerticalPanel rows = new VerticalPanel();
    rows.setSpacing(1);
    HTML html = new HTML("<div></div>");
    rows.add(html);
    rows.addStyleName("blackTransparent");
    rows.setCellHeight(html, "" + Window.getClientHeight());
    rows.setCellWidth(html, "" + Window.getClientWidth());

    rows.setCellHorizontalAlignment(html, HasHorizontalAlignment.ALIGN_CENTER);
    rows.setCellVerticalAlignment(html, HasVerticalAlignment.ALIGN_MIDDLE);

    HorizontalPanel hp = new HorizontalPanel();
    hp.add(rows);
    box.setWidget(hp);
    return box;
}
 
Example 6
@SuppressWarnings("unchecked")
public Widget asWidget() {
    VerticalPanel panel = new VerticalPanel();
    panel.addStyleName("fill-layout-width");

    setupTable();
    dataProvider = new ListDataProvider<>();
    dataProvider.addDataDisplay(table);

    panel.add(setupTableButtons());

    panel.add(table);
    DefaultPager pager = new DefaultPager();
    pager.setDisplay(table);
    panel.add(pager);
    return panel;
}
 
Example 7
private VerticalPanel getTMSPanel() {
	final VerticalPanel panel = new VerticalPanel();
	panel.setWidth("350px");
	panel.setSpacing(10);

	urlTMSField = new TextField();
	urlTMSField.setTitle(UIMessages.INSTANCE.lrasterdUrlField());
	urlTMSField.setWidth(FIELD_WIDTH);
	urlTMSField.setAllowBlank(false);

	panel.add(urlTMSField);

	nameTMSField = new TextField();
	nameTMSField.setTitle(UIMessages.INSTANCE.lrasterdLayerNameField(""));
	nameTMSField.setAllowBlank(false);
	nameTMSField.setWidth(FIELD_WIDTH);
	panel.add(nameTMSField);

	formatTMSField = new TextField();
	formatTMSField.setTitle(UIMessages.INSTANCE.lrasterdImageFormatField());
	formatTMSField.setAllowBlank(false);
	formatTMSField.setWidth(FIELD_WIDTH);
	panel.add(formatTMSField);

	return panel;
}
 
Example 8
@Override
public Widget buildWidget(ResourceAddress address, ResourceDefinition definition) {
    ModelNodeFormBuilder builder = new ModelNodeFormBuilder()
            .setConfigOnly()
            .setResourceDescription(definition)
            .setSecurityContext(securityContext);
    if (fields != null && fields.length != 0) {
        builder = builder.include(fields);
    }
    formAssets = builder.build();
    formAssets.getForm().setToolsCallback(new FormCallback() {
        @Override
        public void onSave(Map changeSet) {
            BatchResourceForm.this.onSave(formAssets.getForm().getChangedValues());
        }

        @Override
        public void onCancel(Object entity) {
            formAssets.getForm().cancel();
        }
    });

    VerticalPanel formPanel = new VerticalPanel();
    formPanel.setStyleName("fill-layout-width");
    formPanel.add(formAssets.getHelp().asWidget());
    formPanel.add(formAssets.getForm().asWidget());

    return formPanel;
}
 
Example 9
Source Project: appinventor-extensions   File: Box.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Creates a button with a click handler which will execute the given command.
 */
private void addControlButton(VerticalPanel panel, String caption, final Command command) {
  TextButton button = new TextButton(caption);
  button.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      command.execute();
    }
  });
  panel.add(button);
  panel.setCellHorizontalAlignment(button, VerticalPanel.ALIGN_CENTER);
}
 
Example 10
Widget asWidget() {
    VerticalPanel layout = new VerticalPanel();
    layout.addStyleName("window-content");

    DefaultCFForm defaultAttributes = new DefaultCFForm(presenter,
            new FormToolStrip.FormCallback<ActivemqConnectionFactory>() {
                @Override
                public void onSave(Map<String, Object> changeset) {}

                @Override
                public void onDelete(ActivemqConnectionFactory entity) {}
            }, false
    );

    defaultAttributes.getForm().setNumColumns(1);
    defaultAttributes.getForm().setEnabled(true);
    defaultAttributes.setIsCreate(true);

    layout.add(defaultAttributes.asWidget());

    DialogueOptions options = new DialogueOptions(
            event -> {
                Form<ActivemqConnectionFactory> form = defaultAttributes.getForm();
                FormValidation validation = form.validate();
                if (!validation.hasErrors()) { presenter.onCreateCF(form.getUpdatedEntity()); }
            },
            event -> presenter.closeDialogue()
    );

    return new WindowContentBuilder(layout, options).build();
}
 
Example 11
public DebugPanelFilterConfigWidget(DebugPanelFilterModel model, int filter) {
  VerticalPanel panel = new VerticalPanel();
  panel.add(getTitle(model.getFilter(filter)));
  panel.add(getDescription(model.getFilter(filter)));
  DebugPanelFilter.Config config = model.getFilterConfig(filter);
  panel.add(config.getView().getWidget());
  panel.add(getButtons(model, filter, config));
  initWidget(panel);
  setStyleName(Utils.style() + "-filterSettings");
}
 
Example 12
public Widget asWidget() {
    VerticalPanel panel = new VerticalPanel();
    panel.addStyleName("fill-layout-width");

    setupTable();
    dataProvider = new ListDataProvider<>();
    dataProvider.addDataDisplay(table);

    panel.add(setupTableButtons());

    panel.add(table);
    DefaultPager pager = new DefaultPager();
    pager.setDisplay(table);
    panel.add(pager);
    selectionModel.addSelectionChangeHandler(selectionChangeEvent -> {
        ModelNode selected = selectionModel.getSelectedObject();
        if (selected != null) {
            removeButton.setEnabled(true);
            editButton.setEnabled(true);
        } else {
            removeButton.setEnabled(false);
            editButton.setEnabled(false);

        }
    });
    return panel;
}
 
Example 13
@Override
public Widget createWidget() {
    VerticalPanel layout = new VerticalPanel();
    layout.setStyleName("rhs-content-panel");
    layout.add(new ContentHeaderLabel(Console.CONSTANTS.unauthorized()));
    layout.add(new ContentDescription(Console.CONSTANTS.unauthorized_desc()));
    return layout;
}
 
Example 14
public Widget asWidget() {

            VerticalPanel formPanel = new VerticalPanel();
            formPanel.setStyleName("fill-layout-width");
            formPanel.add(getHelp().asWidget());
            formPanel.add(getForm().asWidget());
            return formPanel;
        }
 
Example 15
@SuppressWarnings("unchecked")
public Widget asWidget() {
    VerticalPanel panel = new VerticalPanel();
    panel.addStyleName("fill-layout-width");

    // table
    table = new DefaultCellTable<>(20);
    dataProvider = new ListDataProvider<>();
    dataProvider.addDataDisplay(table);
    table.setSelectionModel(selectionModel);

    // columns
    Column<ModelNode, String> fromColumn = createColumn("from");
    Column<ModelNode, String> toColumn = createColumn("to");
    Column<ModelNode, String> referenceColumn = createColumn("reference");
    Column<ModelNode, String> filterColumn = createColumn("filter");
    Column<ModelNode, String> filterBaseColumn = createColumn("filter-base-dn");
    Column<ModelNode, String> searchRecursiveColumn = createColumn("search-recursive");
    Column<ModelNode, String> roleRecursionColumn = createColumn("role-recursion");
    Column<ModelNode, String> roleRecursioNameColumn = createColumn("role-recursion-name");
    Column<ModelNode, String> extractDnColumn = createColumn("extract-rdn");
    table.addColumn(fromColumn, "From");
    table.addColumn(toColumn, "To");
    table.addColumn(referenceColumn, "Reference");
    table.addColumn(filterColumn, "Filter");
    table.addColumn(filterBaseColumn, "Filter Base DN");
    table.addColumn(searchRecursiveColumn, "Search Recursive");
    table.addColumn(roleRecursionColumn, "Role Recursion");
    table.addColumn(roleRecursioNameColumn, "Role Recursion Name");
    table.addColumn(extractDnColumn, "Extract RDN");

    panel.add(mainTableTools());
    panel.add(table);
    DefaultPager pager = new DefaultPager();
    pager.setDisplay(table);
    panel.add(pager);
    return panel;
}
 
Example 16
public MenuPopup() {
	// Establishes auto-close when click outside
	super(true, true);
	panel = new VerticalPanel();
	menu = new Menu();
	panel.add(menu);
	setWidget(panel);
}
 
Example 17
Source Project: appinventor-extensions   File: MotdUi.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new output panel for MOTD.
 */
private MotdUi() {
  // Initialize UI
  text = new HTML();
  text.setSize("100%", "100%");
  text.setStylePrimaryName("ode-Motd");

  panel = new VerticalPanel();
  panel.add(text);
  panel.setSize("100%", "100%");
  panel.setCellHeight(text, "100%");
  panel.setCellWidth(text, "100%");

  initWidget(panel);
}
 
Example 18
public Widget asWidget() {
    rootPanel = new VerticalPanel();
    rootPanel.setStyleName("fill-layout-width");

    formAssets = new ModelNodeFormBuilder()
            .setConfigOnly()
            .setResourceDescription(resourceDescription)
            .setSecurityContext(securityContext)
            .setAddress(resourceAddress)
            .build();
    formAssets.getForm().setToolsCallback(new FormCallback() {
        @Override
        public void onSave(Map changeset) {
            onSaveJvm();
        }

        @Override
        public void onCancel(Object entity) {
        }
    });

    toolStrip = new ToolStrip(resourceAddress);

    clearBtn = new ToolButton(Console.CONSTANTS.common_label_clear(), event -> Feedback.confirm(
            Console.MESSAGES.deleteTitle("JVM Configuration"),
            Console.MESSAGES.deleteConfirm("JVM Configuration"),
            isConfirmed -> {
                if (isConfirmed) {
                    presenter.onDeleteJvm(reference, editedEntity.getName());
                }
            }));

    if(enableClearButton)
        toolStrip.addToolButtonRight(clearBtn);

    rootPanel.add(toolStrip.asWidget());

    // ---

    Widget formWidget = formAssets.asWidget();
    rootPanel.add(formWidget);

    return rootPanel;
}
 
Example 19
@Override
public Widget createWidget() {

    LayoutPanel layout = new LayoutPanel();

    FakeTabPanel titleBar = new FakeTabPanel("Virtual Machine Status");
    layout.add(titleBar);

    ClickHandler refreshHandler = new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            presenter.refresh();
        }
    };

    // ----

    VerticalPanel vpanel = new VerticalPanel();
    vpanel.setStyleName("rhs-content-panel");

    ScrollPanel scroll = new ScrollPanel(vpanel);
    layout.add(scroll);

    layout.setWidgetTopHeight(titleBar, 0, Style.Unit.PX, 40, Style.Unit.PX);
    layout.setWidgetTopHeight(scroll, 40, Style.Unit.PX, 100, Style.Unit.PCT);

    // ------------------------

    osName = new HTML();
    processors = new HTML();
    uptime = new HTML();

    HorizontalPanel header = new HorizontalPanel();
    header.setStyleName("fill-layout-width");
    vmName = new ContentHeaderLabel("");
    header.add(vmName);

    HTML refreshBtn = new HTML("<i class='icon-refresh'></i> Refresh Results");
    refreshBtn.setStyleName("html-link");
    refreshBtn.addClickHandler(refreshHandler);

    osPanel = new VerticalPanel();
    osPanel.add(refreshBtn);

    header.add(osPanel);

    vpanel.add(header);
    vpanel.add(osName);
    vpanel.add(processors);
    vpanel.add(uptime);

    // 50/50
    osPanel.getElement().getParentElement().setAttribute("style", "width:50%; vertical-align:top;padding-right:15px;");
    osPanel.getElement().getParentElement().setAttribute("align", "right");
    vmName.getElement().getParentElement().setAttribute("style", "width:50%; vertical-align:top");




    // --

    heapChart = new HeapChartView("Heap Usage") ;
    nonHeapChart = new HeapChartView("Non Heap Usage", false) ;

    vpanel.add(heapChart.asWidget());
    Widget widget = nonHeapChart.asWidget();
    //vpanel.add(widget);

    // --

    threadChart = new ThreadChartView("Thread Usage");
    vpanel.add(threadChart.asWidget());
    //threadPanel.add(osPanel);

    return layout;
}
 
Example 20
public Widget asWidget() {


        VerticalPanel layout = new VerticalPanel();
        layout.getElement().setId("profile_selection");
        layout.getElement().setAttribute("title", "Please chose a configuration profile");
        layout.setStyleName("fill-layout-width");
        layout.addStyleName("lhs-selector");
        layout.getElement().setAttribute("style","padding:4px;");

        profiles = new ComboPicker();
        profiles.addValueChangeHandler(new ValueChangeHandler<String>() {
            @Override
            public void onValueChange(final ValueChangeEvent<String> event) {

                if(event.getValue()!=null && !event.getValue().equals(""))
                {
                    Scheduler.get().scheduleDeferred(
                            new Scheduler.ScheduledCommand() {
                                @Override
                                public void execute() {
                                    Console.getEventBus().fireEvent(
                                            new ProfileSelectionEvent(event.getValue())
                                    );
                                }
                            });
                }
            }
        });

        Label profileLabel = new Label(Console.CONSTANTS.common_label_profile()+":");
        profileLabel.setStyleName("header-label");
        layout.add(profileLabel);
        Widget hWidget = profiles.asWidget();
        hWidget.getElement().addClassName("table-picker");
        layout.add(hWidget);

        // the combox box use all available space
        hWidget.getElement().getParentElement().setAttribute("width", "100%");


        return layout;
    }