Пример #1
0
 private ArchivePanel getArchivePanel(Device device) {
   ArchivePanel panel = archivePanels.get(device.getId());
   if (panel == null) {
     panel = new ArchivePanel(archiveHandler);
     archivePanels.put(device.getId(), panel);
     devicesTabs.add(panel.getContentPanel(), new TabItemConfig(device.getName(), true));
   }
   return panel;
 }
Пример #2
0
 @UiHandler("clearButton")
 public void onClearClicked(SelectEvent event) {
   for (Map.Entry<Long, ArchivePanel> entry : archivePanels.entrySet()) {
     Device device = deviceStore.findModelWithKey(entry.getKey().toString());
     archiveHandler.onClear(device);
     devicesTabs.remove(entry.getValue().getContentPanel());
   }
   archivePanels.clear();
 }
Пример #3
0
 @UiHandler("devicesTabs")
 public void onDeviceTabClosed(CloseEvent<Widget> event) {
   for (Map.Entry<Long, ArchivePanel> entry : archivePanels.entrySet()) {
     if (entry.getValue().getContentPanel().equals(event.getItem())) {
       Device device = deviceStore.findModelWithKey(entry.getKey().toString());
       archiveHandler.onClear(device);
       archivePanels.remove(entry.getKey());
       break;
     }
   }
 }
Пример #4
0
 @Override
 public void onUpdate(StoreUpdateEvent<Device> event) {
   super.onUpdate(event);
   if (event.getItems() != null) {
     for (Device device : event.getItems()) {
       ArchivePanel panel = archivePanels.get(device.getId());
       if (panel != null) {
         TabItemConfig config = devicesTabs.getConfig(panel.getContentPanel());
         config.setText(device.getName());
         devicesTabs.update(panel.getContentPanel(), config);
       }
     }
   }
 }