示例#1
0
  private void handleLockFailure(final LockInfo lockInfo) {

    if (lockInfo != null) {
      updateLockInfo(lockInfo);
      lockNotification.fire(
          new NotificationEvent(
              WorkbenchConstants.INSTANCE.lockedMessage(lockInfo.lockedBy()),
              NotificationEvent.NotificationType.INFO,
              true,
              lockTarget.getPlace(),
              20));
    } else {
      lockNotification.fire(
          new NotificationEvent(
              WorkbenchConstants.INSTANCE.lockError(),
              NotificationEvent.NotificationType.ERROR,
              true,
              lockTarget.getPlace(),
              20));
    }
    // Delay reloading slightly in case we're dealing with a flood of events
    if (reloadTimer == null) {
      reloadTimer =
          new Timer() {

            public void run() {
              reload();
            }
          };
    }

    if (!reloadTimer.isRunning()) {
      reloadTimer.schedule(250);
    }
  }
示例#2
0
 private boolean isLockedByCurrentUser() {
   return lockInfo.isLocked() && lockInfo.lockedBy().equals(user.getIdentifier());
 }