本文整理汇总了Java中com.vaadin.ui.Table类的典型用法代码示例。如果您正苦于以下问题:Java Table类的具体用法?Java Table怎么用?Java Table使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Table类属于com.vaadin.ui包,在下文中一共展示了Table类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTable
import com.vaadin.ui.Table; //导入依赖的package包/类
private Table createTable() {
Table table = new Table();
table.setSizeFull();
table.setPageLength(0);
table.setSelectable(false);
table.setColumnCollapsingAllowed(true);
table.setColumnReorderingAllowed(true);
table.setImmediate(true);
table.setNullSelectionAllowed(false);
table.setColumnHeaderMode(Table.ColumnHeaderMode.HIDDEN);
table.addContainerProperty("Name", String.class, null);
table.addContainerProperty("Value", String.class, null);
// initializing email table with empty values
table.addItem(new Object[] { "Outgoing Mail Server (SMTP): ", "" }, new Integer(1));
table.addItem(new Object[] { "Port: ", "" }, new Integer(2));
table.addItem(new Object[] { "Email Id: ", "" }, new Integer(3));
return table;
}
示例2: getFilterButtonDropHandler
import com.vaadin.ui.Table; //导入依赖的package包/类
@Override
protected DropHandler getFilterButtonDropHandler() {
return new DropHandler() {
private static final long serialVersionUID = 1L;
@Override
public AcceptCriterion getAcceptCriterion() {
return managementViewClientCriterion;
}
@Override
public void drop(final DragAndDropEvent event) {
if (validate(event) && isNoTagAssigned(event)) {
final TableTransferable tbl = (TableTransferable) event.getTransferable();
final Table source = tbl.getSourceComponent();
if (source.getId().equals(UIComponentIdProvider.TARGET_TABLE_ID)) {
UI.getCurrent().access(() -> processTargetDrop(event));
}
}
}
};
}
示例3: getStyle
import com.vaadin.ui.Table; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public String getStyle(Table source, final Object itemId, final Object propertyId) {
return requireDataSource().get(itemId).map(i -> {
if (propertyId == null) {
// row style
if (!rowStyleGenerators.isEmpty()) {
return generateRowStyle(i);
}
} else {
// property (cell) style
return generatePropertyStyle((P) propertyId, i);
}
return null;
}).orElse(null);
}
示例4: addBooleanColumn
import com.vaadin.ui.Table; //导入依赖的package包/类
/** Ajoute une case a cocher a la place de O et N
* @param property
*/
public void addBooleanColumn(String property, Boolean alignCenter){
addGeneratedColumn(property, new Table.ColumnGenerator() {
/**serialVersionUID**/
private static final long serialVersionUID = -3483685206189347289L;
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
try {
Object value = PropertyUtils.getProperty(itemId,(String)columnId);
if (value instanceof Boolean){
return new IconLabel((Boolean)value,alignCenter);
}else{
return value;
}
} catch (Exception e) {
return null;
}
}
});
}
示例5: getOptionTable
import com.vaadin.ui.Table; //导入依赖的package包/类
@SuppressWarnings("serial")
protected Panel getOptionTable() {
this.optionTable = new Table();
this.optionTable.setPageLength(3);
this.optionTable.setSizeFull();
this.optionTable.setImmediate(true);
this.optionTable.addGeneratedColumn("Enabled", new CheckBoxGenerator());
this.optionTable.addContainerProperty("Name", String.class, null);
this.optionTable.addItemClickListener(new ItemClickListener() {
@Override
public void itemClick(ItemClickEvent event) {
optionTableClicked(event);
}
});
this.optionPanel = new Panel();
this.optionPanel.addStyleName(StyleConstants.FORM_PANEL);
this.optionPanel.setWidth(100, Sizeable.Unit.PERCENTAGE);
this.optionPanel.setContent(this.optionTable);
return this.optionPanel;
}
示例6: colorizeValidUntilRows
import com.vaadin.ui.Table; //导入依赖的package包/类
private void colorizeValidUntilRows() {
final Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH, this.CERT_MONTHLY_THRESHOLD);
this.sslConfigTable.setCellStyleGenerator((Table.CellStyleGenerator) (table, itemId, propertyId) -> {
if (propertyId != null) {
return null;
}
Item item = this.sslConfigTable.getItem(itemId);
Date validUntil = (Date) item.getItemProperty("Valid until").getValue();
if (validUntil.before(calendar.getTime())) {
return "highlight-warning";
} else {
return null;
}
});
}
示例7: createNetworkTable
import com.vaadin.ui.Table; //导入依赖的package包/类
private Table createNetworkTable() {
Table table = new Table();
table.setSizeFull();
table.setPageLength(0);
table.setSelectable(false);
table.setColumnCollapsingAllowed(true);
table.setColumnReorderingAllowed(true);
table.setImmediate(true);
table.setNullSelectionAllowed(false);
table.setColumnHeaderMode(Table.ColumnHeaderMode.HIDDEN);
table.addContainerProperty("Name", String.class, null);
table.addContainerProperty("Value", String.class, null);
// initializing network table with empty values
table.addItem(new Object[] { "IPv4 Address: ", "" }, new Integer(1));
table.addItem(new Object[] { "Netmask:", "" }, new Integer(2));
table.addItem(new Object[] { "Default Gateway: ", "" }, new Integer(3));
table.addItem(new Object[] { "Primary DNS Server: ", "" }, new Integer(4));
table.addItem(new Object[] { "Secondary DNS Server: ", "" }, new Integer(5));
return table;
}
示例8: createNATTable
import com.vaadin.ui.Table; //导入依赖的package包/类
private Table createNATTable() {
Table table = new Table();
table.setSizeFull();
table.setPageLength(0);
table.setSelectable(false);
table.setColumnCollapsingAllowed(true);
table.setColumnReorderingAllowed(true);
table.setImmediate(true);
table.setNullSelectionAllowed(false);
table.setColumnHeaderMode(Table.ColumnHeaderMode.HIDDEN);
table.addContainerProperty("Name", String.class, null);
table.addContainerProperty("Value", String.class, null);
// initializing network table with empty values
table.addItem(new Object[] { "Public IPv4 Address: ", "" }, new Integer(1));
return table;
}
示例9: addCommonTableItems
import com.vaadin.ui.Table; //导入依赖的package包/类
private void addCommonTableItems(Table statusTable) {
statusTable.setImmediate(true);
statusTable.setStyleName(ValoTheme.TABLE_COMPACT);
statusTable.addContainerProperty("Property", String.class, "");
statusTable.addContainerProperty("Value", String.class, "");
statusTable.setColumnHeaderMode(Table.ColumnHeaderMode.HIDDEN);
statusTable.setPageLength(0);
statusTable.setReadOnly(true);
statusTable.addItem(new Object[] { "Name: ", "" }, new Integer(1));
statusTable.addItem(new Object[] { "Local IP: ", "" }, new Integer(2));
statusTable.addItem(new Object[] { "Public IP: ", "" }, new Integer(3));
statusTable.addItem(new Object[] { "V.Server: ", "" }, new Integer(4));
statusTable.addItem(new Object[] { "Manager IP: ", "" }, new Integer(5));
}
示例10: getAttributesPanel
import com.vaadin.ui.Table; //导入依赖的package包/类
protected Panel getAttributesPanel() {
this.sharedKey = new PasswordField();
this.sharedKey.setRequiredError("shared secret key cannot be empty");
this.sharedKey.setRequired(true);
// best show/hide this conditionally based on Manager type.
this.sharedKey.setValue("dummy1234");
this.attributes = new Table();
this.attributes.setPageLength(0);
this.attributes.setSelectable(true);
this.attributes.setSizeFull();
this.attributes.setImmediate(true);
this.attributes.addContainerProperty("Attribute Name", String.class, null);
this.attributes.addContainerProperty("Value", PasswordField.class, null);
this.attributes.addItem(new Object[] { "Shared Secret key", this.sharedKey }, new Integer(1));
// creating panel to store attributes table
this.attributePanel = new Panel("Common Appliance Configuration Attributes:");
this.attributePanel.addStyleName("form_Panel");
this.attributePanel.setWidth(100, Sizeable.Unit.PERCENTAGE);
this.attributePanel.setContent(this.attributes);
return this.attributePanel;
}
示例11: TableReporteConductores
import com.vaadin.ui.Table; //导入依赖的package包/类
public TableReporteConductores() {
this.setSizeFull();
this.setSelectable(true);
this.setMultiSelect(true);
this.setImmediate(true);
setColumnHeaderMode(Table.ColumnHeaderMode.EXPLICIT);
addContainerProperty("nroConductor", String.class, null);
setColumnHeader("nroConductor", "Nro Conductor");
setColumnAlignment("nroConductor", Table.Align.CENTER);
setVisibleColumns(new Object[] { "nroConductor" });
setColumnReorderingAllowed(true);
setColumnCollapsingAllowed(true);
setHeight(40.0f, Unit.PERCENTAGE);
}
示例12: handleAction
import com.vaadin.ui.Table; //导入依赖的package包/类
@Override
public void handleAction(final Action action, final Object sender,
final Object target) {
if (action == report) {
createNewReportFromSelection();
} else if (action == discard) {
Notification.show("Not implemented in this demo");
} else if (action == details) {
Item item = ((Table) sender).getItem(target);
if (item != null) {
Long movieId = (Long) item.getItemProperty("movieId")
.getValue();
MovieDetailsWindow.open(DashboardUI.getDataProvider()
.getMovie(movieId), null, null);
}
}
}
示例13: generateUi
import com.vaadin.ui.Table; //导入依赖的package包/类
private void generateUi() {
logger.debug("GenerateUi aufgerufen");
headerLabel = new Label("Direkte Eingabe der Cash-Flows (in EUR)");
gap = new Label();
inputTable = new Table();
expandingGap = new Label();
headerLabel.setStyleName("periodHeaderLabel");
gap.setHeight("15px");
inputTable.setWidth(100, UNITS_PERCENTAGE);
inputTable.setStyleName("fcfTable");
inputTable.setPageLength(3);
expandingGap.setHeight(100, UNITS_PERCENTAGE);
addComponent(headerLabel);
addComponent(gap);
addComponent(inputTable);
addComponent(expandingGap);
setExpandRatio(expandingGap, 1.0f);
}
示例14: convertColumnAlignment
import com.vaadin.ui.Table; //导入依赖的package包/类
public static Table.Align convertColumnAlignment(com.haulmont.cuba.gui.components.Table.ColumnAlignment alignment) {
if (alignment == null) {
return null;
}
switch (alignment) {
case LEFT:
return Table.Align.LEFT;
case CENTER:
return Table.Align.CENTER;
case RIGHT:
return Table.Align.RIGHT;
default:
throw new UnsupportedOperationException();
}
}
示例15: buildMainLayout
import com.vaadin.ui.Table; //导入依赖的package包/类
@AutoGenerated
private VerticalLayout buildMainLayout() {
// common part: create layout
mainLayout = new VerticalLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("-1px");
mainLayout.setHeight("-1px");
mainLayout.setMargin(false);
mainLayout.setSpacing(true);
// top-level component properties
setWidth("-1px");
setHeight("-1px");
// tableResolvers
tableResolvers = new Table();
tableResolvers.setCaption("Resolvers");
tableResolvers.setImmediate(false);
tableResolvers.setWidth("-1px");
tableResolvers.setHeight("-1px");
mainLayout.addComponent(tableResolvers);
return mainLayout;
}