private void updateIdentity() {
    Identity identity = clientConfiguration.getSelectedIdentity();

    browseNav.setManaged(identity != null);
    contactsNav.setManaged(identity != null);
    syncNav.setManaged(identity != null);
    // inviteNav.setManaged(identity != null);
    selectedIdentity.setVisible(identity != null);
    // feebbackNav.setVisible(identity != null);

    avatarContainer.setVisible(identity != null);
    if (identity == null) {
      return;
    }

    final String currentAlias = identity.getAlias();
    if (currentAlias.equals(lastAlias)) {
      return;
    }

    new AvatarView(e -> currentAlias).getViewAsync(avatarContainer.getChildren()::setAll);
    alias.setText(currentAlias);
    lastAlias = currentAlias;

    if (clientConfiguration.getAccount() == null) {
      return;
    }
    mail.setText(clientConfiguration.getAccount().getUser());
  }
예제 #2
0
 private void addShareMessageRenderer(Identity arg) {
   executorService.submit(
       () -> {
         ShareNotificationRenderer renderer =
             new ShareNotificationRenderer(
                 ((BoxVolumeFactory) customProperties.get("boxVolumeFactory"))
                     .getVolume(config.getAccount(), arg)
                     .getReadBackend(),
                 sharingService);
         rendererFactory.addRenderer(
             DropMessageRepository.PAYLOAD_TYPE_SHARE_NOTIFICATION, renderer);
       });
 }