Search in sources :

Example 1 with Panel

use of org.gwtbootstrap3.client.ui.Panel in project ovirt-engine by oVirt.

the class PatternflyListViewItem method createItemContainerPanel.

protected Container createItemContainerPanel(Row content, boolean hidden) {
    Container panel = new Container();
    panel.addStyleName(LIST_GROUP_ITEM_CONTAINER);
    if (hidden) {
        panel.addStyleName(ExpandableListViewItem.HIDDEN);
        panel.setFluid(true);
        Button closeButton = new Button();
        closeButton.addStyleName(Styles.CLOSE);
        getClickHandlerRegistrations().add(closeButton.addClickHandler(this));
        Span icon = new Span();
        icon.addStyleName(PatternflyConstants.PFICON);
        icon.addStyleName(PatternflyConstants.PFICON_CLOSE);
        closeButton.add(icon);
        panel.add(closeButton);
    }
    panel.add(content);
    return panel;
}
Also used : Container(org.gwtbootstrap3.client.ui.Container) Button(org.gwtbootstrap3.client.ui.Button) Span(org.gwtbootstrap3.client.ui.html.Span)

Example 2 with Panel

use of org.gwtbootstrap3.client.ui.Panel in project ovirt-engine by oVirt.

the class AbstractFormPanel method addFormItem.

/**
 * Adds new item to the form panel.
 */
public void addFormItem(FormItem item, int labelWidth, int valueWidth) {
    updateItemSizes(item, labelWidth, valueWidth);
    // Create item label
    Label itemLabel = new Label(item.getName());
    itemLabel.getElement().setId(ElementIdUtils.createFormGridElementId(elementId, item.getColumn(), item.getRow(), // $NON-NLS-1$
    "_label"));
    itemLabel.setStyleName(style.formPanelLabel());
    Row itemRow = new Row();
    Column labelColumn = new Column(COL_PREFIX + labelWidth);
    labelColumn.add(itemLabel);
    itemRow.add(labelColumn);
    Column itemColumn = findColumn(item.getRow(), item.getColumn());
    if (itemColumn != null) {
        itemColumn.add(itemRow);
    }
    // Update the item
    updateFormItem(item, valueWidth);
    // Update auto placement data
    incNextAvailableRow(item.getColumn());
}
Also used : Column(org.gwtbootstrap3.client.ui.Column) Label(com.google.gwt.user.client.ui.Label) Row(org.gwtbootstrap3.client.ui.Row)

Example 3 with Panel

use of org.gwtbootstrap3.client.ui.Panel in project ovirt-engine by oVirt.

the class AbstractActionTable method updateContextMenu.

/**
 * Rebuilds context menu items to match the action button list.
 * @param dropDownMenu The menu bar to populate.
 * @param actions A list of {@code ActionButtonDefinition}s used to populate the {@code MenuBar}.
 * @param popupPanel The pop-up panel containing the {@code MenuBar}.
 * @param removeOldItems A flag to indicate if we should remove old items.
 * @return A {@code MenuBar} containing all the action buttons as menu items.
 */
private DropDownMenu updateContextMenu(DropDownMenu dropDownMenu, List<ActionButtonDefinition<T>> actions, boolean removeOldItems) {
    if (removeOldItems) {
        ElementTooltipUtils.destroyMenuItemTooltips(dropDownMenu);
        dropDownMenu.clear();
        // Close any other open popups as well.
        closeOtherPopups();
    }
    for (final ActionButtonDefinition<T> buttonDef : actions) {
        if (buttonDef instanceof UiMenuBarButtonDefinition) {
            UiMenuBarButtonDefinition<T> menuBarDef = (UiMenuBarButtonDefinition<T>) buttonDef;
            DropDownHeader subMenuHeader = new DropDownHeader(buttonDef.getText());
            dropDownMenu.add(new Divider());
            subMenuHeader.setVisible(buttonDef.isVisible(getSelectedItems()));
            dropDownMenu.add(subMenuHeader);
            updateContextMenu(dropDownMenu, menuBarDef.getSubActions(), false);
        } else {
            AnchorListItem item = new AnchorListItem(buttonDef.getText());
            item.addClickHandler(e -> buttonDef.onClick(getSelectedItems()));
            updateMenuItem(item, buttonDef);
            dropDownMenu.add(item);
        }
    }
    return dropDownMenu;
}
Also used : AnchorListItem(org.gwtbootstrap3.client.ui.AnchorListItem) DropDownHeader(org.gwtbootstrap3.client.ui.DropDownHeader) Divider(org.gwtbootstrap3.client.ui.Divider) UiMenuBarButtonDefinition(org.ovirt.engine.ui.common.widget.action.UiMenuBarButtonDefinition)

Example 4 with Panel

use of org.gwtbootstrap3.client.ui.Panel in project kie-wb-common by kiegroup.

the class BreadcrumbNavigator method setupBreadcrumb.

// Package protected for unit-testing
void setupBreadcrumb(final FolderListing content) {
    final NavigatorBreadcrumbs navigatorBreadcrumbs = new NavigatorBreadcrumbs(NavigatorBreadcrumbs.Mode.SECOND_LEVEL);
    navigatorBreadcrumbs.build(content.getSegments(), content.getItem(), new ParameterizedCommand<FolderItem>() {

        @Override
        public void execute(final FolderItem item) {
            presenter.onActiveFolderItemSelected(item);
        }
    });
    final Panel panel = new Panel();
    final PanelBody panelBody = new PanelBody();
    panelBody.getElement().getStyle().setPaddingLeft(10, Style.Unit.PX);
    panelBody.getElement().getStyle().setPaddingRight(10, Style.Unit.PX);
    panelBody.add(navigatorBreadcrumbs);
    panel.add(panelBody);
    container.add(panel);
}
Also used : Panel(org.gwtbootstrap3.client.ui.Panel) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) FolderItem(org.kie.workbench.common.screens.explorer.model.FolderItem) PanelBody(org.gwtbootstrap3.client.ui.PanelBody)

Example 5 with Panel

use of org.gwtbootstrap3.client.ui.Panel in project kie-wb-common by kiegroup.

the class BusinessViewWidget method renderItems.

@Override
public void renderItems(FolderListing folderListing) {
    tagSelector.loadContent(presenter.getActiveContentTags(), presenter.getCurrentTag());
    itemsContainer.clear();
    sortedFolderItems.clear();
    for (final FolderItem content : folderListing.getContent()) {
        if (!content.getType().equals(FolderItemType.FOLDER)) {
            sortedFolderItems.add(content);
        }
    }
    if (!sortedFolderItems.isEmpty()) {
        final Map<ClientResourceType, Collection<FolderItem>> resourceTypeGroups = classifier.group(sortedFolderItems);
        final TreeMap<ClientResourceType, Collection<FolderItem>> sortedResourceTypeGroups = new TreeMap<>(Sorters.RESOURCE_TYPE_GROUP_SORTER);
        sortedResourceTypeGroups.putAll(resourceTypeGroups);
        for (final Map.Entry<ClientResourceType, Collection<FolderItem>> entry : sortedResourceTypeGroups.entrySet()) {
            final LinkedGroup itemsNavList = new LinkedGroup();
            itemsNavList.getElement().getStyle().setMarginBottom(0, Style.Unit.PX);
            final PanelCollapse collapse = new PanelCollapse();
            final String collapseId = getCollapseId(entry.getKey());
            final PanelCollapse oldCollapse = collapses.get(collapseId);
            final boolean in = (oldCollapse != null) ? oldCollapse.isIn() : false;
            collapse.setId(collapseId);
            collapse.setIn(in);
            final PanelBody body = new PanelBody();
            body.getElement().getStyle().setPadding(0, Style.Unit.PX);
            collapse.add(body);
            body.add(itemsNavList);
            for (FolderItem folderItem : entry.getValue()) {
                itemsNavList.add(makeItemNavLink(entry.getKey(), folderItem));
            }
            itemsContainer.add(new Panel() {

                {
                    add(makeTriggerWidget(entry.getKey(), collapse));
                    add(collapse);
                }
            });
            collapses.put(collapseId, collapse);
        }
    } else {
        itemsContainer.add(new Label(ProjectExplorerConstants.INSTANCE.noItemsExist()));
    }
}
Also used : LinkedGroup(org.gwtbootstrap3.client.ui.LinkedGroup) Label(org.gwtbootstrap3.client.ui.Label) PanelBody(org.gwtbootstrap3.client.ui.PanelBody) TreeMap(java.util.TreeMap) Panel(org.gwtbootstrap3.client.ui.Panel) FolderItem(org.kie.workbench.common.screens.explorer.model.FolderItem) ClientResourceType(org.uberfire.client.workbench.type.ClientResourceType) Collection(java.util.Collection) HashMap(java.util.HashMap) Map(java.util.Map) TreeMap(java.util.TreeMap) PanelCollapse(org.gwtbootstrap3.client.ui.PanelCollapse)

Aggregations

ClickEvent (com.google.gwt.event.dom.client.ClickEvent)5 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)5 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)3 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)3 Command (com.google.gwt.user.client.Command)3 FlexTable (com.google.gwt.user.client.ui.FlexTable)3 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)3 HTML (com.google.gwt.user.client.ui.HTML)3 Label (com.google.gwt.user.client.ui.Label)3 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)3 Map (java.util.Map)3 Label (org.gwtbootstrap3.client.ui.Label)3 Widget (com.google.gwt.user.client.ui.Widget)2 Collection (java.util.Collection)2 HashMap (java.util.HashMap)2 Button (org.gwtbootstrap3.client.ui.Button)2 Panel (org.gwtbootstrap3.client.ui.Panel)2 PanelBody (org.gwtbootstrap3.client.ui.PanelBody)2 TabPane (org.gwtbootstrap3.client.ui.TabPane)2 TextBox (org.gwtbootstrap3.client.ui.TextBox)2