Browse Source

REPORT-62680 插件-插件管理-设计器里没有适配禁用提示

代码质量问题
bugfix/11.0
yvan 3 years ago
parent
commit
3e6b0f874e
  1. 9
      designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java

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

@ -26,6 +26,7 @@ import com.fr.plugin.manage.control.PluginTaskCallback;
import com.fr.plugin.manage.control.PluginTaskResult; import com.fr.plugin.manage.control.PluginTaskResult;
import com.fr.plugin.view.PluginView; import com.fr.plugin.view.PluginView;
import com.fr.plugin.xml.PluginElementName; import com.fr.plugin.xml.PluginElementName;
import com.fr.plugin.xml.PluginXmlElement;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
@ -101,10 +102,12 @@ public class PluginOperateUtils {
boolean active = plugin.isActive(); boolean active = plugin.isActive();
PluginTaskCallback modifyStatusCallback = new ModifyStatusCallback(active, jsCallback); PluginTaskCallback modifyStatusCallback = new ModifyStatusCallback(active, jsCallback);
if (active) { if (active) {
PluginXmlElement forbidReminder = plugin.getXml().getElement(PluginElementName.ForbidReminder);
if (forbidReminder != null && forbidReminder.getContent() != null) {
// 禁用前提示 // 禁用前提示
int rv = FineJOptionPane.showConfirmDialog( int rv = FineJOptionPane.showConfirmDialog(
null, null,
plugin.getXml().getElement(PluginElementName.ForbidReminder).getContent(), forbidReminder.getContent(),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
JOptionPane.OK_CANCEL_OPTION, JOptionPane.OK_CANCEL_OPTION,
JOptionPane.WARNING_MESSAGE JOptionPane.WARNING_MESSAGE
@ -112,6 +115,10 @@ public class PluginOperateUtils {
if (rv == JOptionPane.OK_OPTION) { if (rv == JOptionPane.OK_OPTION) {
PluginManager.getController().forbid(pluginMarker, modifyStatusCallback); PluginManager.getController().forbid(pluginMarker, modifyStatusCallback);
} }
} else {
// 正常禁用
PluginManager.getController().forbid(pluginMarker, modifyStatusCallback);
}
} else { } else {
PluginManager.getController().enable(pluginMarker, modifyStatusCallback); PluginManager.getController().enable(pluginMarker, modifyStatusCallback);
} }

Loading…
Cancel
Save