Browse Source

REPORT-48228 【10.0.15】国际化接口-插件jar包不匹配弹窗接口

feature/big-screen
lucian 4 years ago
parent
commit
4ab8a7ec1f
  1. 19
      designer-base/src/main/java/com/fr/design/fun/PluginErrorRemindHandleProvider.java
  2. 30
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractPluginErrorRemindHandleProvider.java
  3. 14
      designer-base/src/main/java/com/fr/env/PluginErrorRemindDialog.java

19
designer-base/src/main/java/com/fr/design/fun/PluginErrorRemindHandleProvider.java

@ -0,0 +1,19 @@
package com.fr.design.fun;
import com.fr.stable.fun.mark.Selectable;
/**
* 插件不匹配时设计器提示框的立即处理事件
* @author Lucian.Chen
* @version 10.0
* Created by Lucian.Chen on 2021/2/20
*/
public interface PluginErrorRemindHandleProvider extends Selectable {
String MARK_STRING = "PluginErrorRemindHandleProvider";
int CURRENT_LEVEL = 1;
// 打开插件管理
void openPluginManager();
}

30
designer-base/src/main/java/com/fr/design/fun/impl/AbstractPluginErrorRemindHandleProvider.java

@ -0,0 +1,30 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.PluginErrorRemindHandleProvider;
import com.fr.stable.fun.assist.Selector;
import com.fr.stable.fun.impl.AbstractProvider;
import com.fr.stable.fun.mark.API;
/**
* @author Lucian.Chen
* @version 10.0
* Created by Lucian.Chen on 2021/2/20
*/
@API(level = PluginErrorRemindHandleProvider.CURRENT_LEVEL)
public abstract class AbstractPluginErrorRemindHandleProvider extends AbstractProvider implements PluginErrorRemindHandleProvider {
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public String mark4Provider() {
return getClass().getName();
}
@Override
public Selector selector() {
return Selector.ALWAYS;
}
}

14
designer-base/src/main/java/com/fr/env/PluginErrorRemindDialog.java vendored

@ -1,12 +1,15 @@
package com.fr.env; package com.fr.env;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.server.PluginManagerAction; import com.fr.design.actions.server.PluginManagerAction;
import com.fr.design.fun.PluginErrorRemindHandleProvider;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.stable.bridge.ObjectHolder;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
@ -23,6 +26,7 @@ import java.awt.Frame;
import java.awt.Insets; import java.awt.Insets;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.Set;
/** /**
* 插件启动失败提示窗 * 插件启动失败提示窗
@ -113,6 +117,16 @@ public class PluginErrorRemindDialog extends JDialog implements ActionListener {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
this.jDialog.dispose(); this.jDialog.dispose();
// 先从插件找
Set<PluginErrorRemindHandleProvider> providers = ExtraDesignClassManager.getInstance().getArray(PluginErrorRemindHandleProvider.MARK_STRING);
if (providers != null) {
for (PluginErrorRemindHandleProvider provider : providers) {
if (provider.selector().accept(new ObjectHolder())) {
provider.openPluginManager();
return;
}
}
}
super.actionPerformed(e); super.actionPerformed(e);
} }
} }

Loading…
Cancel
Save