|
|
@ -40,13 +40,17 @@ public abstract class EditLockChangeChecker { |
|
|
|
try { |
|
|
|
try { |
|
|
|
EditLockOperator operator = WorkContext.getCurrent().get(EditLockOperator.class); |
|
|
|
EditLockOperator operator = WorkContext.getCurrent().get(EditLockOperator.class); |
|
|
|
boolean locked = operator.isLocked(lockItem); |
|
|
|
boolean locked = operator.isLocked(lockItem); |
|
|
|
if (isLocked != locked) { |
|
|
|
if (isLocked() != locked) { |
|
|
|
isLocked = locked; |
|
|
|
setLocked(locked); |
|
|
|
fireChange(); |
|
|
|
fireChange(); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else if (isLocked()){ |
|
|
|
|
|
|
|
// 如果不是远程环境,且此前的远程状态下为锁定的话,切换回来后需要将其修改为不锁定
|
|
|
|
|
|
|
|
setLocked(false); |
|
|
|
|
|
|
|
fireChange(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, 0, INTERVAL, TimeUnit.MILLISECONDS); |
|
|
|
}, 0, INTERVAL, TimeUnit.MILLISECONDS); |
|
|
@ -65,9 +69,17 @@ public abstract class EditLockChangeChecker { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
|
for (EditLockChangeListener listener : EditLockChangeChecker.this.listeners) { |
|
|
|
for (EditLockChangeListener listener : EditLockChangeChecker.this.listeners) { |
|
|
|
listener.updateLockedState(new EditLockChangeEvent(isLocked)); |
|
|
|
listener.updateLockedState(new EditLockChangeEvent(isLocked())); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isLocked() { |
|
|
|
|
|
|
|
return this.isLocked; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setLocked(boolean locked) { |
|
|
|
|
|
|
|
this.isLocked = locked; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|