Browse Source

REPORT-75998 改变底层关闭面板方式、修改正则表达式

feature/x
Destiny.Lin 2 years ago
parent
commit
a35cfde57c
  1. 4
      designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java
  2. 26
      designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java
  3. 12
      designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
  4. 5
      designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java
  5. 20
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
  6. 41
      designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java
  7. 7
      designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
  8. 5
      designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

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

@ -1,9 +1,9 @@
package com.fr.design.actions;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.actions.help.replace.ITReplaceUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.designer.TargetComponent;
@ -61,7 +61,7 @@ public class AllowAuthorityEditAction extends TemplateComponentAction {
DesignerContext.getDesignerFrame().refreshDottedLine();
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
EastRegionContainerPane.getInstance().removeParameterPane();
ITReplaceUtils.close();
DesignModuleFactory.getReplaceOperator().close();
//画虚线
return true;

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

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

12
designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java

@ -51,7 +51,7 @@ public class DesignModuleFactory {
private Class ITReplaceAction;
private Class formParaDesigner;
private Class paraPropertyPane;
private Class replacePane;
private static ITReplaceHelper replaceHelper;
private Class<? extends HierarchyTreePane> formHierarchyPaneCls;
private Class<? extends BaseWidgetPropertyPane> widgetPropertyPane;
private Class buttonDetailPaneClass;
@ -135,14 +135,14 @@ public class DesignModuleFactory {
/**
* 注册一下查找替换面板
* @param r
* @param
*/
public static void registerReplacePane(Class r) {
instance.replacePane = r;
public static void registerReplace(ITReplaceHelper replace) {
replaceHelper = replace;
}
public static Class<ITReplaceHelper> getReplacePane() {
return instance.replacePane;
public static ITReplaceHelper getReplaceOperator() {
return replaceHelper;
}
public static void registerParaPropertyPaneClass(Class p) {

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

@ -1,7 +1,5 @@
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.MutilTempalteTabPane;
import com.fr.design.fun.impl.AbstractPreviewProvider;
@ -12,7 +10,6 @@ import com.fr.design.module.DesignModuleFactory;
import com.fr.design.worker.WorkerManager;
import com.fr.design.worker.save.CallbackSaveWorker;
import com.fr.general.web.ParameterConstants;
import com.fr.log.FineLoggerFactory;
import java.util.HashMap;
import java.util.Map;
@ -51,7 +48,7 @@ public class DeveloperPreview extends AbstractPreviewProvider {
@Override
public void onClick(JTemplate<?, ?> jt) {
super.onClick(jt);
ITReplaceUtils.close();
DesignModuleFactory.getReplaceOperator().close();
SwingWorker worker = WorkerManager.getInstance().getWorker(jt.getRuntimeId());
if (worker instanceof CallbackSaveWorker) {
CallbackSaveWorker callbackSaveWorker = (CallbackSaveWorker) worker;

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

@ -6,6 +6,7 @@ import com.fr.design.actions.replace.action.ShowSearchResultAction;
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.UIDialog;
import com.fr.design.file.HistoryTemplateListCache;
@ -29,6 +30,7 @@ import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
import static com.fr.design.actions.replace.ui.ITTableEditorPane.getEditTable;
@ -39,7 +41,7 @@ import static com.fr.design.actions.replace.ui.ITTableEditorPane.getEditTable;
* @version 11.0
* created by Destiny.Lin on 2022-08-10
*/
public class ITReplaceMainDialog extends UIDialog implements ITReplaceHelper {
public class ITReplaceMainDialog extends UIDialog {
List<? extends Info> searchResultList = new ArrayList<>();
private static boolean ITReplaceFlag = false;
private static boolean matched = false;
@ -81,7 +83,7 @@ public class ITReplaceMainDialog extends UIDialog implements ITReplaceHelper {
}
}
}
instance.fitScreen();
setExisted(true);
return instance;
}
@ -285,6 +287,7 @@ public class ITReplaceMainDialog extends UIDialog implements ITReplaceHelper {
itTableEditor.clear();
String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText();
setSearchStr(searchStr);
ShowValueUtils.containPattern = Pattern.compile(ShowValueUtils.changeRegex(searchStr));
ShowSearchResultAction searchAction = ShowSearchResultAction.match(GeneralUtils.objectToString(northPane.getFindCombobox().getSelectedItem()));
if (searchAction != null) {
searchResultList = searchAction.addMatchResult(searchStr, searchAction.showSearchValue(jTemplate));
@ -313,7 +316,7 @@ public class ITReplaceMainDialog extends UIDialog implements ITReplaceHelper {
* 面板是否存在
* @return
*/
public boolean isExisted() {
public static boolean isExisted() {
return existed;
}
@ -322,16 +325,7 @@ public class ITReplaceMainDialog extends UIDialog implements ITReplaceHelper {
}
/**
* 进入权限编辑状态&开发者调试时关闭面板
*/
@Override
public void close(){
if (isExisted()){
getInstance().dispose();
setExisted(false);
}
}
/**
* 检测结果是否合法
*/

41
designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java

@ -0,0 +1,41 @@
package com.fr.design.actions.replace.utils;
import com.fr.design.actions.help.replace.ITReplaceHelper;
import com.fr.design.actions.replace.ui.ITReplaceMainDialog;
/**
* 操作面板
*
* @author Destiny.Lin
* @version 11.0
* created by Destiny.Lin on 2022-09-27
*/
public class ReplaceOperator implements ITReplaceHelper {
/**
* 进入权限编辑状态&开发者调试时关闭面板
*/
@Override
public void close(){
if (isExisted()){
ITReplaceMainDialog.getInstance().dispose();
setExisted(false);
}
}
/**
* 面板是否存在
* @return
*/
public boolean isExisted(){
return ITReplaceMainDialog.isExisted();
}
/**
* 设置面板存在属性
* @param existed
*/
public void setExisted(boolean existed){
ITReplaceMainDialog.setExisted(existed);
}
}

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

@ -28,6 +28,7 @@ public class ShowValueUtils {
public static final String ANY_THING_REGEX = ".";
public static final String NUMBER_REGEX = "[0-9]";
public static final String ENGLISH_REGEX = "[a-zA-Z]";
public static Pattern containPattern;
private static List<String> specialCharList = new ArrayList<>();
static {
@ -182,8 +183,7 @@ public class ShowValueUtils {
public static int indexOf(String str, String regexStr) {
CharSequence inputStr = str;
int failReturn = -1;
String patternStr = changeRegex(regexStr);
Pattern pattern = Pattern.compile(patternStr);
Pattern pattern = containPattern;
Matcher matcher = pattern.matcher(inputStr);
if (matcher.find()) {
return matcher.start();
@ -199,8 +199,7 @@ public class ShowValueUtils {
*/
public static boolean contains(String originStr, String matchStr) {
if (ITReplaceMainDialog.isMatched()) {
String str = changeRegex(matchStr);
Pattern pattern = Pattern.compile(str);
Pattern pattern = containPattern;
Matcher matcher = pattern.matcher(originStr);
return matcher.find();
} else {

5
designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

@ -32,7 +32,7 @@ import com.fr.design.actions.insert.flot.FormulaFloatAction;
import com.fr.design.actions.insert.flot.ImageFloatAction;
import com.fr.design.actions.insert.flot.TextBoxFloatAction;
import com.fr.design.actions.replace.ITReplaceAction;
import com.fr.design.actions.replace.ui.ITReplaceMainDialog;
import com.fr.design.actions.replace.utils.ReplaceOperator;
import com.fr.design.bridge.DesignToolbarProvider;
import com.fr.design.constants.DesignerLaunchStatus;
import com.fr.design.env.DesignerWorkspaceLoader;
@ -467,12 +467,13 @@ public class DesignerActivator extends Activator implements Prepare {
DesignModuleFactory.registerNewFormActionClass(NewFormAction.class);
DesignModuleFactory.registerReplaceActionClass(ITReplaceAction.class);
DesignModuleFactory.registerReplacePane(ITReplaceMainDialog.class);
DesignModuleFactory.registerFormParaDesignerClass(FormParaDesigner.class);
DesignModuleFactory.registerParaPropertyPaneClass(ParameterPropertyPane.class);
DesignModuleFactory.registerFormHierarchyPaneClass(FormHierarchyTreePane.class);
DesignModuleFactory.registerWidgetPropertyPaneClass(WidgetPropertyPane.class);
DesignModuleFactory.registerButtonDetailPaneClass(FormSubmitButtonDetailPane.class);
DesignModuleFactory.registerReplace(new ReplaceOperator());
DesignModuleFactory.registerParameterReader(new FormParameterReader());
StableFactory.registerMarkedClass(BaseJForm.XML_TAG, NewJForm.class);

Loading…
Cancel
Save