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;
}
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());
}
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;
}
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);
}
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()));
}
}
Aggregations