Browse Source

Merging in latest from upstream (DESIGN/design:refs/heads/release/11.0)

* commit 'b3a41aac36cdb5fbe33070170695e0914f45a4b2':
  REPORT-65975 填报-控件-控件事件中添加提交事件,点击表名后会退出当前选择界面
  REPORT-65975 填报-控件-控件事件中添加提交事件,点击表名后会退出当前选择界面
  REPORT-65722  设计器点击选择按钮控件图标时无反应,没有出现原生文件选择器弹窗 同步到11.0
  REPORT-65513 填报-填报属性设置-设置单元格组,提示“单元格个数必须相同”的交互逻辑问题
  REPORT-65194 公式模拟计算计算异常的提示框内的图标不正确 1.计算异常的时候给warn图标
  REPORT-65475 AlphaFine搜索慢
  REPORT-65613 【主题边框】单元格样式修改文本和对齐样式,会导致边框配置丢失
  REPORT-65502 【外包验收】分页设置-按行分页,设置超过500时值会保存为空而不是1或500
  REPORT-65290 设计器-水印,平台改变水印开关,模板水印变成了模板单独设置 1.判断水印的有效值
  REPORT-65576 框选单元格,切换主题,会影响单元格内容的格式
  REPORT-65515【稳定共创】公式编辑器-存在插件函数时,选择数据集参数函数显示跳转显示有问题 1.选择参数的时候返回默认值
  REPORT-65515【稳定共创】公式编辑器-存在插件函数时,选择数据集参数函数显示跳转显示有问题 1.选中参数时,返回默认的值
  REPORT-61615 设计器未安装数据集/数据连接插件 但服务器安装了 设计器端保存数据集/数据连接会造成连接丢失
  CHART-22259 feat:插件重新加载或者切换env fvs模板重新加载
  REPORT-64609 磁盘空间满时 保存模板造成模板丢失
bugfix/11.0
kerry 3 years ago
parent
commit
0feb72fc39
  1. 20
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java
  2. 19
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  3. 23
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java
  4. 18
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java
  5. 37
      designer-base/src/main/java/com/fr/design/gui/icombobox/TableSearchTreeComboBox.java
  6. 6
      designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java
  7. 18
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  8. 12
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java
  9. 18
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java
  10. 6
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java
  11. 17
      designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java
  12. 17
      designer-realize/src/main/java/com/fr/design/webattr/PageWebSettingPane.java
  13. 7
      designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

20
designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java

@ -17,9 +17,12 @@ import com.fr.event.EventDispatcher;
import com.fr.file.ProcedureConfig; import com.fr.file.ProcedureConfig;
import com.fr.file.TableDataConfig; import com.fr.file.TableDataConfig;
import com.fr.file.TableDataOperator; import com.fr.file.TableDataOperator;
import com.fr.file.TableDataOperatorImpl;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.rpc.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -246,7 +249,13 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
tableDataBeans.add(new TableDataBean(nameObject.getName(), oldName, (TableData) nameObject.getObject())); tableDataBeans.add(new TableDataBean(nameObject.getName(), oldName, (TableData) nameObject.getObject()));
} }
try { try {
WorkContext.getCurrent().get(TableDataOperator.class).saveTableData(tableDataBeans); WorkContext.getCurrent().get(TableDataOperator.class, new ExceptionHandler() {
@Override
public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) {
// 走老的方式
return saveByOldWay(tableDataBeans);
}
}).saveTableData(new ArrayList<>(tableDataConfig.getTableDatas().keySet()), tableDataBeans);
if (!WorkContext.getCurrent().isLocal()) { if (!WorkContext.getCurrent().isLocal()) {
EventDispatcher.fire(RemoteConfigEvent.EDIT, TableDataConfig.getInstance().getNameSpace()); EventDispatcher.fire(RemoteConfigEvent.EDIT, TableDataConfig.getInstance().getNameSpace());
} }
@ -255,6 +264,15 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
} }
} }
private boolean saveByOldWay(List<TableDataBean> tableDataBean) {
try {
return TableDataOperatorImpl.getInstance().saveTableData(tableDataBean);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return false;
}
}
@Override @Override
public void update(TableDataSource tds) { public void update(TableDataSource tds) {
tds.clearAllTableData(); tds.clearAllTableData();

19
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java

@ -16,8 +16,11 @@ import com.fr.design.i18n.Toolkit;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.file.ConnectionConfig; import com.fr.file.ConnectionConfig;
import com.fr.file.ConnectionOperator; import com.fr.file.ConnectionOperator;
import com.fr.file.ConnectionOperatorImpl;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.rpc.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -170,7 +173,12 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
connectionBeans.add(new ConnectionBean(nameObject.getName(), oldName, (Connection) nameObject.getObject())); connectionBeans.add(new ConnectionBean(nameObject.getName(), oldName, (Connection) nameObject.getObject()));
} }
try { try {
WorkContext.getCurrent().get(ConnectionOperator.class).saveConnection(connectionBeans); WorkContext.getCurrent().get(ConnectionOperator.class, new ExceptionHandler() {
@Override
public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) {
return saveByOldWay(connectionBeans);
}
}).saveConnection(new ArrayList<>(connectionConfig.getConnections().keySet()), connectionBeans);
if (!WorkContext.getCurrent().isLocal()) { if (!WorkContext.getCurrent().isLocal()) {
EventDispatcher.fire(RemoteConfigEvent.EDIT, ConnectionConfig.getInstance().getNameSpace()); EventDispatcher.fire(RemoteConfigEvent.EDIT, ConnectionConfig.getInstance().getNameSpace());
} }
@ -179,6 +187,15 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
} }
} }
private boolean saveByOldWay(List<ConnectionBean> connectionBeans) {
try {
return ConnectionOperatorImpl.getInstance().saveConnection(connectionBeans);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return false;
}
}
public static void showDialog(Window parent) { public static void showDialog(Window parent) {
final ConnectionConfig connectionConfig = ConnectionConfig.getInstance(); final ConnectionConfig connectionConfig = ConnectionConfig.getInstance();
final ConnectionManagerPane connectionManagerPane = new ConnectionManagerPane() { final ConnectionManagerPane connectionManagerPane = new ConnectionManagerPane() {

23
designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java

@ -15,7 +15,6 @@ import com.fr.design.mainframe.JVirtualTemplate;
import com.fr.design.ui.util.UIUtil; import com.fr.design.ui.util.UIUtil;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.file.FileNodeFILE; import com.fr.file.FileNodeFILE;
import com.fr.file.StashedFILE;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.invoke.ClassHelper; import com.fr.invoke.ClassHelper;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
@ -25,7 +24,7 @@ import com.fr.stable.CoreConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.org.apache.commons.io.FilenameUtils; import com.fr.third.org.apache.commons.io.FilenameUtils;
import java.io.ByteArrayOutputStream; import javax.swing.SwingWorker;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
@ -33,7 +32,6 @@ import java.util.List;
import java.util.ListIterator; import java.util.ListIterator;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import javax.swing.SwingWorker;
/** /**
* 历史模板缓存 * 历史模板缓存
@ -364,7 +362,7 @@ public class HistoryTemplateListCache implements CallbackEvent {
int size = historyList.size(); int size = historyList.size();
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
JTemplate<?, ?> template = historyList.get(i); JTemplate<?, ?> template = historyList.get(i);
FILE file = templateToStashFile(template); FILE file = template.templateToStashFile();
if (file != null) { if (file != null) {
stashFILEMap.put(i, file); stashFILEMap.put(i, file);
} }
@ -372,21 +370,6 @@ public class HistoryTemplateListCache implements CallbackEvent {
FineLoggerFactory.getLogger().info("Env Change Template Stashed."); FineLoggerFactory.getLogger().info("Env Change Template Stashed.");
} }
private FILE templateToStashFile(JTemplate<?, ?> template) {
FILE file = template.getEditingFILE();
try {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
BaseBook target = template.getTarget();
if (target != null) {
target.export(outputStream);
return new StashedFILE(file, outputStream.toByteArray(), template.suffix());
}
// 如果 target == null 那么这个模板是被模板内存优化功能处理过的,不用处理
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return null;
}
private boolean checkStash() { private boolean checkStash() {
try { try {
@ -469,7 +452,7 @@ public class HistoryTemplateListCache implements CallbackEvent {
FILE file = template.getEditingFILE(); FILE file = template.getEditingFILE();
boolean needReload = context == null || needReloadTemplate(context, template); boolean needReload = context == null || needReloadTemplate(context, template);
if (needReload) { if (needReload) {
FILE stashFile = templateToStashFile(template); FILE stashFile = template.templateToStashFile();
if (stashFile != null) { if (stashFile != null) {
FineLoggerFactory.getLogger().info("{} is being reloaded", file.getName()); FineLoggerFactory.getLogger().info("{} is being reloaded", file.getName());
template.refreshResource(stashFile); template.refreshResource(stashFile);

18
designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

@ -555,6 +555,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
private void fixFunctionNameList(String functionName) { private void fixFunctionNameList(String functionName) {
int signOfContinue = 1; int signOfContinue = 1;
int indexOfFunction = 0; int indexOfFunction = 0;
boolean found = false;
for (int i = 0; i < functionTypeListModel.size(); i++) { for (int i = 0; i < functionTypeListModel.size(); i++) {
int signOfType = 0; int signOfType = 0;
FunctionGroup functionType = (FunctionGroup) functionTypeListModel.getElementAt(i); FunctionGroup functionType = (FunctionGroup) functionTypeListModel.getElementAt(i);
@ -568,6 +569,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
signOfType = 1; signOfType = 1;
signOfContinue = 0; signOfContinue = 0;
indexOfFunction = k; indexOfFunction = k;
found = true;
} }
} }
@ -577,8 +579,12 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
} }
} }
} }
if (found) {
functionNameList.setSelectedIndex(indexOfFunction); functionNameList.setSelectedIndex(indexOfFunction);
functionNameList.ensureIndexIsVisible(indexOfFunction); functionNameList.ensureIndexIsVisible(indexOfFunction);
} else {
functionTypeList.setSelectedIndex(0);
}
} }
private int getBeginPosition() { private int getBeginPosition() {
@ -808,10 +814,11 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
String formulaText = formulaTextArea.getText().trim(); String formulaText = formulaTextArea.getText().trim();
String unSupportFormula = containsUnsupportedSimulationFormulas(formulaText); String unSupportFormula = containsUnsupportedSimulationFormulas(formulaText);
if (unSupportFormula != null) { if (unSupportFormula != null) {
showMessageDialog(Toolkit.i18nText("Fine-Design_Basic_Formula_Unsupported_Formulas") + ":" + unSupportFormula, false); showMessageDialog(Toolkit.i18nText("Fine-Design_Basic_Formula_Unsupported_Formulas") + ":" + unSupportFormula, false, true);
return; return;
} }
boolean calException = false;
String messageTips; String messageTips;
FormulaCheckResult checkResult = FormulaChecker.check(formulaText); FormulaCheckResult checkResult = FormulaChecker.check(formulaText);
if (checkResult.grammarValid()) { if (checkResult.grammarValid()) {
@ -840,6 +847,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
} catch (Exception ce) { } catch (Exception ce) {
//模拟计算如果出现错误,则抛出错误 //模拟计算如果出现错误,则抛出错误
calResult = ce.getMessage(); calResult = ce.getMessage();
calException = true;
FineLoggerFactory.getLogger().error(ce.getMessage(), ce); FineLoggerFactory.getLogger().error(ce.getMessage(), ce);
messageTips = messageTips + Toolkit.i18nText("Fine-Design_Basic_Formula_Cal_Error") + ":" + calResult; messageTips = messageTips + Toolkit.i18nText("Fine-Design_Basic_Formula_Cal_Error") + ":" + calResult;
} }
@ -848,7 +856,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
messageTips = checkResult.getTips(); messageTips = checkResult.getTips();
} }
if (checkResult.isValid()) { if (checkResult.isValid()) {
showMessageDialog(messageTips, checkResult.isValid()); showMessageDialog(messageTips, checkResult.isValid(), calException);
} else { } else {
confirmCheckResult(checkResult, messageTips); confirmCheckResult(checkResult, messageTips);
} }
@ -865,7 +873,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
private boolean confirmCheckResult(FormulaCheckResult checkResult, String messageTips) { private boolean confirmCheckResult(FormulaCheckResult checkResult, String messageTips) {
if (checkResult.isValid()) { if (checkResult.isValid()) {
showMessageDialog(checkResult.getTips(), checkResult.isValid()); showMessageDialog(checkResult.getTips(), checkResult.isValid(), false);
} else { } else {
int columns = checkResult.getFormulaCoordinates().getColumns(); int columns = checkResult.getFormulaCoordinates().getColumns();
String position = StringUtils.EMPTY; String position = StringUtils.EMPTY;
@ -891,8 +899,8 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
return true; return true;
} }
private void showMessageDialog(String message, boolean formulaValid) { private void showMessageDialog(String message, boolean formulaValid, boolean calException) {
if (formulaValid) { if (formulaValid && !calException) {
FineJOptionPane.showMessageDialog( FineJOptionPane.showMessageDialog(
FormulaPane.this, FormulaPane.this,
message); message);

37
designer-base/src/main/java/com/fr/design/gui/icombobox/TableSearchTreeComboBox.java

@ -16,12 +16,13 @@ import com.fr.stable.StringUtils;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JTree; import javax.swing.JTree;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeCellRenderer; import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreeNode; import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
import java.awt.event.MouseEvent;
import java.util.Enumeration; import java.util.Enumeration;
/** /**
@ -40,7 +41,7 @@ public class TableSearchTreeComboBox extends FRTreeComboBox {
public TableSearchTreeComboBox(ChoosePane parent, JTree tree, TreeCellRenderer renderer) { public TableSearchTreeComboBox(ChoosePane parent, JTree tree, TreeCellRenderer renderer) {
super(tree, renderer); super(tree, renderer);
this.parent = parent; this.parent = parent;
setUI(new TableSearchTreeComboBoxUI()); initPopupListener();
} }
protected UIComboBoxEditor createEditor() { protected UIComboBoxEditor createEditor() {
@ -158,12 +159,6 @@ public class TableSearchTreeComboBox extends FRTreeComboBox {
} }
} }
private static final TableNameFilter EMPTY_FILTER = new TableNameFilter() {
public boolean accept(TableProcedure procedure) {
return true;
}
};
/** /**
* 表名模糊搜索实现 * 表名模糊搜索实现
*/ */
@ -184,15 +179,31 @@ public class TableSearchTreeComboBox extends FRTreeComboBox {
} }
} }
/** private static final TableNameFilter EMPTY_FILTER = new TableNameFilter() {
* 重写FRTreeComboBoxUI实现点击下拉时触发模糊搜索 public boolean accept(TableProcedure procedure) {
*/ return true;
private class TableSearchTreeComboBoxUI extends FRTreeComboBoxUI { }
};
private void initPopupListener() {
// 点击下拉时触发模糊搜索
this.addPopupMenuListener(new PopupMenuListener() {
@Override @Override
public void mouseClicked(MouseEvent e) { public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
searchExecute(); searchExecute();
} }
@Override
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
}
@Override
public void popupMenuCanceled(PopupMenuEvent e) {
}
});
} }
/** /**

6
designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java

@ -197,7 +197,9 @@ public class JavaFxNativeFileChooser implements FileChooserProvider {
private File currentDirectory; private File currentDirectory;
public Builder fileSelectionMode(FileSelectionMode fileSelectionMode) { public Builder fileSelectionMode(FileSelectionMode fileSelectionMode) {
if (fileSelectionMode != null) {
this.fileSelectionMode = fileSelectionMode; this.fileSelectionMode = fileSelectionMode;
}
return this; return this;
} }
@ -209,14 +211,18 @@ public class JavaFxNativeFileChooser implements FileChooserProvider {
} }
public Builder filters(FileChooser.ExtensionFilter[] filters) { public Builder filters(FileChooser.ExtensionFilter[] filters) {
if (filters != null) {
this.filters = filters; this.filters = filters;
}
return this; return this;
} }
public Builder filters(ExtensionFilter[] filters) { public Builder filters(ExtensionFilter[] filters) {
if (filters != null) {
for (ExtensionFilter filter : filters) { for (ExtensionFilter filter : filters) {
this.filters = ArrayUtils.add(this.filters, new FileChooser.ExtensionFilter(filter.getDes(), filter.getExtensions())); this.filters = ArrayUtils.add(this.filters, new FileChooser.ExtensionFilter(filter.getDes(), filter.getExtensions()));
} }
}
return this; return this;
} }

18
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -65,6 +65,7 @@ import com.fr.event.EventDispatcher;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.file.FILEChooserPane; import com.fr.file.FILEChooserPane;
import com.fr.file.MemFILE; import com.fr.file.MemFILE;
import com.fr.file.StashedFILE;
import com.fr.form.ui.NoneWidget; import com.fr.form.ui.NoneWidget;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
@ -104,6 +105,7 @@ import javax.swing.JOptionPane;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.undo.UndoManager; import javax.swing.undo.UndoManager;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.io.ByteArrayOutputStream;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FontMetrics; import java.awt.FontMetrics;
import java.util.Set; import java.util.Set;
@ -438,6 +440,22 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
stopListenThemeConfig(); stopListenThemeConfig();
} }
public FILE templateToStashFile() {
FILE file = this.getEditingFILE();
try {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
BaseBook target = this.getTarget();
if (target != null) {
target.export(outputStream);
return new StashedFILE(file, outputStream.toByteArray(), template.suffix());
}
// 如果 target == null 那么这个模板是被模板内存优化功能处理过的,不用处理
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return null;
}
/** /**
* 刷新内部资源 * 刷新内部资源

12
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java

@ -88,13 +88,13 @@ public class CellStyleEditPane extends MultiTabPane<ThemedCellStyle> {
@Override @Override
public ThemedCellStyle updateBean() { public ThemedCellStyle updateBean() {
AbstractBasicStylePane basicStylePane = (AbstractBasicStylePane) paneList.get(tabPane.getSelectedIndex()); Style style = this.cellStyle.getStyle();
Style style = basicStylePane.update(this.cellStyle.getStyle());
CellBorderStyle borderStyle = createDefaultBorderStyleFromStyle(style); CellBorderStyle borderStyle = createDefaultBorderStyleFromStyle(style);
for (BasicPane basicPane : paneList) {
style = ((AbstractBasicStylePane) basicPane).update(style);
if (ThemedFeatureController.isCellStyleSupportInnerBorder() && basicStylePane instanceof BorderPane) { if (ThemedFeatureController.isCellStyleSupportInnerBorder() && basicPane instanceof BorderPane) {
borderStyle = ((BorderPane) basicStylePane).update(); borderStyle = ((BorderPane) basicPane).update();
}
} }
this.cellStyle.setStyle(style); this.cellStyle.setStyle(style);

18
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java

@ -11,10 +11,14 @@ import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.model.SearchResult;
import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
import com.fr.file.filetree.FileNodes;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.rpc.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
/** /**
@ -74,7 +78,12 @@ public class FileSearchManager implements AlphaFineSearchProvider {
return lessModelList; return lessModelList;
} }
AlphaFineHelper.checkCancel(); AlphaFineHelper.checkCancel();
fileNodes = FRContext.getFileNodes().list(ProjectConstants.REPORTLETS_NAME, AlphaFineConstants.FILE_EXTENSIONS, true); fileNodes = WorkContext.getCurrent().get(FileNodes.class, new ExceptionHandler() {
@Override
public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) {
return FRContext.getFileNodes().list(ProjectConstants.REPORTLETS_NAME, AlphaFineConstants.FILE_EXTENSIONS, true);
}
}).list(ProjectConstants.REPORTLETS_NAME, AlphaFineConstants.FILE_EXTENSIONS, true, false);
isContainCpt = true; isContainCpt = true;
isContainFrm = true; isContainFrm = true;
doSearch(this.searchText); doSearch(this.searchText);
@ -128,7 +137,12 @@ public class FileSearchManager implements AlphaFineSearchProvider {
*/ */
private void doFileContentSearch(String searchText) { private void doFileContentSearch(String searchText) {
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainFileContent()) { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainFileContent()) {
FileNode[] fileNodes = FRContext.getFileNodes().filterFiles(searchText, ProjectConstants.REPORTLETS_NAME, new FileExtension[]{FileExtension.CPT, FileExtension.FRM}, true); FileNode[] fileNodes = WorkContext.getCurrent().get(FileNodes.class, new ExceptionHandler() {
@Override
public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) {
return FRContext.getFileNodes().filterFiles(searchText, ProjectConstants.REPORTLETS_NAME, new FileExtension[]{FileExtension.CPT, FileExtension.FRM}, true);
}
}).filterFiles(searchText, ProjectConstants.REPORTLETS_NAME, new FileExtension[]{FileExtension.CPT, FileExtension.FRM}, true, false);
for (FileNode node : fileNodes) { for (FileNode node : fileNodes) {
FileModel model = new FileModel(node.getName(), node.getEnvPath()); FileModel model = new FileModel(node.getName(), node.getEnvPath());
if (!AlphaFineHelper.getFilterResult().contains(model) && !filterModelList.contains(model)) { if (!AlphaFineHelper.getFilterResult().contains(model) && !filterModelList.contains(model)) {

6
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java

@ -11,7 +11,6 @@ import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.design.style.BorderUtils; import com.fr.design.style.BorderUtils;
import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils; import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.elementcase.TemplateElementCase;
@ -20,7 +19,7 @@ import javax.swing.JPanel;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Rectangle; import java.text.Format;
/** /**
* @author zhou * @author zhou
@ -118,7 +117,10 @@ public class CellStylePane extends AbstractCellAttrPane {
AdjustWorkBookDefaultStyleUtils.adjustCellElement(cellElement); AdjustWorkBookDefaultStyleUtils.adjustCellElement(cellElement);
elementCase.addCellElement(cellElement); elementCase.addCellElement(cellElement);
} }
Format format = cellElement.getStyle().getFormat();
Style style = stylePane.updateBean(); Style style = stylePane.updateBean();
// 格式不能通过样式面板中的配置项修改,因此需要保留
style = style.deriveFormat(format);
cellElement.setStyle(style); cellElement.setStyle(style);
} }
}); });

17
designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java

@ -60,7 +60,7 @@ public class PageToolBarPane extends AbstractEditToolBarPane {
private UICheckBox isPageFixedRowBox; private UICheckBox isPageFixedRowBox;
private UITextField pageFixedRowCountTextField; private UITextField pageFixedRowCountTextField;
private static final Color TIPS_FONT_COLOR = new Color(0x8f8f92); private static final Color TIPS_FONT_COLOR = new Color(0x8f8f92);
private static final Pattern ROW_COUNT = Pattern.compile("^[1-9][\\d]{0,2}$"); private static final Pattern ROW_COUNT = Pattern.compile("^[1-9][\\d]*$|^0");
//固定行数分页,每页最多500行,最少1行数据 //固定行数分页,每页最多500行,最少1行数据
private static final int MAX_ROW_COUNT = 500; private static final int MAX_ROW_COUNT = 500;
@ -275,18 +275,21 @@ public class PageToolBarPane extends AbstractEditToolBarPane {
@Override @Override
public void keyReleased(KeyEvent e) { public void keyReleased(KeyEvent e) {
String rowCount = pageFixedRowCountTextField.getText(); String rowCount = pageFixedRowCountTextField.getText();
if (!isRowCountValid(rowCount)) { pageFixedRowCountTextField.setText(convert2ValidRowCount(rowCount));
pageFixedRowCountTextField.setText(StringUtils.EMPTY);
}
} }
}; };
private boolean isRowCountValid(String rowCount) { private String convert2ValidRowCount(String rowCount) {
Matcher matcher = ROW_COUNT.matcher(rowCount); Matcher matcher = ROW_COUNT.matcher(rowCount);
if (matcher.find()) { if (matcher.find()) {
int count = Integer.parseInt(matcher.group()); int count = Integer.parseInt(matcher.group());
return count >= MIN_ROW_COUNT && count <= MAX_ROW_COUNT; if (count > MAX_ROW_COUNT) {
count = MAX_ROW_COUNT;
} else if (count < MIN_ROW_COUNT) {
count = MIN_ROW_COUNT;
}
return String.valueOf(count);
} }
return false; return StringUtils.EMPTY;
} }
} }

17
designer-realize/src/main/java/com/fr/design/webattr/PageWebSettingPane.java

@ -41,7 +41,7 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
private UICheckBox isPageFixedRowBox; private UICheckBox isPageFixedRowBox;
private UITextField pageFixedRowCountTextField; private UITextField pageFixedRowCountTextField;
private static final Color TIPS_FONT_COLOR = new Color(0x8f8f92); private static final Color TIPS_FONT_COLOR = new Color(0x8f8f92);
private static final Pattern ROW_COUNT = Pattern.compile("^[1-9][\\d]{0,2}$"); private static final Pattern ROW_COUNT = Pattern.compile("^[1-9][\\d]*$|^0");
private static final String DEFAULT_ROW_COUNT = "30"; private static final String DEFAULT_ROW_COUNT = "30";
//固定行数分页,每页最多500行,最少1行数据 //固定行数分页,每页最多500行,最少1行数据
@ -82,9 +82,7 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
@Override @Override
public void keyReleased(KeyEvent e) { public void keyReleased(KeyEvent e) {
String rowCount = pageFixedRowCountTextField.getText(); String rowCount = pageFixedRowCountTextField.getText();
if (!isRowCountValid(rowCount)) { pageFixedRowCountTextField.setText(convert2ValidRowCount(rowCount));
pageFixedRowCountTextField.setText(StringUtils.EMPTY);
}
} }
}); });
pageFixedRowCountTextField.addInputMethodListener(new InputMethodListener() { pageFixedRowCountTextField.addInputMethodListener(new InputMethodListener() {
@ -207,12 +205,17 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
reportWebAttr.setWebPage(webContent); reportWebAttr.setWebPage(webContent);
} }
private boolean isRowCountValid(String rowCount) { private String convert2ValidRowCount(String rowCount) {
Matcher matcher = ROW_COUNT.matcher(rowCount); Matcher matcher = ROW_COUNT.matcher(rowCount);
if (matcher.find()) { if (matcher.find()) {
int count = Integer.parseInt(matcher.group()); int count = Integer.parseInt(matcher.group());
return count >= MIN_ROW_COUNT && count <= MAX_ROW_COUNT; if (count > MAX_ROW_COUNT) {
count = MAX_ROW_COUNT;
} else if (count < MIN_ROW_COUNT) {
count = MIN_ROW_COUNT;
}
return String.valueOf(count);
} }
return false; return StringUtils.EMPTY;
} }
} }

7
designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

@ -291,6 +291,10 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
@Override @Override
public void checkValid() throws Exception { public void checkValid() throws Exception {
KeyColumnTableModel model = (KeyColumnTableModel) keyColumnValuesTable.getModel(); KeyColumnTableModel model = (KeyColumnTableModel) keyColumnValuesTable.getModel();
checkModelValid(model);
}
private void checkModelValid(KeyColumnTableModel model) throws Exception {
int cnt = model.getRowCount(); int cnt = model.getRowCount();
int groupLength = -1; int groupLength = -1;
for (int i = 0; i < cnt; i++) { for (int i = 0; i < cnt; i++) {
@ -374,7 +378,8 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
*/ */
@Override @Override
public void checkValid() throws Exception { public void checkValid() throws Exception {
SmartInsertDBManipulationPane.this.checkValid(); KeyColumnTableModel model = (KeyColumnTableModel) table.getModel();
SmartInsertDBManipulationPane.this.checkModelValid(model);
} }
private SelectionListener listener = new SelectionListener() { private SelectionListener listener = new SelectionListener() {

Loading…
Cancel
Save