use of com.vaadin.ui.CssLayout in project VaadinUtils by rlsutton1.
the class BaseCrudView method buildSearchBar.
private void buildSearchBar() {
AbstractLayout group = new HorizontalLayout();
if (UI.getCurrent().getTheme().equals(ValoTheme.class.getSimpleName())) {
group = new CssLayout();
group.addStyleName("v-component-group");
}
group.setSizeFull();
searchLayout.addComponent(group);
AbstractLayout advancedSearch = buildAdvancedSearch();
if (advancedSearch != null) {
group.addComponent(advancedSearchButton);
}
Button clear = createClearButton();
group.addComponent(clear);
group.addComponent(createRefreshButton());
// searchField.setWidth("80%");
searchField.setId("CrudSearchField");
group.addComponent(searchField);
if (group instanceof HorizontalLayout) {
((HorizontalLayout) group).setExpandRatio(searchField, 1);
}
group.addComponent(searchButton);
searchButton.addClickListener(new ClickListener() {
private static final long serialVersionUID = 1L;
@Override
public void buttonClick(ClickEvent event) {
triggerFilter();
}
});
searchButton.setVisible(!dynamicSearch);
final OnEnterKeyHandler onEnterKeyHandler = new OnEnterKeyHandler() {
@Override
public void enterKeyPressed() {
if (!dynamicSearch) {
searchButton.click();
}
}
};
onEnterKeyHandler.attachTo(searchField);
}
use of com.vaadin.ui.CssLayout in project charts by vaadin.
the class ChartsDemoUI method init.
@Override
protected void init(VaadinRequest request) {
initGATracker();
tabSheet = new TabSheet();
tabSheet.addSelectedTabChangeListener(new TabSheet.SelectedTabChangeListener() {
@Override
public void selectedTabChange(TabSheet.SelectedTabChangeEvent event) {
com.vaadin.ui.JavaScript.eval("setTimeout(function(){prettyPrint();},300);");
}
});
tabSheet.setSizeFull();
tabSheet.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);
Link homepage = new Link("Home Page", new ExternalResource("https://vaadin.com/components/vaadin-charts"));
Link javadoc = new Link("JavaDoc", new ExternalResource("https://vaadin.com/api/com.vaadin/vaadin-charts/" + getVersion() + "/"));
Link manual = new Link("Manual", new ExternalResource("https://vaadin.com/docs/v8/charts/charts-overview.html"));
Link pricing = new Link("Pricing", new ExternalResource("https://vaadin.com/pricing"));
Label version = new Label("Version " + getVersion());
version.addStyleName("version");
HorizontalLayout links = new HorizontalLayout(homepage, pricing, javadoc, manual);
links.setSpacing(true);
links.addStyleName("links");
final HorizontalSplitPanel horizontalSplitPanel = new HorizontalSplitPanel();
horizontalSplitPanel.setSecondComponent(tabSheet);
horizontalSplitPanel.setSplitPosition(300, Unit.PIXELS);
horizontalSplitPanel.addStyleName("main-layout");
ChartOptions.get().setTheme(new ValoLightTheme());
themeSelector = new ComboBox("Charts Theme:");
themeSelector.addStyleName("theme-selector");
themeSelector.addStyleName(ValoTheme.COMBOBOX_SMALL);
themeSelector.setTextInputAllowed(false);
com.vaadin.addon.charts.model.style.Theme defaultTheme = new ValoLightTheme();
Map<com.vaadin.addon.charts.model.style.Theme, String> mapThemes = new HashMap<>();
com.vaadin.addon.charts.model.style.Theme[] themes = new com.vaadin.addon.charts.model.style.Theme[] { defaultTheme, new ValoDarkTheme(), new VaadinTheme(), new HighChartsDefaultTheme(), new GridTheme(), new GrayTheme(), new SkiesTheme() };
mapThemes.put(themes[0], "Valo Light");
mapThemes.put(themes[1], "Valo Dark");
mapThemes.put(themes[2], "Vaadin");
mapThemes.put(themes[3], "HighCharts");
mapThemes.put(themes[4], "Grid");
mapThemes.put(themes[5], "Gray");
mapThemes.put(themes[6], "Skies");
themeSelector.setEmptySelectionAllowed(false);
themeSelector.setItems(themes);
themeSelector.setSelectedItem(defaultTheme);
themeSelector.setItemCaptionGenerator(mapThemes::get);
themeSelector.addSelectionListener(e -> {
ChartOptions.get().setTheme(e.getValue());
});
final HierarchicalContainer container = getContainer();
VerticalLayout content = new VerticalLayout();
content.setSpacing(true);
content.setMargin(false);
Label logo = new Label("Vaadin Charts for Vaadin 8");
logo.setWidth("100%");
logo.addStyleName("h3");
logo.addStyleName("logo");
TextField filterField = new TextField();
filterField.setPlaceholder("Filter examples");
filterField.setIcon(FontAwesome.SEARCH);
filterField.addStyleName("filter");
filterField.setWidth("100%");
filterField.addValueChangeListener(e -> {
container.removeAllContainerFilters();
String text = e.getValue();
if (text != null && !text.isEmpty()) {
expandForFiltering();
container.addContainerFilter("searchName", text, true, false);
} else {
restoreExpandedStates();
}
});
tree = new Tree();
tree.setImmediate(true);
tree.setContainerDataSource(container);
tree.setItemCaptionPropertyId("displayName");
tree.setNullSelectionAllowed(false);
tree.setWidth("100%");
tree.addValueChangeListener(new Property.ValueChangeListener() {
@Override
public void valueChange(Property.ValueChangeEvent event) {
Object value = event.getProperty().getValue();
if (value instanceof Class) {
updateTabSheet((Class) value);
} else {
tree.expandItemsRecursively(value);
}
}
});
Button trial = new Button("Start Free Trial");
trial.addStyleName(ValoTheme.BUTTON_PRIMARY);
trial.addStyleName(ValoTheme.BUTTON_TINY);
trial.addClickListener(e -> {
getUI().getPage().open("https://vaadin.com/trial", "_blank");
});
content.addComponents(logo, links, trial, filterField, tree, version);
content.setComponentAlignment(trial, Alignment.MIDDLE_CENTER);
horizontalSplitPanel.setFirstComponent(content);
selectItem();
Page.getCurrent().addUriFragmentChangedListener(new Page.UriFragmentChangedListener() {
@Override
public void uriFragmentChanged(Page.UriFragmentChangedEvent event) {
selectItem();
}
});
setContent(new CssLayout() {
{
setSizeFull();
addComponent(horizontalSplitPanel);
addComponent(themeSelector);
}
});
if (tracker != null) {
tracker.trackPageview("/charts");
}
}
use of com.vaadin.ui.CssLayout in project Activiti by Activiti.
the class MainLayout method initFooter.
protected void initFooter() {
footer = new CssLayout();
footer.setWidth(100, UNITS_PERCENTAGE);
footer.addStyleName(ExplorerLayout.STYLE_MAIN_FOOTER);
addComponent(footer);
Label footerLabel = new Label();
footerLabel.setContentMode(Label.CONTENT_XHTML);
footerLabel.setValue(i18nManager.getMessage(Messages.FOOTER_MESSAGE));
footerLabel.setWidth(100, UNITS_PERCENTAGE);
footer.addComponent(footerLabel);
}
use of com.vaadin.ui.CssLayout in project Activiti by Activiti.
the class TaskListHeader method initInputField.
protected void initInputField() {
// Csslayout is used to style inputtext as rounded
CssLayout csslayout = new CssLayout();
csslayout.setHeight(24, UNITS_PIXELS);
csslayout.setWidth(100, UNITS_PERCENTAGE);
layout.addComponent(csslayout);
inputField = new TextField();
inputField.setWidth(100, UNITS_PERCENTAGE);
inputField.addStyleName(ExplorerLayout.STYLE_SEARCHBOX);
inputField.setInputPrompt(i18nManager.getMessage(Messages.TASK_CREATE_NEW));
inputField.focus();
csslayout.addComponent(inputField);
layout.setComponentAlignment(csslayout, Alignment.MIDDLE_LEFT);
layout.setExpandRatio(csslayout, 1.0f);
}
use of com.vaadin.ui.CssLayout in project cuba by cuba-platform.
the class CubaCurrencyField method initLayout.
protected void initLayout() {
container = new CssLayout();
container.setSizeFull();
container.setPrimaryStyleName(CURRENCYFIELD_LAYOUT_STYLENAME);
container.addComponent(currencyLabel);
if (useWrapper()) {
ie9InputWrapper = new CssLayout(textField);
ie9InputWrapper.setSizeFull();
ie9InputWrapper.setPrimaryStyleName(IE9_INPUT_WRAP_STYLENAME);
container.addComponent(ie9InputWrapper);
} else {
container.addComponent(textField);
}
setFocusDelegate(textField);
}
Aggregations