com.vaadin.v7.ui.Table.getValue()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(10.2k)|赞(0)|评价(0)|浏览(421)

本文整理了Java中com.vaadin.v7.ui.Table.getValue()方法的一些代码示例,展示了Table.getValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getValue()方法的具体详情如下:
包路径:com.vaadin.v7.ui.Table
类名称:Table
方法名:getValue

Table.getValue介绍

暂无

代码示例

代码示例来源:origin: viritin/viritin

  1. @Override
  2. public T getValue() {
  3. return (T) super.getValue();
  4. }

代码示例来源:origin: com.haulmont.cuba/cuba-web

  1. @SuppressWarnings("unchecked")
  2. @Nullable
  3. protected Set<Object> getSelectedItemIds() {
  4. Object value = component.getValue();
  5. if (value == null) {
  6. return null;
  7. } else if (value instanceof Set) {
  8. return (Set) value;
  9. } else if (value instanceof Collection) {
  10. return new LinkedHashSet((Collection) value);
  11. } else {
  12. return Collections.singleton(value);
  13. }
  14. }

代码示例来源:origin: OpenNMS/opennms

  1. @Override
  2. public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
  3. boolean somethingSelected = (rowsTable.getValue() != null);
  4. rowsRemoveButton.setEnabled(somethingSelected);
  5. rowsEditButton.setEnabled(somethingSelected);
  6. rowsAddButton.setEnabled(true);
  7. rowUpButton.setEnabled(somethingSelected && rowOrder.get(rowsTable.getValue()).intValue() > 0);
  8. rowDownButton.setEnabled(somethingSelected && rowOrder.get(rowsTable.getValue()).intValue() < rowOrder.size() - 1);
  9. }
  10. });

代码示例来源:origin: OpenNMS/opennms

  1. @Override
  2. public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
  3. boolean somethingSelected = (columnsTable.getValue() != null);
  4. columnsRemoveButton.setEnabled(somethingSelected);
  5. columnsEditButton.setEnabled(somethingSelected);
  6. columnsAddButton.setEnabled(true);
  7. columnUpButton.setEnabled(somethingSelected && columnOrder.get(columnsTable.getValue()).intValue() > 0);
  8. columnDownButton.setEnabled(somethingSelected && columnOrder.get(columnsTable.getValue()).intValue() < columnOrder.size() - 1);
  9. }
  10. });

代码示例来源:origin: com.vaadin/vaadin-compatibility-server

  1. private String[] findSelectedKeys() {
  2. LinkedList<String> selectedKeys = new LinkedList<String>();
  3. if (isMultiSelect()) {
  4. HashSet<?> sel = new HashSet<Object>((Set<?>) getValue());
  5. Collection<?> vids = getVisibleItemIds();
  6. for (Object id : vids) {
  7. if (sel.contains(id)) {
  8. selectedKeys.add(itemIdMapper.key(id));
  9. }
  10. }
  11. } else {
  12. Object value = getValue();
  13. if (value == null) {
  14. value = getNullSelectionItemId();
  15. }
  16. if (value != null) {
  17. selectedKeys.add(itemIdMapper.key(value));
  18. }
  19. }
  20. return selectedKeys.toArray(new String[selectedKeys.size()]);
  21. }

代码示例来源:origin: OpenNMS/opennms

  1. @Override
  2. public void buttonClick(Button.ClickEvent clickEvent) {
  3. ColumnDef columnDef = (ColumnDef) columnsTable.getValue();
  4. if (columnDef != null) {
  5. int columnDefIndex = columnOrder.get(columnDef);
  6. ColumnDef columnDefToSwap = null;
  7. for (Map.Entry<ColumnDef, Integer> entry : columnOrder.entrySet()) {
  8. if (entry.getValue().intValue() == columnDefIndex - 1) {
  9. columnDefToSwap = entry.getKey();
  10. break;
  11. }
  12. }
  13. if (columnDefToSwap != null) {
  14. columnsTable.unselect(columnDef);
  15. columnOrder.remove(columnDef);
  16. columnOrder.remove(columnDefToSwap);
  17. columnOrder.put(columnDef, columnDefIndex - 1);
  18. columnOrder.put(columnDefToSwap, columnDefIndex);
  19. columns.sort(new Object[]{"label"}, new boolean[]{true});
  20. columnsTable.refreshRowCache();
  21. columnsTable.select(columnDef);
  22. }
  23. }
  24. }
  25. });

代码示例来源:origin: OpenNMS/opennms

  1. @Override
  2. public void buttonClick(Button.ClickEvent clickEvent) {
  3. ColumnDef columnDef = (ColumnDef) columnsTable.getValue();
  4. if (columnDef != null) {
  5. int columnDefIndex = columnOrder.get(columnDef);
  6. ColumnDef columnDefToSwap = null;
  7. for (Map.Entry<ColumnDef, Integer> entry : columnOrder.entrySet()) {
  8. if (entry.getValue().intValue() == columnDefIndex + 1) {
  9. columnDefToSwap = entry.getKey();
  10. break;
  11. }
  12. }
  13. if (columnDefToSwap != null) {
  14. columnsTable.unselect(columnDef);
  15. columnOrder.remove(columnDef);
  16. columnOrder.remove(columnDefToSwap);
  17. columnOrder.put(columnDef, columnDefIndex + 1);
  18. columnOrder.put(columnDefToSwap, columnDefIndex);
  19. columns.sort(new Object[]{"label"}, new boolean[]{true});
  20. columnsTable.refreshRowCache();
  21. columnsTable.select(columnDef);
  22. }
  23. }
  24. }
  25. });

代码示例来源:origin: OpenNMS/opennms

  1. @Override
  2. public void buttonClick(Button.ClickEvent clickEvent) {
  3. RowDef rowDef = (RowDef) rowsTable.getValue();
  4. if (rowDef != null) {
  5. int rowDefIndex = rowOrder.get(rowDef);
  6. RowDef rowDefToSwap = null;
  7. for (Map.Entry<RowDef, Integer> entry : rowOrder.entrySet()) {
  8. if (entry.getValue().intValue() == rowDefIndex - 1) {
  9. rowDefToSwap = entry.getKey();
  10. break;
  11. }
  12. }
  13. if (rowDefToSwap != null) {
  14. rowsTable.unselect(rowDef);
  15. rowOrder.remove(rowDef);
  16. rowOrder.remove(rowDefToSwap);
  17. rowOrder.put(rowDef, rowDefIndex - 1);
  18. rowOrder.put(rowDefToSwap, rowDefIndex);
  19. rows.sort(new Object[]{"label"}, new boolean[]{true});
  20. rowsTable.refreshRowCache();
  21. rowsTable.select(rowDef);
  22. }
  23. }
  24. }
  25. });

代码示例来源:origin: OpenNMS/opennms

  1. @Override
  2. public void buttonClick(Button.ClickEvent clickEvent) {
  3. ColumnDef columnDef = (ColumnDef) columnsTable.getValue();
  4. if (columnDef != null) {
  5. columnsTable.unselect(columnDef);
  6. columns.removeItem(columnDef);
  7. }
  8. columnsTable.refreshRowCache();
  9. }
  10. });

代码示例来源:origin: OpenNMS/opennms

  1. @Override
  2. public void buttonClick(Button.ClickEvent clickEvent) {
  3. RowDef rowDef = (RowDef) rowsTable.getValue();
  4. if (rowDef != null) {
  5. rowsTable.unselect(rowDef);
  6. rows.removeItem(rowDef);
  7. }
  8. rowsTable.refreshRowCache();
  9. }
  10. });

代码示例来源:origin: OpenNMS/opennms

  1. /**
  2. * Delete handler.
  3. */
  4. private void deleteHandler() {
  5. final Object itemId = table.getValue();
  6. if (itemId == null) {
  7. Notification.show("Please select a IncludeCollection from the table.");
  8. return;
  9. }
  10. ConfirmDialog.show(getUI(),
  11. "Are you sure?",
  12. "Do you really want to remove the selected Include Collection field?\nThis action cannot be undone.",
  13. "Yes",
  14. "No",
  15. new ConfirmDialog.Listener() {
  16. public void onClose(ConfirmDialog dialog) {
  17. if (dialog.isConfirmed()) {
  18. table.removeItem(itemId);
  19. }
  20. }
  21. });
  22. }

代码示例来源:origin: OpenNMS/opennms

  1. /**
  2. * Delete handler.
  3. */
  4. private void deleteHandler() {
  5. final Object itemId = table.getValue();
  6. if (itemId == null) {
  7. Notification.show("Please select a Varbind Decode from the table.");
  8. } else {
  9. ConfirmDialog.show(getUI(),
  10. "Are you sure?",
  11. "Do you really want to remove the selected Varbinds Decode field?\nThis action cannot be undone.",
  12. "Yes",
  13. "No",
  14. new ConfirmDialog.Listener() {
  15. public void onClose(ConfirmDialog dialog) {
  16. if (dialog.isConfirmed()) {
  17. table.removeItem(itemId);
  18. }
  19. }
  20. });
  21. }
  22. }

代码示例来源:origin: OpenNMS/opennms

  1. /**
  2. * Delete handler.
  3. */
  4. private void deleteHandler() {
  5. final Object itemId = table.getValue();
  6. if (itemId == null) {
  7. Notification.show("Please select a Mask Element from the table.");
  8. } else {
  9. ConfirmDialog.show(getUI(),
  10. "Are you sure?",
  11. "Do you really want to remove the selected Mask Element field ?\nThis action cannot be undone.",
  12. "Yes",
  13. "No",
  14. new ConfirmDialog.Listener() {
  15. public void onClose(ConfirmDialog dialog) {
  16. if (dialog.isConfirmed()) {
  17. table.removeItem(itemId);
  18. }
  19. }
  20. });
  21. }
  22. }

代码示例来源:origin: OpenNMS/opennms

  1. /**
  2. * Delete handler.
  3. */
  4. private void deleteHandler() {
  5. final Object itemId = table.getValue();
  6. if (itemId == null) {
  7. Notification.show("Please select a RRA from the table.");
  8. } else {
  9. ConfirmDialog.show(getUI(),
  10. "Are you sure?",
  11. "Do you really want to remove the selected RRA?\nThis action cannot be undone.",
  12. "Yes",
  13. "No",
  14. new ConfirmDialog.Listener() {
  15. public void onClose(ConfirmDialog dialog) {
  16. if (dialog.isConfirmed()) {
  17. table.removeItem(itemId);
  18. }
  19. }
  20. });
  21. }
  22. }

代码示例来源:origin: OpenNMS/opennms

  1. /**
  2. * Delete handler.
  3. */
  4. private void deleteHandler() {
  5. final Object itemId = table.getValue();
  6. if (itemId == null) {
  7. Notification.show("Please select a Mask Varbind from the table.");
  8. } else {
  9. ConfirmDialog.show(getUI(),
  10. "Are you sure?",
  11. "Do you really want to remove the selected Mask Varbind field?\nThis action cannot be undone.",
  12. "Yes",
  13. "No",
  14. new ConfirmDialog.Listener() {
  15. public void onClose(ConfirmDialog dialog) {
  16. if (dialog.isConfirmed()) {
  17. table.removeItem(itemId);
  18. }
  19. }
  20. });
  21. }
  22. }
  23. }

代码示例来源:origin: OpenNMS/opennms

  1. /**
  2. * Delete handler.
  3. */
  4. private void deleteHandler() {
  5. final Object itemId = table.getValue();
  6. if (itemId == null) {
  7. Notification.show("Please select a MIB Object from the table.");
  8. } else {
  9. ConfirmDialog.show(getUI(),
  10. "Are you sure?",
  11. "Do you really want to remove the selected MIB Object?\nThis action cannot be undone.",
  12. "Yes",
  13. "No",
  14. new ConfirmDialog.Listener() {
  15. public void onClose(ConfirmDialog dialog) {
  16. if (dialog.isConfirmed()) {
  17. table.removeItem(itemId);
  18. }
  19. }
  20. });
  21. }
  22. }

代码示例来源:origin: OpenNMS/opennms

  1. /**
  2. * Delete handler.
  3. */
  4. private void deleteHandler() {
  5. final Object itemId = table.getValue();
  6. if (itemId == null) {
  7. Notification.show("Please select a Parameter from the table.");
  8. } else {
  9. ConfirmDialog.show(getUI(),
  10. "Are you sure?",
  11. "Do you really want to remove the selected parameter from the strategy?\nThis action cannot be undone.",
  12. "Yes",
  13. "No",
  14. new ConfirmDialog.Listener() {
  15. public void onClose(ConfirmDialog dialog) {
  16. if (dialog.isConfirmed()) {
  17. table.removeItem(itemId);
  18. }
  19. }
  20. });
  21. }
  22. }

代码示例来源:origin: OpenNMS/opennms

  1. @Override
  2. public void buttonClick(ClickEvent event) {
  3. final Object value = table.getValue();
  4. if (value == null) {
  5. Notification.show("Please select a IncludeCollection from the table.");
  6. return;
  7. }
  8. IncludeCollectionWindow w = new IncludeCollectionWindow(dataCollectionConfigDao, container, container.getOnmsBean(value)) {
  9. @Override
  10. public void fieldChanged() {}
  11. };
  12. getUI().addWindow(w);
  13. }
  14. });

代码示例来源:origin: OpenNMS/opennms

  1. @Override
  2. public void buttonClick(Button.ClickEvent clickEvent) {
  3. getUI().addWindow(new SurveillanceViewConfigurationCategoryWindow(surveillanceViewService, columnsTable.getItemIds(), (ColumnDef) columnsTable.getValue(), new SurveillanceViewConfigurationCategoryWindow.SaveActionListener() {
  4. @Override
  5. public void save(Def def) {
  6. ColumnDef columnToBeReplaced = (ColumnDef) columnsTable.getValue();
  7. int index = columnOrder.get(columnToBeReplaced);
  8. columns.removeItem(columnToBeReplaced);
  9. columnOrder.remove(columnToBeReplaced);
  10. columns.addItem((ColumnDef) def);
  11. columnOrder.put((ColumnDef) def, index);
  12. columns.sort(new Object[]{"label"}, new boolean[]{true});
  13. columnsTable.refreshRowCache();
  14. }
  15. }));
  16. }
  17. });

代码示例来源:origin: OpenNMS/opennms

  1. @Override
  2. public void buttonClick(Button.ClickEvent clickEvent) {
  3. getUI().addWindow(new SurveillanceViewConfigurationCategoryWindow(surveillanceViewService, rowsTable.getItemIds(), (RowDef) rowsTable.getValue(), new SurveillanceViewConfigurationCategoryWindow.SaveActionListener() {
  4. @Override
  5. public void save(Def def) {
  6. RowDef rowToBeReplaced = (RowDef) rowsTable.getValue();
  7. int index = rowOrder.get(rowToBeReplaced);
  8. rows.removeItem(rowToBeReplaced);
  9. rowOrder.remove(rowToBeReplaced);
  10. rows.addItem((RowDef) def);
  11. rowOrder.put((RowDef) def, index);
  12. rows.sort(new Object[]{"label"}, new boolean[]{true});
  13. rowsTable.refreshRowCache();
  14. }
  15. }));
  16. }
  17. });

相关文章

Table类方法