Browse Source

Pull request #4549: REPORT-53734 【智能联动】组件名/数据集名替换时,发现替换多次 && REPORT-52936 saveWorker去掉对模板id的依赖

Merge in DESIGN/design from ~HADES/design:feature/10.0 to feature/10.0

* commit '7dd528f13314b0c3b19d22ebff302faebb957999':
  REPORT-52936 saveWorker去掉对模板id的依赖
  REPORT-53734 【智能联动】组件名/数据集名替换时,发现替换多次
feature/10.0
Hades 4 years ago
parent
commit
d8e4cd4b16
  1. 6
      designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java
  2. 2
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
  3. 16
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  4. 6
      designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java
  5. 2
      designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

6
designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java

@ -76,7 +76,7 @@ public final class WebPreviewUtils {
browserTemplate(jt, baseRoute, map, actionType);
}
});
worker.start(jt.getTarget().getTemplateID());
worker.start(jt.getRuntimeId());
return;
}
browserTemplate(jt, baseRoute, map, actionType);
@ -97,7 +97,7 @@ public final class WebPreviewUtils {
);
if (OK_OPTION == selVal) {
CallbackSaveWorker worker = jt.saveAs();
worker.start(jt.getTarget().getTemplateID());
worker.start(jt.getRuntimeId());
worker.addSuccessCallback(new Runnable() {
@Override
public void run() {
@ -125,7 +125,7 @@ public final class WebPreviewUtils {
browseUrl(jt.getEditingFILE(), baseRoute, map, actionType, jt);
}
});
worker.start(jt.getTarget().getTemplateID());
worker.start(jt.getRuntimeId());
}
}
}

2
designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java

@ -706,7 +706,7 @@ public class MutilTempalteTabPane extends JComponent {
closeTpl(specifiedTemplate);
}
});
worker.start(specifiedTemplate.getTarget().getTemplateID());
worker.start(specifiedTemplate.getRuntimeId());
} else if (returnVal == JOptionPane.NO_OPTION) {
closeTpl(specifiedTemplate);
}

16
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -129,6 +129,11 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
private volatile boolean opening = false;
private volatile boolean openFailed = false;
/**
* UI界面模板运行时唯一的id 不存储在模板中 仅在运行时使用 模板界面上关闭就不关注了
*/
private final String runtimeId = UUID.randomUUID().toString();
private PluginEventListener pluginListener;
public JTemplate() {
@ -1492,10 +1497,6 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
editingFILE = fileChooser.getSelectedFILE();
}
//收集和生成templateID 因为是另存为操作 无论怎么样都需要重新生成templateID
// TODO Hades https://work.fineres.com/browse/REPORT-52936
// initForCollect();
FILE finalEditingFILE = editingFILE;
CallbackSaveWorker worker = new CallbackSaveWorker(new Callable<Boolean>() {
@Override
@ -1587,13 +1588,13 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
@Override
public void saveDirectly() {
CallbackSaveWorker worker = save();
worker.start(this.template.getTemplateID());
worker.start(getRuntimeId());
}
@Override
public void saveAsDirectly() {
CallbackSaveWorker worker = saveAs();
worker.start(this.template.getTemplateID());
worker.start(getRuntimeId());
}
@Override
@ -1634,4 +1635,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
return !isSaving() && !isOpening() && !isOpenFailed();
}
public String getRuntimeId() {
return runtimeId;
}
}

6
designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java

@ -116,7 +116,7 @@ public class CheckButton extends UIButton {
startCheck(checkThread);
}
});
worker.start(jtemplate.getTarget().getTemplateID());
worker.start(jtemplate.getRuntimeId());
}
} else {
if (!jtemplate.isSaved()) {
@ -127,7 +127,7 @@ public class CheckButton extends UIButton {
startCheck(checkThread);
}
});
worker.start(jtemplate.getTarget().getTemplateID());
worker.start(jtemplate.getRuntimeId());
} else {
startCheck(checkThread);
}
@ -148,7 +148,7 @@ public class CheckButton extends UIButton {
startCheck(checkThread);
}
});
worker.start(jtemplate.getTarget().getTemplateID());
worker.start(jtemplate.getRuntimeId());
}
}
}

2
designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

@ -165,7 +165,6 @@ public class DesignerActivator extends Activator implements Prepare {
storePassport();
AlphaFineHelper.switchConfig4Locale();
RecoverManager.register(new RecoverForDesigner());
ContentReplacerCenter.getInstance().register();
pushUpdateTask.run();
}
@ -455,5 +454,6 @@ public class DesignerActivator extends Activator implements Prepare {
@Override
public void prepare() {
LoginAuthServer.getInstance().start();
ContentReplacerCenter.getInstance().register();
}
}

Loading…
Cancel
Save