use of com.vaadin.ui.Component in project cuba by cuba-platform.
the class WebTableFieldFactory method createField.
@SuppressWarnings("unchecked")
@Override
public com.vaadin.v7.ui.Field<?> createField(com.vaadin.v7.data.Container container, Object itemId, Object propertyId, Component uiContext) {
String fieldPropertyId = String.valueOf(propertyId);
Table.Column columnConf = webTable.getColumnsInternal().get(propertyId);
TableDataContainer tableDataContainer = (TableDataContainer) container;
Entity entity = (Entity) tableDataContainer.getInternalItem(itemId);
InstanceContainer instanceContainer = webTable.getInstanceContainer((E) entity);
com.haulmont.cuba.gui.components.Component columnComponent = createField(new ContainerValueSource(instanceContainer, fieldPropertyId), fieldPropertyId, columnConf.getXmlDescriptor());
if (columnComponent instanceof Field) {
Field cubaField = (Field) columnComponent;
Map<Table.Column, String> requiredColumns = webTable.getRequiredColumnsInternal();
if (requiredColumns != null && requiredColumns.containsKey(columnConf)) {
cubaField.setRequired(true);
cubaField.setRequiredMessage(requiredColumns.get(columnConf));
}
}
if (!(columnComponent instanceof CheckBox)) {
// todo get rid of concrete CheckBox class !
columnComponent.setWidthFull();
}
if (columnComponent instanceof BelongToFrame) {
BelongToFrame belongToFrame = (BelongToFrame) columnComponent;
if (belongToFrame.getFrame() == null) {
belongToFrame.setFrame(webTable.getFrame());
}
}
applyPermissions(columnComponent);
columnComponent.setParent(webTable);
Component componentImpl = getComponentImplementation(columnComponent);
if (componentImpl instanceof com.vaadin.v7.ui.Field) {
return (com.vaadin.v7.ui.Field<?>) componentImpl;
}
return new EditableColumnFieldWrapper(componentImpl, columnComponent);
}
use of com.vaadin.ui.Component in project charts by vaadin.
the class PieChart method getChart.
@Override
protected Component getChart() {
Component ret = createChart();
ret.setWidth("100%");
ret.setHeight("450px");
return ret;
}
use of com.vaadin.ui.Component in project charts by vaadin.
the class LibraryData method setup.
@Override
protected void setup() {
searchField.addValueChangeListener(e -> {
try {
result = Helmet.search(searchField.getValue());
updateChart();
updateSearchNavi();
} catch (IOException exc) {
// TODO Auto-generated catch block
exc.printStackTrace();
}
});
searchField.setValue("orwell");
HorizontalLayout searchNavi = new HorizontalLayout();
searchNavi.addComponent(searchField);
searchNavi.addComponent(prevButton);
searchNavi.addComponent(pageLabel);
searchNavi.addComponent(nextButton);
updateSearchNavi();
searchNavi.setWidth("100%");
content = this;
Component map = getChart();
content.setSizeFull();
content.addComponent(searchNavi);
content.addComponent(map);
content.setExpandRatio(map, 1);
}
use of com.vaadin.ui.Component in project charts by vaadin.
the class SimpleChartWithDataProviderSeries method getChart.
@Override
protected Component getChart() {
HorizontalLayout lo = new HorizontalLayout();
Component table = createGrid();
DataProviderSeries<Browser> ds = createChartDS();
Component chart = createChart(ds);
table.setSizeFull();
chart.setSizeFull();
lo.setWidth("100%");
lo.setHeight("450px");
lo.addComponents(table);
lo.addComponent(chart);
return lo;
}
use of com.vaadin.ui.Component in project charts by vaadin.
the class ContainerWithLotsOfData method getChart.
@Override
protected Component getChart() {
HorizontalLayout lo = new HorizontalLayout();
ContainerDataSeries container = createContainer();
Component table = createTable(container.getVaadinContainer());
Component chart = createChart(container);
lo.addComponents(table);
lo.addComponent(chart);
table.setSizeFull();
chart.setSizeFull();
lo.setSizeFull();
lo.setExpandRatio(table, 1);
lo.setExpandRatio(chart, 5);
return lo;
}
Aggregations