@Override public String toString() { return "OnShowEvent [context=" + getContext() + "]"; } }
@Test public void testOnShowUserEvent() { final OnShowEvent onShowEvent = mock(OnShowEvent.class); when(onShowEvent.getContext()).thenReturn(userEditor); when(onShowEvent.getInstance()).thenReturn(user); tested.onShowUserEvent(onShowEvent); verify(changeTitleNotification, times(1)).fire(any(ChangeTitleWidgetEvent.class)); }
void onShowUserEvent(@Observes final OnShowEvent onShowEvent) { if (checkEventContext(onShowEvent, userEditorWorkflow.getUserEditor())) { try { User user = (User) onShowEvent.getInstance(); this.userId = user.getIdentifier(); final String title = new SafeHtmlBuilder() .appendEscaped(UsersManagementWorkbenchConstants.INSTANCE.showUser(user.getIdentifier())) .toSafeHtml().asString(); changeTitleNotification.fire(new ChangeTitleWidgetEvent(placeRequest, title)); } catch (ClassCastException e) { } } }
@Override public void show(final Group group) { clear(); this.isEditMode = false; open(group); onShowEvent.fire(new OnShowEvent(this, group)); }
@Test public void testOnShowUserEvent() { final OnShowEvent onShowEvent = mock(OnShowEvent.class); when(onShowEvent.getContext()).thenReturn(userEditor); when(onShowEvent.getInstance()).thenReturn(user); tested.onShowUserEvent(onShowEvent); verify(changeTitleNotification, times(1)).fire(any(ChangeTitleWidgetEvent.class)); }
void onShowUserEvent(@Observes final OnShowEvent onShowEvent) { if (checkEventContext(onShowEvent, userEditorWorkflow.getUserEditor())) { try { User user = (User) onShowEvent.getInstance(); this.userId = user.getIdentifier(); final String title = new SafeHtmlBuilder() .appendEscaped(UsersManagementWorkbenchConstants.INSTANCE.showUser(user.getIdentifier())) .toSafeHtml().asString(); changeTitleNotification.fire(new ChangeTitleWidgetEvent(placeRequest, title)); } catch (ClassCastException e) { } } }
@Override public void show(final Group group) { clear(); this.isEditMode = false; open(group); onShowEvent.fire(new OnShowEvent(this, group)); }
@Override public String toString() { return "OnShowEvent [context=" + getContext() + "]"; } }
@Override public void show(final Role role) { clear(); this.isEditMode = false; open(role); onShowEvent.fire(new OnShowEvent(RoleEditor.this, role)); }
@Override public void show(final Role role) { clear(); this.isEditMode = false; open(role); onShowEvent.fire(new OnShowEvent(RoleEditor.this, role)); }
@Override public void show(final User user) { clear(); this.isEditMode = false; aclViewer.show(user); open(user); onShowEvent.fire(new OnShowEvent(UserEditor.this, user)); }
@Override public void show(final User user) { clear(); this.isEditMode = false; aclViewer.show(user); open(user); onShowEvent.fire(new OnShowEvent(UserEditor.this, user)); }