@Test @SuppressWarnings("unchecked") public void testRegisterDocument() { final TestDocument document = createTestDocument(); final ObservablePath path = document.getLatestPath(); registerDocument(document); verify(path, times(1)).onRename(any(Command.class)); verify(path, times(1)).onConcurrentRename(any(ParameterizedCommand.class)); verify(path, times(1)).onDelete(any(Command.class)); verify(path, times(1)).onConcurrentDelete(any(ParameterizedCommand.class)); verify(path, times(1)).onConcurrentUpdate(any(ParameterizedCommand.class)); verify(registeredDocumentsMenuBuilder, times(1)).registerDocument(document); }
@Override public void registerDocument(final D document) { PortablePreconditions.checkNotNull("document", document); if (documents.contains(document)) { return; } documents.add(document); registeredDocumentsMenuBuilder.registerDocument(document); final ObservablePath path = document.getLatestPath(); path.onRename(() -> refresh(document)); path.onConcurrentRename((info) -> doConcurrentRename(document, info)); path.onDelete(() -> { enableMenus(false); removeDocument(document); deregisterDocument(document); }); path.onConcurrentDelete((info) -> { doConcurrentDelete(document, info); }); path.onConcurrentUpdate((eventInfo) -> document.setConcurrentUpdateSessionInfo(eventInfo)); }
KieMultipleDocumentEditor implements KieMultipleDocumentEditorPresenter<D> { @Override public void registerDocument(final D document) { PortablePreconditions.checkNotNull("document", document); if (documents.contains(document)) { return; } documents.add(document); registeredDocumentsMenuBuilder.registerDocument(document); final ObservablePath path = document.getLatestPath(); path.onRename(() -> refresh(document)); path.onConcurrentRename((info) -> doConcurrentRename(document, info)); path.onDelete(() -> { enableMenus(false); removeDocument(document); deregisterDocument(document); }); path.onConcurrentDelete((info) -> { doConcurrentDelete(document, info); }); path.onConcurrentUpdate((eventInfo) -> document.setConcurrentUpdateSessionInfo(eventInfo)); } }
KieMultipleDocumentEditor implements KieMultipleDocumentEditorPresenter<D> { @Override public void registerDocument(final D document) { PortablePreconditions.checkNotNull("document", document); if (documents.contains(document)) { return; } documents.add(document); registeredDocumentsMenuBuilder.registerDocument(document); final ObservablePath path = document.getLatestPath(); path.onRename(() -> refresh(document)); path.onConcurrentRename((info) -> doConcurrentRename(document, info)); path.onDelete(() -> { enableMenus(false); removeDocument(document); deregisterDocument(document); }); path.onConcurrentDelete((info) -> { doConcurrentDelete(document, info); }); path.onConcurrentUpdate((eventInfo) -> document.setConcurrentUpdateSessionInfo(eventInfo)); } KieMultipleDocumentEditor();  KieMultipleDocumentEditor(final KieEditorView editorView); }
KieMultipleDocumentEditor implements KieMultipleDocumentEditorPresenter<D> { @Override public void registerDocument(final D document) { PortablePreconditions.checkNotNull("document", document); if (documents.contains(document)) { return; } documents.add(document); registeredDocumentsMenuBuilder.registerDocument(document); final ObservablePath path = document.getLatestPath(); path.onRename(() -> refresh(document)); path.onConcurrentRename((info) -> doConcurrentRename(document, info)); path.onDelete(() -> { enableMenus(false); removeDocument(document); deregisterDocument(document); }); path.onConcurrentDelete((info) -> { doConcurrentDelete(document, info); }); path.onConcurrentUpdate((eventInfo) -> document.setConcurrentUpdateSessionInfo(eventInfo)); } KieMultipleDocumentEditor();  KieMultipleDocumentEditor(final KieEditorView editorView); @Override void registerDocument(final D document); @Override void deregisterDocument(final D document); @Override void activateDocument(final D document,
                                 final Overview overview,
                                 final AsyncPackageDataModelOracle dmo,
                                 final Imports imports,
                                 final boolean isReadOnly); @Override D getActiveDocument(); @Override IsWidget getWidget(); @Override IsWidget getTitleWidget(final D document); @Override void getMenus(final Consumer<Menus> menusConsumer); @Override void onClose(); @Override void onSourceTabSelected(); @Override void updateSource(final String source); @Override void onEditTabSelected(); @Override void onEditTabUnselected(); @Override void onOverviewSelected(); @Override boolean mayClose(final Integer originalHashCode,
                            final Integer currentHashCode); @Override Promise<Void> makeMenuBar(); }
KieMultipleDocumentEditor implements KieMultipleDocumentEditorPresenter<D> { @Override public void registerDocument(final D document) { PortablePreconditions.checkNotNull("document", document); if (documents.contains(document)) { return; } documents.add(document); registeredDocumentsMenuBuilder.registerDocument(document); final ObservablePath path = document.getLatestPath(); path.onRename(() -> refresh(document)); path.onConcurrentRename((info) -> doConcurrentRename(document, info)); path.onDelete(() -> { enableMenus(false); removeDocument(document); deregisterDocument(document); }); path.onConcurrentDelete((info) -> { doConcurrentDelete(document, info); }); path.onConcurrentUpdate((eventInfo) -> document.setConcurrentUpdateSessionInfo(eventInfo)); } KieMultipleDocumentEditor();  KieMultipleDocumentEditor(final KieEditorView editorView); @Override void registerDocument(final D document); @Override void deregisterDocument(final D document); @Override void activateDocument(final D document,
                                 final Overview overview,
                                 final AsyncPackageDataModelOracle dmo,
                                 final Imports imports,
                                 final boolean isReadOnly); @Override D getActiveDocument(); @Override IsWidget getWidget(); @Override IsWidget getTitleWidget(final D document); @Override void getMenus(final Consumer<Menus> menusConsumer); @Override void onClose(); @Override void onSourceTabSelected(); @Override void updateSource(final String source); @Override void onEditTabSelected(); @Override void onEditTabUnselected(); @Override void onOverviewSelected(); @Override boolean mayClose(final Integer originalHashCode,
                            final Integer currentHashCode); @Override Promise<Void> makeMenuBar();  }