Here are the examples of the java api com.vaadin.ui.themes.ValoTheme.LABEL_NO_MARGIN taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
8 Examples
13
Source : AbstractDashboardView.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
private Component buildHeader() {
MHorizontalLayout header = new MHorizontalLayout();
header.addStyleName("viewheader");
replacedleLabel = new Label(dashboardreplacedle());
replacedleLabel.setId(replacedLE_ID);
replacedleLabel.setSizeUndefined();
replacedleLabel.addStyleName(ValoTheme.LABEL_H1);
replacedleLabel.addStyleName(ValoTheme.LABEL_NO_MARGIN);
header.addComponent(replacedleLabel);
MHorizontalLayout tools = new MHorizontalLayout();
tools.addStyleName("toolbar");
header.addComponent(tools);
return header;
}
9
Source : AbstractEntityTablePanel.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
private AbstractLayout buildSecondaryToolbar() {
MHorizontalLayout layout = new MHorizontalLayout().withStyleName("toolbar").withDefaultComponentAlignment(Alignment.BOTTOM_LEFT).withFullWidth();
addButtonsToSecondaryToolbar(layout);
boolean addSpacer = true;
Iterator<Component> iter = layout.iterator();
layout.setVisible(layout.getComponentCount() > 0);
while (iter.hasNext()) {
Component c = iter.next();
if (layout.getExpandRatio(c) > 0) {
addSpacer = false;
break;
}
}
if (addSpacer) {
MLabel spacerLabel = new MLabel().withStyleName(ValoTheme.LABEL_NO_MARGIN);
layout.addComponent(spacerLabel);
layout.setExpandRatio(spacerLabel, 1);
}
// localize...
localizeRecursively(layout);
VaadinUtils.applyStyleRecursively(layout, "small");
return layout;
}
9
Source : AbstractEntityListPanel.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
private AbstractLayout buildSecondaryToolbar() {
// .withFullWidth();
MHorizontalLayout layout = new MHorizontalLayout().withSpacing(true).withStyleName("toolbar").withDefaultComponentAlignment(Alignment.BOTTOM_LEFT);
addButtonsToSecondaryToolbar(layout);
boolean addSpacer = true;
Iterator<Component> iter = layout.iterator();
layout.setVisible(layout.getComponentCount() > 0);
while (iter.hasNext()) {
Component c = iter.next();
if (layout.getExpandRatio(c) > 0) {
addSpacer = false;
break;
}
}
if (addSpacer) {
MLabel spacerLabel = new MLabel().withStyleName(ValoTheme.LABEL_NO_MARGIN);
layout.addComponent(spacerLabel);
layout.setExpandRatio(spacerLabel, 1);
}
// localize...
localizeRecursively(layout);
VaadinUtils.applyStyleRecursively(layout, "small");
return layout;
}
9
Source : AbstractDashboardPanel.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
private Component buildHeader() {
header = new MHorizontalLayout();
header.setDefaultComponentAlignment(Alignment.TOP_LEFT);
header.addStyleName("viewheader");
Responsive.makeResponsive(header);
replacedleLabel = new Label(localizedSingularValue(panelreplacedle()));
replacedleLabel.setWidth("100%");
replacedleLabel.addStyleName(ValoTheme.LABEL_H1);
replacedleLabel.addStyleName(ValoTheme.LABEL_NO_MARGIN);
header.addComponent(replacedleLabel);
Component toolbar = buildToolbar();
header.addComponent(toolbar);
header.setWidth("100%");
header.setExpandRatio(replacedleLabel, 1);
return header;
}
8
Source : AbstractEntityTablePanel.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
private AbstractLayout buildToolbar() {
MHorizontalLayout layout = new MHorizontalLayout().withStyleName("toolbar").withDefaultComponentAlignment(Alignment.BOTTOM_LEFT).withFullWidth();
layout.add(addButton);
layout.add(editButton);
layout.add(deleteButton);
layout.add(searchButton);
searchButton.setVisible(false);
layout.add(exportDataDownloadButton);
addButtonsToToolbar(layout);
boolean addSpacer = true;
Iterator<Component> iter = layout.iterator();
while (iter.hasNext()) {
Component c = iter.next();
if (layout.getExpandRatio(c) > 0) {
addSpacer = false;
break;
}
}
if (addSpacer) {
MLabel spacerLabel = new MLabel().withStyleName(ValoTheme.LABEL_NO_MARGIN);
layout.addComponent(spacerLabel);
layout.setExpandRatio(spacerLabel, 1);
}
// localize...
localizeRecursively(layout);
VaadinUtils.applyStyleRecursively(layout, "small");
return layout;
}
8
Source : AbstractEntityListPanel.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
private AbstractLayout buildToolbar() {
// .withFullWidth();
MHorizontalLayout layout = new MHorizontalLayout().withSpacing(true).withStyleName("toolbar").withDefaultComponentAlignment(Alignment.BOTTOM_LEFT);
layout.add(addButton);
layout.add(editButton);
layout.add(deleteButton);
layout.add(searchButton);
searchButton.setVisible(false);
layout.add(exportDataDownloadButton);
addButtonsToToolbar(layout);
boolean addSpacer = true;
Iterator<Component> iter = layout.iterator();
while (iter.hasNext()) {
Component c = iter.next();
if (layout.getExpandRatio(c) > 0) {
addSpacer = false;
break;
}
}
if (addSpacer) {
MLabel spacerLabel = new MLabel().withStyleName(ValoTheme.LABEL_NO_MARGIN);
layout.addComponent(spacerLabel);
layout.setExpandRatio(spacerLabel, 1);
}
// localize...
localizeRecursively(layout);
VaadinUtils.applyStyleRecursively(layout, "small");
return layout;
}
0
Source : AbstractDashboardView.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
private Component buildDashlet(final Component content) {
final CssLayout slot = new CssLayout();
slot.setWidth("100%");
slot.addStyleName("dashboard-panel-slot");
CssLayout card = new CssLayout();
card.setWidth("100%");
card.addStyleName(ValoTheme.LAYOUT_CARD);
MHorizontalLayout toolbar = new MHorizontalLayout();
toolbar.addStyleName("dashboard-panel-toolbar");
toolbar.setWidth("100%");
Label caption = new Label(content.getCaption());
caption.addStyleName(ValoTheme.LABEL_H4);
caption.addStyleName(ValoTheme.LABEL_COLORED);
caption.addStyleName(ValoTheme.LABEL_NO_MARGIN);
content.setCaption(null);
MenuBar tools = new MenuBar();
tools.addStyleName(ValoTheme.MENUBAR_BORDERLESS);
MenuItem max = tools.addItem("", FontAwesome.EXPAND, new Command() {
@Override
public void menuSelected(final MenuItem selectedItem) {
if (!slot.getStyleName().contains("max")) {
selectedItem.setIcon(FontAwesome.COMPRESS);
toggleMaximized(slot, true);
} else {
slot.removeStyleName("max");
selectedItem.setIcon(FontAwesome.EXPAND);
toggleMaximized(slot, false);
}
}
});
max.setStyleName("icon-only");
MenuItem root = tools.addItem("", FontAwesome.ELLIPSIS_V, null);
root.addItem("Configure", new Command() {
@Override
public void menuSelected(final MenuItem selectedItem) {
Notification.show("Not implemented in this demo");
}
});
root.addSeparator();
root.addItem("Close", new Command() {
@Override
public void menuSelected(final MenuItem selectedItem) {
Notification.show("Not implemented in this demo");
}
});
toolbar.addComponents(caption, tools);
toolbar.setExpandRatio(caption, 1);
toolbar.setComponentAlignment(caption, Alignment.MIDDLE_LEFT);
card.addComponents(toolbar, content);
slot.addComponent(card);
return slot;
}
0
Source : MetroStyleDashboardPanel.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
private void generateTiles(CssLayout mainLayout, Collection<TRMenuItem> menuItems) {
Iterator<TRMenuItem> iter = menuItems.iterator();
// MHorizontalLayout rowLayout = new MHorizontalLayout();
Random random = new Random(menuItems.size());
Random colorRandom = new Random(System.currentTimeMillis());
Set<Integer> colorUsedSet = new HashSet<>();
int tileCount = 0;
int color = 0;
int maxColors = 8;
int lastColor = 0;
while (iter.hasNext()) {
TRMenuItem menuItem = iter.next();
MPanel panel = new MPanel();
Image icon = new Image(null, menuItem.icon());
// MLabel icon = new MLabel().withStyleName(ValoTheme.LABEL_NO_MARGIN, "tile-icon").withWidthUndefined();
// icon.setIcon(menuItem.icon());
icon.setWidth("52px");
MLabel label = new MLabel(menuItem.caption()).withStyleName(ValoTheme.LABEL_NO_MARGIN, ValoTheme.LABEL_BOLD).withWidthUndefined();
MVerticalLayout iconLabelLayout = new MVerticalLayout(icon, label).withMargin(true);
iconLabelLayout.setComponentAlignment(icon, Alignment.TOP_CENTER);
iconLabelLayout.setComponentAlignment(label, Alignment.BOTTOM_CENTER);
iconLabelLayout.setExpandRatio(label, 1);
iconLabelLayout.setHeight("120px");
panel.setContent(iconLabelLayout);
panel.addClickListener(event -> {
if (menuItem.hasChildren()) {
mainLayout.removeAllComponents();
List<TRMenuItem> subMenuItems = new ArrayList<>(menuItem.getChildren());
TRSimpleMenuItem backMenuItem = TRSimpleMenuItem.createMenuItem("Back", GrapheneeTheme.BACK_ICON, event2 -> {
mainLayout.removeAllComponents();
if (menuItem.getParent() != null) {
generateTiles(mainLayout, menuItem.getParent().getChildren());
} else {
generateTiles(mainLayout, dashboardSetup.menuItems());
}
});
subMenuItems.add(0, backMenuItem);
generateTiles(mainLayout, subMenuItems);
} else {
if (menuItem.viewName() != null)
UI.getCurrent().getNavigator().navigateTo(menuItem.viewName());
else
UI.getCurrent().getNavigator().navigateTo(dashboardSetup.dashboardViewName());
}
});
// random.nextInt(2) + 1;
int value = 1;
if (colorUsedSet.size() == maxColors) {
colorUsedSet.clear();
}
do {
color = colorRandom.nextInt(maxColors) + 1;
} while (colorUsedSet.contains(color) || color == lastColor);
colorUsedSet.add(color);
lastColor = color;
// if (value + tileCount == 5) {
// value = 1;
// }
// tileCount += value;
// System.err.print(value + ",");
panel.setStyleName("metro-tile");
panel.addStyleName("metro-tile-" + value);
panel.addStyleName(GrapheneeTheme.STYLE_MARGIN_TOP);
panel.addStyleName(GrapheneeTheme.STYLE_MARGIN_LEFT);
panel.setWidth(value == 1 ? "120px" : "250px");
panel.setHeight("120px");
if (shouldShowColoredTiles()) {
panel.addStyleName("color-" + color);
} else {
panel.addStyleName("color-default");
}
mainLayout.addComponent(panel);
// rowLayout.add(panel);
// if (tileCount >= maxTileCount) {
// mainLayout.add(rowLayout);
// rowLayout = new MHorizontalLayout();
// tileCount = 0;
// // System.err.println();
// }
}
// mainLayout.add(rowLayout);
}