public void hideDiagramEditorDocks(@Observes PlaceHiddenEvent event) { if (verifyEventIdentifier(event)) { onDiagramLostFocusEvent.fire(new OnDiagramLoseFocusEvent()); } }
public void showDiagramEditorDocks(@Observes PlaceGainFocusEvent event) { if (verifyEventIdentifier(event)) { onDiagramFocusEvent.fire(new OnDiagramFocusEvent()); } }
private void addDocumentationPage(ProjectDiagram diagram) { Optional.ofNullable(documentationView.isEnabled()) .filter(Boolean.TRUE::equals) .ifPresent(enabled -> { final String label = translationService.getValue(StunnerProjectClientConstants.DOCUMENTATION); addPage(new DocumentationPage(documentationView.initialize(diagram), label, //firing the OnDiagramFocusEvent will force the docks to be minimized () -> onDiagramFocusEvent.fire(new OnDiagramFocusEvent()), //check the DocumentationPage is active, the index is 2 () -> Objects.equals(2, kieView.getSelectedTabIndex()))); }); }
@Test public void testOnDiagramLoseFocusEvent() { handler.onDiagramLoseFocusEvent(new OnDiagramLoseFocusEvent()); }
@Test public void testOnDiagramFocusEvent() { handler.onDiagramFocusEvent(new OnDiagramFocusEvent()); assertTrue(handler.shouldRefreshDocks()); assertFalse(handler.shouldDisableDocks()); verify(command).execute(); }