本文整理了Java中com.vaadin.v7.ui.Table.getValue()
方法的一些代码示例,展示了Table.getValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getValue()
方法的具体详情如下:
包路径:com.vaadin.v7.ui.Table
类名称:Table
方法名:getValue
暂无
代码示例来源:origin: viritin/viritin
@Override
public T getValue() {
return (T) super.getValue();
}
代码示例来源:origin: com.haulmont.cuba/cuba-web
@SuppressWarnings("unchecked")
@Nullable
protected Set<Object> getSelectedItemIds() {
Object value = component.getValue();
if (value == null) {
return null;
} else if (value instanceof Set) {
return (Set) value;
} else if (value instanceof Collection) {
return new LinkedHashSet((Collection) value);
} else {
return Collections.singleton(value);
}
}
代码示例来源:origin: OpenNMS/opennms
@Override
public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
boolean somethingSelected = (rowsTable.getValue() != null);
rowsRemoveButton.setEnabled(somethingSelected);
rowsEditButton.setEnabled(somethingSelected);
rowsAddButton.setEnabled(true);
rowUpButton.setEnabled(somethingSelected && rowOrder.get(rowsTable.getValue()).intValue() > 0);
rowDownButton.setEnabled(somethingSelected && rowOrder.get(rowsTable.getValue()).intValue() < rowOrder.size() - 1);
}
});
代码示例来源:origin: OpenNMS/opennms
@Override
public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
boolean somethingSelected = (columnsTable.getValue() != null);
columnsRemoveButton.setEnabled(somethingSelected);
columnsEditButton.setEnabled(somethingSelected);
columnsAddButton.setEnabled(true);
columnUpButton.setEnabled(somethingSelected && columnOrder.get(columnsTable.getValue()).intValue() > 0);
columnDownButton.setEnabled(somethingSelected && columnOrder.get(columnsTable.getValue()).intValue() < columnOrder.size() - 1);
}
});
代码示例来源:origin: com.vaadin/vaadin-compatibility-server
private String[] findSelectedKeys() {
LinkedList<String> selectedKeys = new LinkedList<String>();
if (isMultiSelect()) {
HashSet<?> sel = new HashSet<Object>((Set<?>) getValue());
Collection<?> vids = getVisibleItemIds();
for (Object id : vids) {
if (sel.contains(id)) {
selectedKeys.add(itemIdMapper.key(id));
}
}
} else {
Object value = getValue();
if (value == null) {
value = getNullSelectionItemId();
}
if (value != null) {
selectedKeys.add(itemIdMapper.key(value));
}
}
return selectedKeys.toArray(new String[selectedKeys.size()]);
}
代码示例来源:origin: OpenNMS/opennms
@Override
public void buttonClick(Button.ClickEvent clickEvent) {
ColumnDef columnDef = (ColumnDef) columnsTable.getValue();
if (columnDef != null) {
int columnDefIndex = columnOrder.get(columnDef);
ColumnDef columnDefToSwap = null;
for (Map.Entry<ColumnDef, Integer> entry : columnOrder.entrySet()) {
if (entry.getValue().intValue() == columnDefIndex - 1) {
columnDefToSwap = entry.getKey();
break;
}
}
if (columnDefToSwap != null) {
columnsTable.unselect(columnDef);
columnOrder.remove(columnDef);
columnOrder.remove(columnDefToSwap);
columnOrder.put(columnDef, columnDefIndex - 1);
columnOrder.put(columnDefToSwap, columnDefIndex);
columns.sort(new Object[]{"label"}, new boolean[]{true});
columnsTable.refreshRowCache();
columnsTable.select(columnDef);
}
}
}
});
代码示例来源:origin: OpenNMS/opennms
@Override
public void buttonClick(Button.ClickEvent clickEvent) {
ColumnDef columnDef = (ColumnDef) columnsTable.getValue();
if (columnDef != null) {
int columnDefIndex = columnOrder.get(columnDef);
ColumnDef columnDefToSwap = null;
for (Map.Entry<ColumnDef, Integer> entry : columnOrder.entrySet()) {
if (entry.getValue().intValue() == columnDefIndex + 1) {
columnDefToSwap = entry.getKey();
break;
}
}
if (columnDefToSwap != null) {
columnsTable.unselect(columnDef);
columnOrder.remove(columnDef);
columnOrder.remove(columnDefToSwap);
columnOrder.put(columnDef, columnDefIndex + 1);
columnOrder.put(columnDefToSwap, columnDefIndex);
columns.sort(new Object[]{"label"}, new boolean[]{true});
columnsTable.refreshRowCache();
columnsTable.select(columnDef);
}
}
}
});
代码示例来源:origin: OpenNMS/opennms
@Override
public void buttonClick(Button.ClickEvent clickEvent) {
RowDef rowDef = (RowDef) rowsTable.getValue();
if (rowDef != null) {
int rowDefIndex = rowOrder.get(rowDef);
RowDef rowDefToSwap = null;
for (Map.Entry<RowDef, Integer> entry : rowOrder.entrySet()) {
if (entry.getValue().intValue() == rowDefIndex - 1) {
rowDefToSwap = entry.getKey();
break;
}
}
if (rowDefToSwap != null) {
rowsTable.unselect(rowDef);
rowOrder.remove(rowDef);
rowOrder.remove(rowDefToSwap);
rowOrder.put(rowDef, rowDefIndex - 1);
rowOrder.put(rowDefToSwap, rowDefIndex);
rows.sort(new Object[]{"label"}, new boolean[]{true});
rowsTable.refreshRowCache();
rowsTable.select(rowDef);
}
}
}
});
代码示例来源:origin: OpenNMS/opennms
@Override
public void buttonClick(Button.ClickEvent clickEvent) {
ColumnDef columnDef = (ColumnDef) columnsTable.getValue();
if (columnDef != null) {
columnsTable.unselect(columnDef);
columns.removeItem(columnDef);
}
columnsTable.refreshRowCache();
}
});
代码示例来源:origin: OpenNMS/opennms
@Override
public void buttonClick(Button.ClickEvent clickEvent) {
RowDef rowDef = (RowDef) rowsTable.getValue();
if (rowDef != null) {
rowsTable.unselect(rowDef);
rows.removeItem(rowDef);
}
rowsTable.refreshRowCache();
}
});
代码示例来源:origin: OpenNMS/opennms
/**
* Delete handler.
*/
private void deleteHandler() {
final Object itemId = table.getValue();
if (itemId == null) {
Notification.show("Please select a IncludeCollection from the table.");
return;
}
ConfirmDialog.show(getUI(),
"Are you sure?",
"Do you really want to remove the selected Include Collection field?\nThis action cannot be undone.",
"Yes",
"No",
new ConfirmDialog.Listener() {
public void onClose(ConfirmDialog dialog) {
if (dialog.isConfirmed()) {
table.removeItem(itemId);
}
}
});
}
代码示例来源:origin: OpenNMS/opennms
/**
* Delete handler.
*/
private void deleteHandler() {
final Object itemId = table.getValue();
if (itemId == null) {
Notification.show("Please select a Varbind Decode from the table.");
} else {
ConfirmDialog.show(getUI(),
"Are you sure?",
"Do you really want to remove the selected Varbinds Decode field?\nThis action cannot be undone.",
"Yes",
"No",
new ConfirmDialog.Listener() {
public void onClose(ConfirmDialog dialog) {
if (dialog.isConfirmed()) {
table.removeItem(itemId);
}
}
});
}
}
代码示例来源:origin: OpenNMS/opennms
/**
* Delete handler.
*/
private void deleteHandler() {
final Object itemId = table.getValue();
if (itemId == null) {
Notification.show("Please select a Mask Element from the table.");
} else {
ConfirmDialog.show(getUI(),
"Are you sure?",
"Do you really want to remove the selected Mask Element field ?\nThis action cannot be undone.",
"Yes",
"No",
new ConfirmDialog.Listener() {
public void onClose(ConfirmDialog dialog) {
if (dialog.isConfirmed()) {
table.removeItem(itemId);
}
}
});
}
}
代码示例来源:origin: OpenNMS/opennms
/**
* Delete handler.
*/
private void deleteHandler() {
final Object itemId = table.getValue();
if (itemId == null) {
Notification.show("Please select a RRA from the table.");
} else {
ConfirmDialog.show(getUI(),
"Are you sure?",
"Do you really want to remove the selected RRA?\nThis action cannot be undone.",
"Yes",
"No",
new ConfirmDialog.Listener() {
public void onClose(ConfirmDialog dialog) {
if (dialog.isConfirmed()) {
table.removeItem(itemId);
}
}
});
}
}
代码示例来源:origin: OpenNMS/opennms
/**
* Delete handler.
*/
private void deleteHandler() {
final Object itemId = table.getValue();
if (itemId == null) {
Notification.show("Please select a Mask Varbind from the table.");
} else {
ConfirmDialog.show(getUI(),
"Are you sure?",
"Do you really want to remove the selected Mask Varbind field?\nThis action cannot be undone.",
"Yes",
"No",
new ConfirmDialog.Listener() {
public void onClose(ConfirmDialog dialog) {
if (dialog.isConfirmed()) {
table.removeItem(itemId);
}
}
});
}
}
}
代码示例来源:origin: OpenNMS/opennms
/**
* Delete handler.
*/
private void deleteHandler() {
final Object itemId = table.getValue();
if (itemId == null) {
Notification.show("Please select a MIB Object from the table.");
} else {
ConfirmDialog.show(getUI(),
"Are you sure?",
"Do you really want to remove the selected MIB Object?\nThis action cannot be undone.",
"Yes",
"No",
new ConfirmDialog.Listener() {
public void onClose(ConfirmDialog dialog) {
if (dialog.isConfirmed()) {
table.removeItem(itemId);
}
}
});
}
}
代码示例来源:origin: OpenNMS/opennms
/**
* Delete handler.
*/
private void deleteHandler() {
final Object itemId = table.getValue();
if (itemId == null) {
Notification.show("Please select a Parameter from the table.");
} else {
ConfirmDialog.show(getUI(),
"Are you sure?",
"Do you really want to remove the selected parameter from the strategy?\nThis action cannot be undone.",
"Yes",
"No",
new ConfirmDialog.Listener() {
public void onClose(ConfirmDialog dialog) {
if (dialog.isConfirmed()) {
table.removeItem(itemId);
}
}
});
}
}
代码示例来源:origin: OpenNMS/opennms
@Override
public void buttonClick(ClickEvent event) {
final Object value = table.getValue();
if (value == null) {
Notification.show("Please select a IncludeCollection from the table.");
return;
}
IncludeCollectionWindow w = new IncludeCollectionWindow(dataCollectionConfigDao, container, container.getOnmsBean(value)) {
@Override
public void fieldChanged() {}
};
getUI().addWindow(w);
}
});
代码示例来源:origin: OpenNMS/opennms
@Override
public void buttonClick(Button.ClickEvent clickEvent) {
getUI().addWindow(new SurveillanceViewConfigurationCategoryWindow(surveillanceViewService, columnsTable.getItemIds(), (ColumnDef) columnsTable.getValue(), new SurveillanceViewConfigurationCategoryWindow.SaveActionListener() {
@Override
public void save(Def def) {
ColumnDef columnToBeReplaced = (ColumnDef) columnsTable.getValue();
int index = columnOrder.get(columnToBeReplaced);
columns.removeItem(columnToBeReplaced);
columnOrder.remove(columnToBeReplaced);
columns.addItem((ColumnDef) def);
columnOrder.put((ColumnDef) def, index);
columns.sort(new Object[]{"label"}, new boolean[]{true});
columnsTable.refreshRowCache();
}
}));
}
});
代码示例来源:origin: OpenNMS/opennms
@Override
public void buttonClick(Button.ClickEvent clickEvent) {
getUI().addWindow(new SurveillanceViewConfigurationCategoryWindow(surveillanceViewService, rowsTable.getItemIds(), (RowDef) rowsTable.getValue(), new SurveillanceViewConfigurationCategoryWindow.SaveActionListener() {
@Override
public void save(Def def) {
RowDef rowToBeReplaced = (RowDef) rowsTable.getValue();
int index = rowOrder.get(rowToBeReplaced);
rows.removeItem(rowToBeReplaced);
rowOrder.remove(rowToBeReplaced);
rows.addItem((RowDef) def);
rowOrder.put((RowDef) def, index);
rows.sort(new Object[]{"label"}, new boolean[]{true});
rowsTable.refreshRowCache();
}
}));
}
});
内容来源于网络,如有侵权,请联系作者删除!