/** * @{inheritedDoc} */ @Override public synchronized <T extends GenericEvent> void handle(T e) { super.handle(e); }
/** * @{inheritedDoc} */ @Override public synchronized <T extends GenericEvent> void handle(T e) { super.handle(e); if (e instanceof ElementRemovedFromTableEvent && e.getSourceController().equals(tableViewController)) { leftPaneController.refreshDatas(); } }
/** * @{inheritedDoc} */ @Override public synchronized <T extends GenericEvent> void handle(T e) { super.handle(e); if (e.isA(CoreEvent.HeaderNavbarBackButtonClicked)) { Platform.runLater(() -> { // if the current node is editing, cancel modifications and go // before going back to previous page row.endEdition(); }); } }
/** * Dispatch this event to all known children which {@link #isAwareOf(GenericEvent)} returns true. * * @param e */ @Override public <T extends GenericEvent> void dispatchEvent(T event) { synchronized (children) { final List<StandardViewController> aware = new ArrayList<>(); for (final StandardViewController c : children) { if (c.isAwareOf(event)) { aware.add(c); } } // root structure will first handle the event if (isAwareOf(event) && !aware.contains(this)) { handleEvent(event); } // and then other child for(StandardViewController c : aware) { c.handle(event); } } // and after dispatch it to rootStructureContentController if (rootStructureContentController != null) { rootStructureContentController.dispatchEvent(event); } }
/** * @{inheritedDoc} */ @Override public synchronized <T extends GenericEvent> void handle(T e) { super.handle(e); if (e.isA(CoreEvent.LinkDeletedEvent)) { // tableViewController.refreshDatas(); } else if (e.isA(CoreEvent.LinkCreatedEvent)) { // tableViewController.refreshDatas(); } else if (e.isA(CoreEvent.ElementRemovedFromTableEvent) && e.getSourceController().equals(tableViewController)) { leftPaneController.refreshDatas(); } }
/** * @{inheritedDoc} */ @Override public synchronized <T extends GenericEvent> void handle(T e) { super.handle(e); if (e.isA(CoreEvent.TreePopulatedFromTemplateEvent)) { LazyTreeItem item = (LazyTreeItem) treeView.getSelectionModel().getSelectedItem(); item.reloadChildren(); } else if (e.isA(CoreEvent.TreeFolderCreatedEvent)) { LazyTreeItem item = (LazyTreeItem) treeView.getSelectionModel().getSelectedItem(); item.reloadChildren(); } }
/** * @{inheritedDoc} */ @Override public synchronized <T extends GenericEvent> void handle(T e) { super.handle(e); if (e.isA(CoreEvent.NotificationEvent)) { NewNotificationEvent ev = (NewNotificationEvent) e; notificationsPane.handleNotification(ev); } else if (e.isA(CoreEvent.NotificationDeletedEvent)) { NotificationDeletedEvent ev = (NotificationDeletedEvent) e; notificationsPane.handleNotification(ev); } else if (e.isA(CoreEvent.MarkAllNotificationsReadenEvent)) { MarkAllNotificationsReadenEvent ev = (MarkAllNotificationsReadenEvent) e; handEvent(ev); } else if (e.isA(CoreEvent.DeleteAllNotificationsEvent)) { DeleteAllNotificationsEvent ev = (DeleteAllNotificationsEvent) e; handEvent(ev); } }
/** * @{inheritedDoc} */ @Override public synchronized <T extends GenericEvent> void handle(T e) { super.handle(e); if (e.isA(CoreEvent.FolderedCreatedEvent) || e.isA(CoreEvent.PartCreatedEvent)) { if (righSection != null) { righSection.refreshDatas(); } } else if (e.isA(CoreEvent.LinkDeletedEvent)) { final LazyTreeItem item = leftSection.getLastSelectedTreeItem(); if (item != null) { item.reloadChildren(); } } else if (e.isA(CoreEvent.LinkCreatedEvent)) { final LazyTreeItem item = leftSection.getLastSelectedTreeItem(); if (item != null) { item.reloadChildren(); } } }
/** * @{inheritedDoc} */ @Override public <T extends GenericEvent> void handle(T e) { super.handle(e); if (toolbar != null) { if (e.isA(CoreEvent.UpdateCurrentLocationEvent)) { UpdateCurrentLocationEvent ev = (UpdateCurrentLocationEvent) e; toolbar.updateLocation(ev); } else if (e.isA(CoreEvent.HeaderNavbarSetCustomRightActions)) { HeaderNavbarSetCustomRightActions ev = (HeaderNavbarSetCustomRightActions) e; toolbar.handle(ev); } else if (e.isA(CoreEvent.HeaderNavbarSetStandardRightActions)) { HeaderNavbarSetStandardRightActions ev = (HeaderNavbarSetStandardRightActions) e; toolbar.handle(ev); } else if (e.isA(CoreEvent.HeaderNavbarFireBackButton)) { HeaderNavbarFireBackButton ev = (HeaderNavbarFireBackButton) e; toolbar.handle(ev); } else if (e.isA(CoreEvent.SetCurrentLocationEvent)) { SetCurrentLocationEvent ev = (SetCurrentLocationEvent) e; toolbar.handle(ev); } else if (e.isA(CoreEvent.ReinitHeaderNavigationEvent)) { ReinitHeaderNavigationEvent ev = (ReinitHeaderNavigationEvent) e; toolbar.handle(ev); } } } }
@Override public synchronized <T extends GenericEvent> void handle(T e) { super.handle(e); VLTabpane tabpane = (VLTabpane) buildable; if (e.isA(CoreEvent.PopTabContentEvent)) { tabpane.popCurrentContent(false); } else if (e.isA(CoreEvent.PushTabContentEvent)) { PushTabContentEvent ev = (PushTabContentEvent) e; if (ev.getParentController() == this) { String viewId = ev.getProperty("viewId"); if (StringUtils.isNotBlank(viewId)) { final StandardViewController view = StandardViewUtils.forId(rootStructure, viewId, (OperationData) ev.getModel()); view.setParent(this); tabpane.pushCurrentContent(view); UpdateCurrentLocationEvent ucl = new UpdateCurrentLocationEvent(); ucl.setHasPrevious(true); ucl.setSourceController(view); ucl.setTabContentNavigation(true); ((AbstractViewController) getController()).dispatchEvent(ucl); } } } }
/** * @{inheritedDoc} */ @Override public synchronized <T extends GenericEvent> void handle(T e) { super.handle(e); if (e.isA(CoreEvent.NotificationEvent)) { NewNotificationEvent ev = (NewNotificationEvent) e; if (ev.getModel() instanceof Notification) { OperationCallback createCallback = new OperationCallback.Builder().onSuccess(this::onCreateSuccess).build(); countDelegate.create((Notification) ev.getModel(), createCallback); } } else if (e.isA(CoreEvent.NotificationDeletedEvent)) { NotificationDeletedEvent ev = (NotificationDeletedEvent) e; NotificationView nv = (NotificationView) ev.getModel(); if (nv.getNotification().getStatus() == NotificationStatus.NEW) { updateCount(-1); } } else if (e.isA(CoreEvent.AllNotificationsClearedEvent)) { Platform.runLater(() -> { newElementsCount.set(0); }); } }