Browse Source

Pull request #3501: REPORT-47632 远程锁定-从远程切换到本地后,数据集窗口的锁定图标不消失

Merge in DESIGN/design from ~YVAN/design:release/10.0 to release/10.0

* commit '66acb052a4a89b8697f29303fdac098ed913dfb6':
  REPORT-47632 远程锁定-从远程切换到本地后,数据集窗口的锁定图标不消失 【问题原因】之前的逻辑不完善,如果处于远程状态下是锁定的,isLock变量为true,然后切回本地了,这个变量没有被置为false,会导致数据集窗口图标一直为锁定状态 【改动思路】加个判断,如果不是远程设计状态且isLock为true,将其置为false,再通知观察者们
feature/big-screen
Yvan 4 years ago
parent
commit
c1e77fa035
  1. 18
      designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java

18
designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java

@ -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;
}
} }

Loading…
Cancel
Save