@Test public void testOnNewDocument_WithoutCommand() { try { builder.onNewDocument(); verify( view, never() ).enableNewDocumentButton( eq( true ) ); } catch ( NullPointerException npe ) { fail( "Null Commands should be handled." ); } }
@Override public void onNewDocument() { if (isReadOnly) { return; } if (newDocumentCommand != null) { newDocumentCommand.execute(); } }
RegisteredDocumentsMenuBuilder implements MenuFactory.CustomMenuBuilder,
                                                       RegisteredDocumentsMenuView.Presenter { @Override public void onNewDocument() { if (isReadOnly) { return; } if (newDocumentCommand != null) { newDocumentCommand.execute(); } } }
RegisteredDocumentsMenuBuilder implements MenuFactory.CustomMenuBuilder,
                                                       RegisteredDocumentsMenuView.Presenter { @Override public void onNewDocument() { if (isReadOnly) { return; } if (newDocumentCommand != null) { newDocumentCommand.execute(); } } @Inject  RegisteredDocumentsMenuBuilder(final RegisteredDocumentsMenuView view,
                                          final ManagedInstance<DocumentMenuItem> documentMenuItemProvider); }
RegisteredDocumentsMenuBuilder implements MenuFactory.CustomMenuBuilder,
                                                       RegisteredDocumentsMenuView.Presenter { @Override public void onNewDocument() { if (isReadOnly) { return; } if (newDocumentCommand != null) { newDocumentCommand.execute(); } } @Inject  RegisteredDocumentsMenuBuilder(final RegisteredDocumentsMenuView view,
                                          final ManagedInstance<DocumentMenuItem> documentMenuItemProvider); @Override void setReadOnly(final boolean isReadOnly); @Override @PreDestroy void dispose(); @Override void push(final MenuFactory.CustomMenuBuilder element); @Override MenuItem build(); @Override void onOpenDocument(); @Override void onNewDocument(); @Override void registerDocument(final KieDocument document); @Override void deregisterDocument(final KieDocument document); @Override void onActivateDocument(final KieDocument document); @Override void onRemoveDocument(final KieDocument document); @Override void setNewDocumentCommand(final Command newDocumentCommand); @Override void setOpenDocumentCommand(final Command openDocumentCommand); @Override void setActivateDocumentCommand(final ParameterizedCommand<KieDocument> activateDocumentCommand); @Override void setRemoveDocumentCommand(final ParameterizedCommand<KieDocument> removeDocumentCommand); @Override void activateDocument(final KieDocument document); }
RegisteredDocumentsMenuBuilder implements MenuFactory.CustomMenuBuilder,
                                                       RegisteredDocumentsMenuView.Presenter { @Override public void onNewDocument() { if (isReadOnly) { return; } if (newDocumentCommand != null) { newDocumentCommand.execute(); } } @Inject  RegisteredDocumentsMenuBuilder(final RegisteredDocumentsMenuView view,
                                          final ManagedInstance<DocumentMenuItem> documentMenuItemProvider); @Override void setReadOnly(final boolean isReadOnly); @Override @PreDestroy void dispose(); @Override void push(final MenuFactory.CustomMenuBuilder element); @Override MenuItem build(); @Override void onOpenDocument(); @Override void onNewDocument(); @Override void registerDocument(final KieDocument document); @Override void deregisterDocument(final KieDocument document); @Override void onActivateDocument(final KieDocument document); @Override void onRemoveDocument(final KieDocument document); @Override void setNewDocumentCommand(final Command newDocumentCommand); @Override void setOpenDocumentCommand(final Command openDocumentCommand); @Override void setActivateDocumentCommand(final ParameterizedCommand<KieDocument> activateDocumentCommand); @Override void setRemoveDocumentCommand(final ParameterizedCommand<KieDocument> removeDocumentCommand); @Override void activateDocument(final KieDocument document);  }