Browse Source

REPORT-75998 改变底层关闭面板方式

feature/x
Destiny.Lin 2 years ago
parent
commit
d64049244c
  1. 11
      designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java
  2. 19
      designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java
  3. 26
      designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java
  4. 9
      designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java
  5. 4
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java
  6. 11
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
  7. 10
      designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java

11
designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java

@ -1,17 +1,14 @@
package com.fr.design.actions; package com.fr.design.actions;
import com.fr.base.svg.IconUtils;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.design.actions.help.replace.ITReplaceUtils;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.designer.TargetComponent; import com.fr.design.designer.TargetComponent;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.*; import com.fr.design.mainframe.*;
import com.fr.invoke.Reflect;
import com.fr.log.FineLoggerFactory;
/** /**
* Author : daisy * Author : daisy
@ -64,11 +61,7 @@ public class AllowAuthorityEditAction extends TemplateComponentAction {
DesignerContext.getDesignerFrame().refreshDottedLine(); DesignerContext.getDesignerFrame().refreshDottedLine();
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
EastRegionContainerPane.getInstance().removeParameterPane(); EastRegionContainerPane.getInstance().removeParameterPane();
try { ITReplaceUtils.close();
Reflect.on(DesignModuleFactory.getReplacePane().newInstance()).call("close");
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
//画虚线 //画虚线
return true; return true;

19
designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java

@ -0,0 +1,19 @@
package com.fr.design.actions.help.replace;
/**
* 定义一些底层操作
*
* @author Destiny.Lin
* @version 11.0
* created by Destiny.Lin on 2022-09-27
*/
public interface ITReplaceHelper {
/**
* 关闭面板
*/
void close();
}

26
designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java

@ -0,0 +1,26 @@
package com.fr.design.actions.help.replace;
import com.fr.design.module.DesignModuleFactory;
import com.fr.log.FineLoggerFactory;
/**
* 工具类
*
* @author Destiny.Lin
* @version 11.0
* created by Destiny.Lin on 2022-09-27
*/
public class ITReplaceUtils {
/**
* 进入权限编辑&开发者调试时要关闭面板
*/
public static void close(){
try {
DesignModuleFactory.getReplacePane().newInstance().close();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}

9
designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java

@ -1,5 +1,7 @@
package com.fr.design.preview; package com.fr.design.preview;
import com.fr.design.actions.help.replace.ITReplaceHelper;
import com.fr.design.actions.help.replace.ITReplaceUtils;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.MutilTempalteTabPane; import com.fr.design.file.MutilTempalteTabPane;
import com.fr.design.fun.impl.AbstractPreviewProvider; import com.fr.design.fun.impl.AbstractPreviewProvider;
@ -10,7 +12,6 @@ import com.fr.design.module.DesignModuleFactory;
import com.fr.design.worker.WorkerManager; import com.fr.design.worker.WorkerManager;
import com.fr.design.worker.save.CallbackSaveWorker; import com.fr.design.worker.save.CallbackSaveWorker;
import com.fr.general.web.ParameterConstants; import com.fr.general.web.ParameterConstants;
import com.fr.invoke.Reflect;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import java.util.HashMap; import java.util.HashMap;
@ -50,11 +51,7 @@ public class DeveloperPreview extends AbstractPreviewProvider {
@Override @Override
public void onClick(JTemplate<?, ?> jt) { public void onClick(JTemplate<?, ?> jt) {
super.onClick(jt); super.onClick(jt);
try { ITReplaceUtils.close();
Reflect.on(DesignModuleFactory.getReplacePane().newInstance()).call("close");
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
SwingWorker worker = WorkerManager.getInstance().getWorker(jt.getRuntimeId()); SwingWorker worker = WorkerManager.getInstance().getWorker(jt.getRuntimeId());
if (worker instanceof CallbackSaveWorker) { if (worker instanceof CallbackSaveWorker) {
CallbackSaveWorker callbackSaveWorker = (CallbackSaveWorker) worker; CallbackSaveWorker callbackSaveWorker = (CallbackSaveWorker) worker;

4
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java

@ -52,7 +52,7 @@ public class SearchCommit2DBJSFormulaAction implements SearchJSFormula {
} }
private void dealWithColumnValue(List<FormulaInfo> formulaInfos, ITContent content, DMLConfig dmlConfig) { private void dealWithColumnValue(List<FormulaInfo> formulaInfos, ITContent content, DMLConfig dmlConfig) {
for (int i = 0; i < dmlConfig.getColumnConfigCount(); i++) { for (int i = 0, len = dmlConfig.getColumnConfigCount(); i < len; i++) {
ColumnConfig columnConfig = dmlConfig.getColumnConfig(i); ColumnConfig columnConfig = dmlConfig.getColumnConfig(i);
if (columnConfig.getColumnValue() instanceof Formula) { if (columnConfig.getColumnValue() instanceof Formula) {
ITContent configContent = ITContent.copy(content); ITContent configContent = ITContent.copy(content);
@ -64,7 +64,7 @@ public class SearchCommit2DBJSFormulaAction implements SearchJSFormula {
} }
private void dealWithSubmitJob(List<FormulaInfo> formulaInfos, ITContent content, DMLConfig dmlConfig) { private void dealWithSubmitJob(List<FormulaInfo> formulaInfos, ITContent content, DMLConfig dmlConfig) {
for (int i = 0; i < dmlConfig.getSubmitJobCount(); i++) { for (int i = 0, len = dmlConfig.getColumnConfigCount(); i < len; i++) {
//这边自定义事件不需要处理,只处理提交事件 //这边自定义事件不需要处理,只处理提交事件
if (dmlConfig.getSubmitJob(i) instanceof DMLConfigJob) { if (dmlConfig.getSubmitJob(i) instanceof DMLConfigJob) {
ITContent newContent = ITContent.copy(content); ITContent newContent = ITContent.copy(content);

11
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java

@ -1,16 +1,14 @@
package com.fr.design.actions.replace.ui; package com.fr.design.actions.replace.ui;
import com.fr.design.actions.help.replace.ITReplaceHelper;
import com.fr.design.actions.replace.action.ShowSearchResultAction; import com.fr.design.actions.replace.action.ShowSearchResultAction;
import com.fr.design.actions.replace.info.Info; import com.fr.design.actions.replace.info.Info;
import com.fr.design.actions.replace.utils.ShowValueUtils;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
@ -41,7 +39,7 @@ import static com.fr.design.actions.replace.ui.ITTableEditorPane.getEditTable;
* @version 11.0 * @version 11.0
* created by Destiny.Lin on 2022-08-10 * created by Destiny.Lin on 2022-08-10
*/ */
public class ITReplaceMainDialog extends UIDialog { public class ITReplaceMainDialog extends UIDialog implements ITReplaceHelper {
List<? extends Info> searchResultList = new ArrayList<>(); List<? extends Info> searchResultList = new ArrayList<>();
private static boolean ITReplaceFlag = false; private static boolean ITReplaceFlag = false;
private static boolean matched = false; private static boolean matched = false;
@ -315,7 +313,7 @@ public class ITReplaceMainDialog extends UIDialog {
* 面板是否存在 * 面板是否存在
* @return * @return
*/ */
public static boolean isExisted() { public boolean isExisted() {
return existed; return existed;
} }
@ -327,7 +325,8 @@ public class ITReplaceMainDialog extends UIDialog {
/** /**
* 进入权限编辑状态&开发者调试时关闭面板 * 进入权限编辑状态&开发者调试时关闭面板
*/ */
public static void close(){ @Override
public void close(){
if (isExisted()){ if (isExisted()){
getInstance().dispose(); getInstance().dispose();
setExisted(false); setExisted(false);

10
designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java

@ -140,7 +140,7 @@ public class ShowValueUtils {
int index = 0; int index = 0;
StringBuilder builder = new StringBuilder(str); StringBuilder builder = new StringBuilder(str);
while (matcher.find()) { while (matcher.find()) {
builder.replace(matcher.start() + index, matcher.end() + index, head + matcher.group() + tail); builder.replace(matcher.start() + index, matcher.end() + index, head + changeHtmlStr(matcher.group()) + tail);
index += size; index += size;
} }
return "<html><body><div><nobr>" + return "<html><body><div><nobr>" +
@ -148,12 +148,18 @@ public class ShowValueUtils {
"</nobr></div></body></html>"; "</nobr></div></body></html>";
} else { } else {
return "<html><body><div><nobr>" + return "<html><body><div><nobr>" +
replaceAll(str, searchStr, "<font color = 'rgb(61,153,249)'>" + searchStr + "</font>") + replaceAll(str, searchStr, "<font color = 'rgb(61,153,249)'>" + changeHtmlStr(searchStr) + "</font>") +
"</nobr></div></body></html>"; "</nobr></div></body></html>";
} }
} }
private static String changeHtmlStr(String searchStr){
String showStr = searchStr;
showStr = showStr.replace("<","&lt;");
showStr = showStr.replace(">", "&gt");
return showStr;
}
/** /**
* 集合是否不为空 * 集合是否不为空

Loading…
Cancel
Save