Browse Source

REPORT-89867 【降本增效】插件管理优化

feature/x
Destiny.Lin 2 years ago
parent
commit
a03030630c
  1. 6
      designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java
  2. 14
      designer-base/src/main/java/com/fr/design/extra/exe/callback/BatchModifyStatusCallback.java

6
designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java

@ -123,9 +123,9 @@ public class PluginOperateUtils {
private static void dealWithPluginActive(PluginMarker pluginMarker, BatchModifyStatusCallback modifyStatusCallback) { private static void dealWithPluginActive(PluginMarker pluginMarker, BatchModifyStatusCallback modifyStatusCallback) {
PluginContext plugin = PluginManager.getContext(pluginMarker); PluginContext plugin = PluginManager.getContext(pluginMarker);
boolean isRunning = plugin.isRunning(); boolean running = plugin.isRunning();
modifyStatusCallback.setActive(isRunning); modifyStatusCallback.setActive(running);
changePluginActive(isRunning, pluginMarker, modifyStatusCallback, plugin); changePluginActive(running, pluginMarker, modifyStatusCallback, plugin);
} }

14
designer-base/src/main/java/com/fr/design/extra/exe/callback/BatchModifyStatusCallback.java

@ -32,7 +32,7 @@ import java.util.Map;
* Created on 2023/5/18 * Created on 2023/5/18
*/ */
public class BatchModifyStatusCallback implements PluginTaskCallback { public class BatchModifyStatusCallback implements PluginTaskCallback {
private boolean isActive; private boolean active;
private JSCallback jsCallback = new JSCallback(JSExecutor.DEFAULT); private JSCallback jsCallback = new JSCallback(JSExecutor.DEFAULT);
private Map<String, String> resultMap = new HashMap<>(); private Map<String, String> resultMap = new HashMap<>();
private int pluginCount = 0; private int pluginCount = 0;
@ -42,11 +42,11 @@ public class BatchModifyStatusCallback implements PluginTaskCallback {
public BatchModifyStatusCallback(boolean isActive) { public BatchModifyStatusCallback(boolean isActive) {
this.isActive = isActive; this.active = isActive;
} }
public BatchModifyStatusCallback(boolean isActive, JSCallback jsCallback) { public BatchModifyStatusCallback(boolean isActive, JSCallback jsCallback) {
this.isActive = isActive; this.active = isActive;
this.jsCallback = jsCallback; this.jsCallback = jsCallback;
} }
@ -60,7 +60,7 @@ public class BatchModifyStatusCallback implements PluginTaskCallback {
String pluginInfo = PluginOperateUtils.getSuccessInfo(result); String pluginInfo = PluginOperateUtils.getSuccessInfo(result);
if (result.isSuccess()) { if (result.isSuccess()) {
successCount++; successCount++;
String modifyMessage = isActive ? String modifyMessage = active ?
pluginInfo + Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Been_Disabled_Duplicate") : pluginInfo + Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Been_Disabled_Duplicate") :
pluginInfo + Toolkit.i18nText("Fine-Design_Plugin_Has_Been_Actived_Duplicate"); pluginInfo + Toolkit.i18nText("Fine-Design_Plugin_Has_Been_Actived_Duplicate");
FineLoggerFactory.getLogger().info(modifyMessage); FineLoggerFactory.getLogger().info(modifyMessage);
@ -109,7 +109,7 @@ public class BatchModifyStatusCallback implements PluginTaskCallback {
*/ */
public void showMessageDialog() { public void showMessageDialog() {
if (failedCount == 0) { if (failedCount == 0) {
if (isActive) { if (active) {
FineJOptionPane.showMessageDialog(DesignerPluginContext.getPluginDialog(), FineJOptionPane.showMessageDialog(DesignerPluginContext.getPluginDialog(),
Toolkit.i18nText("Fine-Design_Basic_Plugin_Batch_Modify_Stop_Success"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Batch_Modify_Stop_Success"),
Toolkit.i18nText("Fine-Design_Basic_Plugin_Stop"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Stop"),
@ -126,13 +126,13 @@ public class BatchModifyStatusCallback implements PluginTaskCallback {
detailPane.updateDetailArea(resultMap.get(key)); detailPane.updateDetailArea(resultMap.get(key));
} }
detailPane.updateMessage(failedCount, successCount); detailPane.updateMessage(failedCount, successCount);
detailPane.updateTitle(isActive); detailPane.updateTitle(active);
detailPane.show(); detailPane.show();
} }
} }
public void setActive(boolean active) { public void setActive(boolean active) {
isActive = active; this.active = active;
} }

Loading…
Cancel
Save