Browse Source

Merge branch 'release/11.0' of ssh://code.fineres.com:7999/~fanglei/design into release/11.0

* 'release/11.0' of ssh://code.fineres.com:7999/~fanglei/design:
  代码修改
  REPORT-65976 复用组件-绝对布局拖入绝对画布块的组件,绝对画布块里的子组件没有随着绝对画布块的尺寸进行缩放,比绝对画布块小;拖入到占位块里是正常充满的
  REPORT-65975 填报-控件-控件事件中添加提交事件,点击表名后会退出当前选择界面
  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模板重新加载
  Revert "REPORT-64445 新老自适应配置面板修改"
  REPORT-64445 新老自适应配置面板修改
  REPORT-64609 磁盘空间满时 保存模板造成模板丢失
bugfix/11.0
方磊 3 years ago
parent
commit
3a308e2d1d
  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. 22
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java
  5. 43
      designer-base/src/main/java/com/fr/design/gui/icombobox/TableSearchTreeComboBox.java
  6. 14
      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. 1
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java
  10. 1
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java
  11. 19
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/PreviewWidgetBlock.java
  12. 18
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java
  13. 6
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java
  14. 17
      designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java
  15. 17
      designer-realize/src/main/java/com/fr/design/webattr/PageWebSettingPane.java
  16. 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.TableDataConfig;
import com.fr.file.TableDataOperator;
import com.fr.file.TableDataOperatorImpl;
import com.fr.general.ComparatorUtils;
import com.fr.general.NameObject;
import com.fr.log.FineLoggerFactory;
import com.fr.rpc.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
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()));
}
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()) {
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
public void update(TableDataSource tds) {
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.file.ConnectionConfig;
import com.fr.file.ConnectionOperator;
import com.fr.file.ConnectionOperatorImpl;
import com.fr.general.NameObject;
import com.fr.log.FineLoggerFactory;
import com.fr.rpc.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
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()));
}
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()) {
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) {
final ConnectionConfig connectionConfig = ConnectionConfig.getInstance();
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.file.FILE;
import com.fr.file.FileNodeFILE;
import com.fr.file.StashedFILE;
import com.fr.general.ComparatorUtils;
import com.fr.invoke.ClassHelper;
import com.fr.log.FineLoggerFactory;
@ -25,7 +24,7 @@ import com.fr.stable.CoreConstants;
import com.fr.stable.StringUtils;
import com.fr.third.org.apache.commons.io.FilenameUtils;
import java.io.ByteArrayOutputStream;
import javax.swing.SwingWorker;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@ -33,7 +32,6 @@ import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Set;
import javax.swing.SwingWorker;
/**
* 历史模板缓存
@ -364,7 +362,7 @@ public class HistoryTemplateListCache implements CallbackEvent {
int size = historyList.size();
for (int i = 0; i < size; i++) {
JTemplate<?, ?> template = historyList.get(i);
FILE file = templateToStashFile(template);
FILE file = template.templateToStashFile();
if (file != null) {
stashFILEMap.put(i, file);
}
@ -372,21 +370,6 @@ public class HistoryTemplateListCache implements CallbackEvent {
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() {
try {
@ -469,7 +452,7 @@ public class HistoryTemplateListCache implements CallbackEvent {
FILE file = template.getEditingFILE();
boolean needReload = context == null || needReloadTemplate(context, template);
if (needReload) {
FILE stashFile = templateToStashFile(template);
FILE stashFile = template.templateToStashFile();
if (stashFile != null) {
FineLoggerFactory.getLogger().info("{} is being reloaded", file.getName());
template.refreshResource(stashFile);

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

43
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.JTree;
import javax.swing.SwingWorker;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;
import java.awt.event.MouseEvent;
import java.util.Enumeration;
/**
@ -40,7 +41,7 @@ public class TableSearchTreeComboBox extends FRTreeComboBox {
public TableSearchTreeComboBox(ChoosePane parent, JTree tree, TreeCellRenderer renderer) {
super(tree, renderer);
this.parent = parent;
setUI(new TableSearchTreeComboBoxUI());
initPopupListener();
}
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 {
}
}
/**
* 重写FRTreeComboBoxUI实现点击下拉时触发模糊搜索
*/
private class TableSearchTreeComboBoxUI extends FRTreeComboBoxUI {
@Override
public void mouseClicked(MouseEvent e) {
searchExecute();
private static final TableNameFilter EMPTY_FILTER = new TableNameFilter() {
public boolean accept(TableProcedure procedure) {
return true;
}
};
private void initPopupListener() {
// 点击下拉时触发模糊搜索
this.addPopupMenuListener(new PopupMenuListener() {
@Override
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
searchExecute();
}
@Override
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
}
@Override
public void popupMenuCanceled(PopupMenuEvent e) {
}
});
}
/**

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

@ -197,7 +197,9 @@ public class JavaFxNativeFileChooser implements FileChooserProvider {
private File currentDirectory;
public Builder fileSelectionMode(FileSelectionMode fileSelectionMode) {
this.fileSelectionMode = fileSelectionMode;
if (fileSelectionMode != null) {
this.fileSelectionMode = fileSelectionMode;
}
return this;
}
@ -209,13 +211,17 @@ public class JavaFxNativeFileChooser implements FileChooserProvider {
}
public Builder filters(FileChooser.ExtensionFilter[] filters) {
this.filters = filters;
if (filters != null) {
this.filters = filters;
}
return this;
}
public Builder filters(ExtensionFilter[] filters) {
for (ExtensionFilter filter : filters) {
this.filters = ArrayUtils.add(this.filters, new FileChooser.ExtensionFilter(filter.getDes(), filter.getExtensions()));
if (filters != null) {
for (ExtensionFilter filter : filters) {
this.filters = ArrayUtils.add(this.filters, new FileChooser.ExtensionFilter(filter.getDes(), filter.getExtensions()));
}
}
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.FILEChooserPane;
import com.fr.file.MemFILE;
import com.fr.file.StashedFILE;
import com.fr.form.ui.NoneWidget;
import com.fr.form.ui.Widget;
import com.fr.general.ComparatorUtils;
@ -104,6 +105,7 @@ import javax.swing.JOptionPane;
import javax.swing.SwingConstants;
import javax.swing.undo.UndoManager;
import java.awt.BorderLayout;
import java.io.ByteArrayOutputStream;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.util.Set;
@ -438,6 +440,22 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
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
public ThemedCellStyle updateBean() {
AbstractBasicStylePane basicStylePane = (AbstractBasicStylePane) paneList.get(tabPane.getSelectedIndex());
Style style = basicStylePane.update(this.cellStyle.getStyle());
Style style = this.cellStyle.getStyle();
CellBorderStyle borderStyle = createDefaultBorderStyleFromStyle(style);
if (ThemedFeatureController.isCellStyleSupportInnerBorder() && basicStylePane instanceof BorderPane) {
borderStyle = ((BorderPane) basicStylePane).update();
for (BasicPane basicPane : paneList) {
style = ((AbstractBasicStylePane) basicPane).update(style);
if (ThemedFeatureController.isCellStyleSupportInnerBorder() && basicPane instanceof BorderPane) {
borderStyle = ((BorderPane) basicPane).update();
}
}
this.cellStyle.setStyle(style);

1
designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java

@ -252,6 +252,7 @@ public class LocalWidgetBlock extends PreviewWidgetBlock<DefaultSharableWidget>
ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Share_Drag_Error_Info"));
return null;
}
compatibleProcessAbsoluteLayoutResolution(creatorSource);
creatorSource.setWidgetID(UUID.randomUUID().toString());
((AbstractBorderStyleWidget) creatorSource).addWidgetAttrMark(new SharableAttrMark(true));
//tab布局WCardMainBorderLayout通过反射出来的大小是960*480

1
designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java

@ -189,6 +189,7 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock {
ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Share_Drag_Error_Info"));
return;
}
compatibleProcessAbsoluteLayoutResolution(creatorSource);
creatorSource.setWidgetID(UUID.randomUUID().toString());
((AbstractBorderStyleWidget) creatorSource).addWidgetAttrMark(new SharableAttrMark(true));
SharableWidgetProvider bindInfo = ShareUtils.getElCaseBindInfoById(shareId);

19
designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/PreviewWidgetBlock.java

@ -12,7 +12,12 @@ import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.share.ui.online.CarouselStateManger;
import com.fr.design.mainframe.share.ui.online.embed.AnimatePopupDialog;
import com.fr.design.mainframe.share.ui.online.embed.FirstDragAnimateStateManager;
import com.fr.form.main.Form;
import com.fr.form.main.WidgetGather;
import com.fr.form.share.constants.ShareComponentConstants;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.general.FRScreen;
import com.fr.module.ModuleContext;
import org.jetbrains.annotations.NotNull;
import javax.swing.ImageIcon;
@ -285,4 +290,18 @@ public abstract class PreviewWidgetBlock<T> extends JPanel implements MouseListe
}
protected void compatibleProcessAbsoluteLayoutResolution(Widget widget) {
Form.traversalWidget(widget, new WidgetGather() {
@Override
public void dealWith(Widget widget) {
((WAbsoluteLayout) widget).setDesigningResolution(FRScreen.p1440.getDimension());
}
@Override
public boolean dealWithAllCards() {
return true;
}
}, WAbsoluteLayout.class);
}
}

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.search.manager.fun.AlphaFineSearchProvider;
import com.fr.file.filetree.FileNode;
import com.fr.file.filetree.FileNodes;
import com.fr.general.ComparatorUtils;
import com.fr.json.JSONObject;
import com.fr.rpc.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
/**
@ -74,7 +78,12 @@ public class FileSearchManager implements AlphaFineSearchProvider {
return lessModelList;
}
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;
isContainFrm = true;
doSearch(this.searchText);
@ -128,7 +137,12 @@ public class FileSearchManager implements AlphaFineSearchProvider {
*/
private void doFileContentSearch(String searchText) {
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) {
FileModel model = new FileModel(node.getName(), node.getEnvPath());
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.utils.gui.AdjustWorkBookDefaultStyleUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
@ -20,7 +19,7 @@ import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Rectangle;
import java.text.Format;
/**
* @author zhou
@ -118,7 +117,10 @@ public class CellStylePane extends AbstractCellAttrPane {
AdjustWorkBookDefaultStyleUtils.adjustCellElement(cellElement);
elementCase.addCellElement(cellElement);
}
Format format = cellElement.getStyle().getFormat();
Style style = stylePane.updateBean();
// 格式不能通过样式面板中的配置项修改,因此需要保留
style = style.deriveFormat(format);
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 UITextField pageFixedRowCountTextField;
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行数据
private static final int MAX_ROW_COUNT = 500;
@ -275,18 +275,21 @@ public class PageToolBarPane extends AbstractEditToolBarPane {
@Override
public void keyReleased(KeyEvent e) {
String rowCount = pageFixedRowCountTextField.getText();
if (!isRowCountValid(rowCount)) {
pageFixedRowCountTextField.setText(StringUtils.EMPTY);
}
pageFixedRowCountTextField.setText(convert2ValidRowCount(rowCount));
}
};
private boolean isRowCountValid(String rowCount) {
private String convert2ValidRowCount(String rowCount) {
Matcher matcher = ROW_COUNT.matcher(rowCount);
if (matcher.find()) {
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 UITextField pageFixedRowCountTextField;
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";
//固定行数分页,每页最多500行,最少1行数据
@ -82,9 +82,7 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
@Override
public void keyReleased(KeyEvent e) {
String rowCount = pageFixedRowCountTextField.getText();
if (!isRowCountValid(rowCount)) {
pageFixedRowCountTextField.setText(StringUtils.EMPTY);
}
pageFixedRowCountTextField.setText(convert2ValidRowCount(rowCount));
}
});
pageFixedRowCountTextField.addInputMethodListener(new InputMethodListener() {
@ -207,12 +205,17 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
reportWebAttr.setWebPage(webContent);
}
private boolean isRowCountValid(String rowCount) {
private String convert2ValidRowCount(String rowCount) {
Matcher matcher = ROW_COUNT.matcher(rowCount);
if (matcher.find()) {
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
public void checkValid() throws Exception {
KeyColumnTableModel model = (KeyColumnTableModel) keyColumnValuesTable.getModel();
checkModelValid(model);
}
private void checkModelValid(KeyColumnTableModel model) throws Exception {
int cnt = model.getRowCount();
int groupLength = -1;
for (int i = 0; i < cnt; i++) {
@ -374,7 +378,8 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
*/
@Override
public void checkValid() throws Exception {
SmartInsertDBManipulationPane.this.checkValid();
KeyColumnTableModel model = (KeyColumnTableModel) table.getModel();
SmartInsertDBManipulationPane.this.checkModelValid(model);
}
private SelectionListener listener = new SelectionListener() {

Loading…
Cancel
Save