Browse Source

Merge pull request #8903 in DESIGN/design from release/11.0 to feature/x

* commit 'ef548d24f7d74ec4c8063d135516bde1a4c543c9':
  REPORT-71449 【冒烟】不复制新的数据集,“剪贴版”的数据集会变化 【问题原因】粘贴的时候没有做clone处理,假如修改粘贴后的数据集,会同步修改掉剪切板里存的Tableda 【改动思路】添加粘贴时TableData的clone逻辑 【review建议】
  REPORT-71449 【冒烟】不复制新的数据集,“剪贴版”的数据集会变化 【问题原因】复制到剪切板中的数据集,在粘贴的时候,TableData没做clone处理,当修改粘贴出来的数据集时,会同步影响剪切板里的TableData 【改动思路】粘贴时增加clone处理 【review建议】无
  REPORT-71309 fix 可能的npe
  REPORT-71213 拆分下大方法 && 处理空值
  REPORT-71309 && REPORT-71298 搜索展示异常
  REPORT-71213 交互点补充:关闭了产品动态时,悬浮按钮不显示有新消息推送
  REPORT-71213 设计器关闭失败
  REPORT-70446 mac下悬浮弹窗隐藏重新展示时偶现白点
  REPORT-70857 数据集复制后独立 【问题原因】匹配TableData时,用的equals比较,但是同一个对象equals为false,目前已知的是存储过程TableData,已经跟rinoux沟通 【改动思路】直接换成对象比较 【review建议】无
  REPORT-71158 打开fvs,从远程切换到本地,设计器模板展示空白
feature/x
superman 3 years ago
parent
commit
60ed4d4e03
  1. 5
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java
  2. 21
      designer-base/src/main/java/com/fr/design/data/tabledata/paste/TableDataFollowingPasteUtils.java
  3. 4
      designer-form/src/main/java/com/fr/design/gui/xpane/LayoutBorderPane.java
  4. 6
      designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java
  5. 4
      designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java
  6. 16
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java
  7. 59
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java
  8. 3
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java

5
designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java

@ -1133,7 +1133,10 @@ public class TableDataTreePane extends BasicTableDataTreePane {
// 处理数据集名称 // 处理数据集名称
String dsName = getNoRepeatedDsName4Paste(dataWrapperEntry.getKey()); String dsName = getNoRepeatedDsName4Paste(dataWrapperEntry.getKey());
AbstractTableDataWrapper wrapper = dataWrapperEntry.getValue(); AbstractTableDataWrapper wrapper = dataWrapperEntry.getValue();
addDataPane(TableDataFollowingPasteUtils.generateTableDataPaneWhenPaste(wrapper), dsName); AbstractTableDataPane<?> tableDataPane = TableDataFollowingPasteUtils.generateTableDataPaneWhenPaste(wrapper);
if (tableDataPane != null) {
addDataPane(tableDataPane, dsName);
}
} }
} }
} }

21
designer-base/src/main/java/com/fr/design/data/tabledata/paste/TableDataFollowingPasteUtils.java

@ -66,7 +66,10 @@ public class TableDataFollowingPasteUtils {
continue; continue;
} }
AbstractTableDataWrapper tableDataWrapper = new TemplateTableDataWrapper(dataWrapperEntry.getValue(), dsName); AbstractTableDataWrapper tableDataWrapper = new TemplateTableDataWrapper(dataWrapperEntry.getValue(), dsName);
tableDataTreePane.addDataPane(generateTableDataPaneWhenPaste(tableDataWrapper), dsName); AbstractTableDataPane<?> tableDataPane = generateTableDataPaneWhenPaste(tableDataWrapper);
if (tableDataPane != null) {
tableDataTreePane.addDataPane(tableDataPane, dsName);
}
} }
} }
@ -163,7 +166,8 @@ public class TableDataFollowingPasteUtils {
for (Map.Entry<String, TableDataWrapper> dataWrapperEntry : dataWrapperMap.entrySet()) { for (Map.Entry<String, TableDataWrapper> dataWrapperEntry : dataWrapperMap.entrySet()) {
String tdName = dataWrapperEntry.getKey(); String tdName = dataWrapperEntry.getKey();
TableData td = dataWrapperEntry.getValue().getTableData(); TableData td = dataWrapperEntry.getValue().getTableData();
if (td.equals(tableData)) { // 有些数据集的equals方法有问题,这里直接判断对象地址
if (td == tableData) {
return tdName; return tdName;
} }
} }
@ -371,11 +375,18 @@ public class TableDataFollowingPasteUtils {
* 生成粘贴新建时使用的AbstractTableDataPane * 生成粘贴新建时使用的AbstractTableDataPane
* 主要是为了处理StoreProcedure它在远程情况下无法及时获取参数这边因为是复制粘贴所以直接用原TableData的参数即可 * 主要是为了处理StoreProcedure它在远程情况下无法及时获取参数这边因为是复制粘贴所以直接用原TableData的参数即可
* @param tableDataWrapper wrapper * @param tableDataWrapper wrapper
* @return AbstractTableDataPane * @return AbstractTableDataPane,当TableData clone失败时方法返回null
*/ */
@Nullable
public static AbstractTableDataPane<?> generateTableDataPaneWhenPaste(AbstractTableDataWrapper tableDataWrapper) { public static AbstractTableDataPane<?> generateTableDataPaneWhenPaste(AbstractTableDataWrapper tableDataWrapper) {
AbstractTableDataPane<?> tableDataPane = tableDataWrapper.creatTableDataPane(); // 粘贴时再做一次TableData的clone
TableData tableData = tableDataWrapper.getTableData(); TableData clonedTableData = cloneTableData(tableDataWrapper.getTableData());
if (clonedTableData == null) {
return null;
}
AbstractTableDataWrapper clonedWrapper = new TemplateTableDataWrapper(clonedTableData);
AbstractTableDataPane<?> tableDataPane = clonedWrapper.creatTableDataPane();
TableData tableData = clonedWrapper.getTableData();
if (tableData instanceof StoreProcedure) { if (tableData instanceof StoreProcedure) {
StoreProcedure storeProcedure = (StoreProcedure) tableData; StoreProcedure storeProcedure = (StoreProcedure) tableData;
((ProcedureDataPane) tableDataPane).populateParameters(storeProcedure.getParameters()); ((ProcedureDataPane) tableDataPane).populateParameters(storeProcedure.getParameters());

4
designer-form/src/main/java/com/fr/design/gui/xpane/LayoutBorderPane.java

@ -333,8 +333,8 @@ public class LayoutBorderPane extends BasicPane {
JPanel rightPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel rightPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
defaultPane.add(rightPane, BorderLayout.EAST); defaultPane.add(rightPane, BorderLayout.EAST);
rightPane.add(initRightBottomPane(), BorderLayout.CENTER); rightPane.add(initRightBottomPane(), BorderLayout.CENTER);
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate<?, ?> jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (!jTemplate.isJWorkBook() && ((JForm)jTemplate).isSelectRootPane()){ if (!jTemplate.isJWorkBook() && jTemplate instanceof JForm && ((JForm)jTemplate).isSelectRootPane()){
//界面上表单主体只有背景和透明度可以设置 //界面上表单主体只有背景和透明度可以设置
rightPane.add(initBodyRightTopPane(), BorderLayout.NORTH); rightPane.add(initBodyRightTopPane(), BorderLayout.NORTH);
} else { } else {

6
designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java

@ -66,8 +66,10 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JTemplate currentEditingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate<?, ?> currentEditingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
boolean isRootLayout = currentEditingTemplate != null && !currentEditingTemplate.isJWorkBook() && ((JForm)currentEditingTemplate).isSelectRootPane(); boolean isRootLayout = currentEditingTemplate != null &&
!currentEditingTemplate.isJWorkBook() &&
currentEditingTemplate instanceof JForm && ((JForm)currentEditingTemplate).isSelectRootPane();
namedTitleStylePane = createNamedTitleStylePane(isRootLayout); namedTitleStylePane = createNamedTitleStylePane(isRootLayout);
namedBodyStylePane = createNamedBodyStylePane(isRootLayout); namedBodyStylePane = createNamedBodyStylePane(isRootLayout);

4
designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java

@ -76,8 +76,8 @@ public class WidgetBoundPane extends BasicPane {
height.setEnabled(false); height.setEnabled(false);
} }
JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate<?, ?> jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jTemplate.isJWorkBook() || !((JForm)jTemplate).isSelectRootPane()) { if (jTemplate.isJWorkBook() || !((jTemplate instanceof JForm) && ((JForm)jTemplate).isSelectRootPane())) {
ratioLockedButton = new AspectRatioLockedButton(width, height); ratioLockedButton = new AspectRatioLockedButton(width, height);
ratioLockedButton.setGlobalName(i18nText("Fine-Design_Form_Coords_And_Size")); ratioLockedButton.setGlobalName(i18nText("Fine-Design_Form_Coords_And_Size"));
ratioLockedButton.setLockEnabled(false); ratioLockedButton.setLockEnabled(false);

16
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java

@ -32,6 +32,10 @@ public class AlphaFineUtil {
private static String getReplacedString(String modelName, String string) { private static String getReplacedString(String modelName, String string) {
// 如果是直接包含了高亮字符 返回
if (StringUtils.contains(modelName, string)) {
return string;
}
//需要考虑modelName有空格的情况 //需要考虑modelName有空格的情况
//比如现在是work boo k 搜索词是workb,应该要替换的部分是work b //比如现在是work boo k 搜索词是workb,应该要替换的部分是work b
//先去掉已经匹配替换过的部分,因为考虑到分词的情况,可能会进行多次替换 //先去掉已经匹配替换过的部分,因为考虑到分词的情况,可能会进行多次替换
@ -53,6 +57,18 @@ public class AlphaFineUtil {
return result.toString(); return result.toString();
} }
public static String escapeExprSpecialWord(String keyword) {
if (StringUtils.isNotBlank(keyword)) {
String[] fbsArr = { "\\", "$", "(", ")", "*", "+", ".", "[", "]", "?", "^", "{", "}", "|" };
for (String key : fbsArr) {
if (keyword.contains(key)) {
keyword = keyword.replace(key, "\\" + key);
}
}
}
return keyword;
}
public static boolean unread() { public static boolean unread() {
Set<Long> readSet = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getReadSet(); Set<Long> readSet = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getReadSet();
Set<Long> idSet = ProductNewsSearchManager.getInstance().getIdSet(); Set<Long> idSet = ProductNewsSearchManager.getInstance().getIdSet();

59
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java

@ -367,23 +367,7 @@ public class AlphaFineFrame extends JFrame {
JPanel tabPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 20, 10)); JPanel tabPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 20, 10));
tabPane.setBackground(Color.WHITE); tabPane.setBackground(Color.WHITE);
List<SelectedLabel> selectedLabelList = new ArrayList<>(); List<SelectedLabel> selectedLabelList = createSelectedLabelList();
AlphaFineConfigManager alphaFineConfigManager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager();
if (alphaFineConfigManager.isProductDynamics()) {
selectedLabelList.add(new SelectedLabel(PRODUCT_NEWS, CellType.PRODUCT_NEWS, true));
}
if (alphaFineConfigManager.isContainAction()) {
selectedLabelList.add(new SelectedLabel(SETTING, CellType.ACTION));
}
if (alphaFineConfigManager.isContainFileContent() || alphaFineConfigManager.isContainTemplate()) {
selectedLabelList.add(new SelectedLabel(TEMPLATES, CellType.FILE));
}
if (alphaFineConfigManager.isContainDocument()) {
selectedLabelList.add(new SelectedLabel(HELP, CellType.DOCUMENT));
}
if (alphaFineConfigManager.isContainPlugin()) {
selectedLabelList.add(new SelectedLabel(PLUGIN, CellType.PLUGIN));
}
selectedType = selectedLabelList.get(0).getCellType(); selectedType = selectedLabelList.get(0).getCellType();
// 第一个tab 非产品动态 // 第一个tab 非产品动态
if (selectedType != CellType.PRODUCT_NEWS) { if (selectedType != CellType.PRODUCT_NEWS) {
@ -391,8 +375,18 @@ public class AlphaFineFrame extends JFrame {
readLabel.setVisible(false); readLabel.setVisible(false);
} }
for (SelectedLabel selectedLabel : selectedLabelList) { for (SelectedLabel selectedLabel : selectedLabelList) {
selectedLabel.addMouseListener(createMouseListener(selectedLabelList, selectedLabel, tabPane, tabLabel, readLabel));
tabPane.add(selectedLabel);
}
showPane.add(tabPane, BorderLayout.NORTH);
showPane.add(labelPane, BorderLayout.CENTER);
showPane.add(resultPane, BorderLayout.SOUTH);
return showPane;
}
selectedLabel.addMouseListener(new MouseAdapter() { private MouseAdapter createMouseListener(List<SelectedLabel> selectedLabelList, SelectedLabel selectedLabel,
JPanel tabPane, UILabel tabLabel, UILabel readLabel) {
return new MouseAdapter() {
@Override @Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
for (SelectedLabel label : selectedLabelList) { for (SelectedLabel label : selectedLabelList) {
@ -450,13 +444,28 @@ public class AlphaFineFrame extends JFrame {
public void mouseExited(MouseEvent e) { public void mouseExited(MouseEvent e) {
selectedLabel.setForeground(defaultColor); selectedLabel.setForeground(defaultColor);
} }
}); };
tabPane.add(selectedLabel);
} }
showPane.add(tabPane, BorderLayout.NORTH);
showPane.add(labelPane, BorderLayout.CENTER); private List<SelectedLabel> createSelectedLabelList() {
showPane.add(resultPane, BorderLayout.SOUTH); List<SelectedLabel> selectedLabelList = new ArrayList<>();
return showPane; AlphaFineConfigManager alphaFineConfigManager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager();
if (alphaFineConfigManager.isProductDynamics()) {
selectedLabelList.add(new SelectedLabel(PRODUCT_NEWS, CellType.PRODUCT_NEWS, true));
}
if (alphaFineConfigManager.isContainAction()) {
selectedLabelList.add(new SelectedLabel(SETTING, CellType.ACTION));
}
if (alphaFineConfigManager.isContainFileContent() || alphaFineConfigManager.isContainTemplate()) {
selectedLabelList.add(new SelectedLabel(TEMPLATES, CellType.FILE));
}
if (alphaFineConfigManager.isContainDocument()) {
selectedLabelList.add(new SelectedLabel(HELP, CellType.DOCUMENT));
}
if (alphaFineConfigManager.isContainPlugin()) {
selectedLabelList.add(new SelectedLabel(PLUGIN, CellType.PLUGIN));
}
return selectedLabelList;
} }
private void fireOneClickRead() { private void fireOneClickRead() {
@ -699,7 +708,7 @@ public class AlphaFineFrame extends JFrame {
} else if (searchText.startsWith(DS_MARK)) { } else if (searchText.startsWith(DS_MARK)) {
return new SearchTextBean(getStoreText(searchText), new String[]{DS_NAME + getStoreText(searchText)}); return new SearchTextBean(getStoreText(searchText), new String[]{DS_NAME + getStoreText(searchText)});
} else { } else {
return new SearchTextBean(searchText, segmentationResult); return new SearchTextBean(searchText, segmentationResult == null ? new String[]{} : segmentationResult);
} }
} }

3
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe.alphafine.question;
import com.fr.base.svg.SVGLoader; import com.fr.base.svg.SVGLoader;
import com.fr.base.svg.SystemScaleUtils; import com.fr.base.svg.SystemScaleUtils;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.alphafine.AlphaFineUtil; import com.fr.design.mainframe.alphafine.AlphaFineUtil;
import com.fr.design.utils.SvgPaintUtils; import com.fr.design.utils.SvgPaintUtils;
import java.awt.Color; import java.awt.Color;
@ -37,7 +38,7 @@ public class QuestionPane extends JPanel {
int width = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getWidth() * SVGLoader.SYSTEM_SCALE) : getWidth(); int width = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getWidth() * SVGLoader.SYSTEM_SCALE) : getWidth();
int height = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getHeight() * SVGLoader.SYSTEM_SCALE) : getHeight(); int height = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getHeight() * SVGLoader.SYSTEM_SCALE) : getHeight();
if (AlphaFineUtil.unread()) { if (AlphaFineUtil.unread() && DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isProductDynamics()) {
g2.drawImage(NEW_MESSAGE_IMAGE, 0, 0, this); g2.drawImage(NEW_MESSAGE_IMAGE, 0, 0, this);
} else { } else {
g2.drawImage(QUESTION_BACKGROUND_IMAGE, 0, 0, this); g2.drawImage(QUESTION_BACKGROUND_IMAGE, 0, 0, this);

Loading…
Cancel
Save