@Test public void lockStatusTextLockedByCurrentUser() { final String lockedBy = "Christian"; final String expected = MetadataConstants.INSTANCE.LockedByHintOwned(); final String lockStatusText = metadataWidget.getLockStatusText(new LockInfo(true, lockedBy, null)); assertEquals("Lock status text incorrect", expected, lockStatusText); }
String getLockStatusText(final LockInfo lockInfo) { final String lockStatusText; if (lockInfo.isLocked()) { if (lockInfo.lockedBy().equals(currentUser)) { lockStatusText = MetadataConstants.INSTANCE.LockedByHintOwned(); } else { lockStatusText = MetadataConstants.INSTANCE.LockedByHint() + " " + lockInfo.lockedBy(); } } else { lockStatusText = MetadataConstants.INSTANCE.UnlockedHint(); } return lockStatusText; }
MetadataWidget extends Composite implements HasBusyIndicator { String getLockStatusText(final LockInfo lockInfo) { final String lockStatusText; if (lockInfo.isLocked()) { if (lockInfo.lockedBy().equals(currentUser)) { lockStatusText = MetadataConstants.INSTANCE.LockedByHintOwned(); } else { lockStatusText = MetadataConstants.INSTANCE.LockedByHint() + " " + lockInfo.lockedBy(); } } else { lockStatusText = MetadataConstants.INSTANCE.UnlockedHint(); } return lockStatusText; } }
MetadataWidget extends Composite implements HasBusyIndicator { String getLockStatusText(final LockInfo lockInfo) { final String lockStatusText; if (lockInfo.isLocked()) { if (lockInfo.lockedBy().equals(currentUser)) { lockStatusText = MetadataConstants.INSTANCE.LockedByHintOwned(); } else { lockStatusText = MetadataConstants.INSTANCE.LockedByHint() + " " + lockInfo.lockedBy(); } } else { lockStatusText = MetadataConstants.INSTANCE.UnlockedHint(); } return lockStatusText; } @Inject  MetadataWidget(final BusyIndicatorView busyIndicatorView,
                          final ExternalLinkPresenter external); }
MetadataWidget extends Composite implements HasBusyIndicator { String getLockStatusText(final LockInfo lockInfo) { final String lockStatusText; if (lockInfo.isLocked()) { if (lockInfo.lockedBy().equals(currentUser)) { lockStatusText = MetadataConstants.INSTANCE.LockedByHintOwned(); } else { lockStatusText = MetadataConstants.INSTANCE.LockedByHint() + " " + lockInfo.lockedBy(); } } else { lockStatusText = MetadataConstants.INSTANCE.UnlockedHint(); } return lockStatusText; } @Inject  MetadataWidget(final BusyIndicatorView busyIndicatorView,
                          final ExternalLinkPresenter external); void setContent(final Metadata metadata,
                           final boolean readOnly); void setForceUnlockHandler(final Runnable forceUnlockHandler); void setCurrentUser(String currentUser); void setLockStatus(final LockInfo lockInfo); @Deprecated Metadata getContent(); @Override void showBusyIndicator(final String message); @Override void hideBusyIndicator(); void setNote(String text); @UiHandler("unlock") void onForceUnlock(ClickEvent e); }
MetadataWidget extends Composite implements HasBusyIndicator { String getLockStatusText(final LockInfo lockInfo) { final String lockStatusText; if (lockInfo.isLocked()) { if (lockInfo.lockedBy().equals(currentUser)) { lockStatusText = MetadataConstants.INSTANCE.LockedByHintOwned(); } else { lockStatusText = MetadataConstants.INSTANCE.LockedByHint() + " " + lockInfo.lockedBy(); } } else { lockStatusText = MetadataConstants.INSTANCE.UnlockedHint(); } return lockStatusText; } @Inject  MetadataWidget(final BusyIndicatorView busyIndicatorView,
                          final ExternalLinkPresenter external); void setContent(final Metadata metadata,
                           final boolean readOnly); void setForceUnlockHandler(final Runnable forceUnlockHandler); void setCurrentUser(String currentUser); void setLockStatus(final LockInfo lockInfo); @Deprecated Metadata getContent(); @Override void showBusyIndicator(final String message); @Override void hideBusyIndicator(); void setNote(String text); @UiHandler("unlock") void onForceUnlock(ClickEvent e);  }