Browse Source

REPORT-47901 填报-导入excel-双向扩展是,表头部分扩展,多行导入数据丢失

feature/big-screen
lucian 4 years ago
parent
commit
96896d5f36
  1. 19
      designer-base/src/main/java/com/fr/design/fun/PluginErrorRemindHandleProvider.java
  2. 20
      designer-base/src/main/java/com/fr/design/fun/PluginManagerProvider.java
  3. 6
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractPluginManagerProvider.java
  4. 16
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  5. 33
      designer-base/src/main/java/com/fr/env/PluginErrorRemindDialog.java

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

@ -1,19 +0,0 @@
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();
}

20
designer-base/src/main/java/com/fr/design/fun/PluginManagerProvider.java

@ -0,0 +1,20 @@
package com.fr.design.fun;
import com.fr.design.actions.UpdateAction;
import com.fr.stable.fun.mark.Selectable;
/**
* 替换插件管理入口
* @author Lucian.Chen
* @version 10.0
* Created by Lucian.Chen on 2021/2/20
*/
public interface PluginManagerProvider extends Selectable {
String MARK_STRING = "PluginManagerProvider";
int CURRENT_LEVEL = 1;
// 插件管理
UpdateAction pluginManagerAction();
}

6
designer-base/src/main/java/com/fr/design/fun/impl/AbstractPluginErrorRemindHandleProvider.java → designer-base/src/main/java/com/fr/design/fun/impl/AbstractPluginManagerProvider.java

@ -1,6 +1,6 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.PluginErrorRemindHandleProvider;
import com.fr.design.fun.PluginManagerProvider;
import com.fr.stable.fun.assist.Selector;
import com.fr.stable.fun.impl.AbstractProvider;
import com.fr.stable.fun.mark.API;
@ -10,8 +10,8 @@ import com.fr.stable.fun.mark.API;
* @version 10.0
* Created by Lucian.Chen on 2021/2/20
*/
@API(level = PluginErrorRemindHandleProvider.CURRENT_LEVEL)
public abstract class AbstractPluginErrorRemindHandleProvider extends AbstractProvider implements PluginErrorRemindHandleProvider {
@API(level = PluginManagerProvider.CURRENT_LEVEL)
public abstract class AbstractPluginManagerProvider extends AbstractProvider implements PluginManagerProvider {
public int currentAPILevel() {
return CURRENT_LEVEL;

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

@ -41,6 +41,7 @@ import com.fr.design.actions.server.PluginManagerAction;
import com.fr.design.file.NewTemplatePane;
import com.fr.design.fun.MenuHandler;
import com.fr.design.fun.OemProcessor;
import com.fr.design.fun.PluginManagerProvider;
import com.fr.design.fun.TableDataPaneProcessor;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
@ -72,6 +73,7 @@ import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginEventType;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.bridge.ObjectHolder;
import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter;
import com.fr.start.OemHandler;
@ -489,7 +491,7 @@ public abstract class ToolBarMenuDock {
if (!DesignerMode.isAuthorityEditing()) {
if (shouldShowPlugin()) {
menuDef.addShortCut(
new PluginManagerAction()
createPluginManagerAction()
);
}
menuDef.addShortCut(
@ -502,6 +504,18 @@ public abstract class ToolBarMenuDock {
return menuDef;
}
private ShortCut createPluginManagerAction() {
Set<PluginManagerProvider> providers = ExtraDesignClassManager.getInstance().getArray(PluginManagerProvider.MARK_STRING);
if (providers != null) {
for (PluginManagerProvider provider : providers) {
if (provider.selector().accept(new ObjectHolder())) {
return provider.pluginManagerAction();
}
}
}
return new PluginManagerAction();
}
private ShortCut createGlobalTDAction() {
TableDataPaneProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TableDataPaneProcessor.XML_TAG);
return processor == null ? new GlobalTableDataAction() : processor.createServerTDAction();

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

@ -1,8 +1,9 @@
package com.fr.env;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.server.PluginManagerAction;
import com.fr.design.fun.PluginErrorRemindHandleProvider;
import com.fr.design.fun.PluginManagerProvider;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
@ -81,7 +82,7 @@ public class PluginErrorRemindDialog extends JDialog implements ActionListener {
UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Deal_With"));
cancelButton.addActionListener(this);
okButton.addActionListener(new PluginManagerActionAdapter(this));
okButton.addActionListener(new PluginManagerHandleAction(this));
// 按钮
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
@ -106,28 +107,34 @@ public class PluginErrorRemindDialog extends JDialog implements ActionListener {
this.dispose();
}
private static class PluginManagerActionAdapter extends PluginManagerAction {
private static class PluginManagerHandleAction extends UpdateAction {
private JDialog jDialog;
private UpdateAction pluginManagerAction;
public PluginManagerActionAdapter(JDialog jDialog) {
public PluginManagerHandleAction(JDialog jDialog) {
this.jDialog = jDialog;
initPluginManagerAction();
}
@Override
public void actionPerformed(ActionEvent e) {
this.jDialog.dispose();
// 先从插件找
Set<PluginErrorRemindHandleProvider> providers = ExtraDesignClassManager.getInstance().getArray(PluginErrorRemindHandleProvider.MARK_STRING);
private void initPluginManagerAction() {
Set<PluginManagerProvider> providers = ExtraDesignClassManager.getInstance().getArray(PluginManagerProvider.MARK_STRING);
if (providers != null) {
for (PluginErrorRemindHandleProvider provider : providers) {
for (PluginManagerProvider provider : providers) {
if (provider.selector().accept(new ObjectHolder())) {
provider.openPluginManager();
return;
this.pluginManagerAction = provider.pluginManagerAction();
}
}
}
super.actionPerformed(e);
if (this.pluginManagerAction == null) {
this.pluginManagerAction = new PluginManagerAction();
}
}
@Override
public void actionPerformed(ActionEvent e) {
this.jDialog.dispose();
this.pluginManagerAction.actionPerformed(e);
}
}

Loading…
Cancel
Save