diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java index 6eb802619..5d9d4146d 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java @@ -26,6 +26,7 @@ import com.fr.design.gui.itableeditorpane.UITableEditorPane; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -612,7 +613,7 @@ public class FileTableDataPane extends AbstractTableDataPane { private void setTextField(FileTableData ob) { if (ob.getFilePath() != null) { - if (ob.getFilePath().indexOf("http") != -1) { + if (ob.getFilePath().contains("http")) { urlRadioSelectAction(); urlText.setText(ob.getFilePath()); } else { @@ -625,6 +626,15 @@ public class FileTableDataPane extends AbstractTableDataPane { @Override public FileTableData updateBean() { String filePath = getFilePathFromUrlOrLocal(); + // 安全要求禁止 file 协议访问本地磁盘 + if (FileTableData.isInvalidFilePath(filePath)) { + FineJOptionPane.showMessageDialog(this, + Toolkit.i18nText("Fine-Design_File_Table_Data_Path_Invalid"), + Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip"), + JOptionPane.ERROR_MESSAGE); + // 阻止对话框关闭 + throw new RuntimeException(Toolkit.i18nText("Fine-Design_File_Table_Data_Path_Invalid")); + } if (StringUtils.isNotBlank(filePath)) { this.params = getEditorPaneParameter().length == 0 ? null : getEditorPaneParameter(); if (fileTypeComboBox.getSelectedIndex() == EXCEL) { @@ -786,6 +796,14 @@ public class FileTableDataPane extends AbstractTableDataPane { if (this.fileTableData == null) { return; } + String filePath = getFilePathFromUrlOrLocal(); + if (FileTableData.isInvalidFilePath(filePath)) { + FineJOptionPane.showMessageDialog(this, + Toolkit.i18nText("Fine-Design_File_Table_Data_Path_Invalid"), + Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip"), + JOptionPane.ERROR_MESSAGE); + return; + } PreviewTablePane.previewTableData(this.updateBean()); } @@ -802,7 +820,7 @@ public class FileTableDataPane extends AbstractTableDataPane { xmlNodeTree = new XMLNodeTree(); this.add(new JScrollPane(xmlNodeTree)); - keyPointLaber = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Key_Point") + ":"); + keyPointLaber = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Key_Point") + ":"); refreshAction = new RefreshParameterAction(); ToolBarDef toolbarDef = new ToolBarDef(); toolbarDef.addShortCut(refreshAction); @@ -820,7 +838,7 @@ public class FileTableDataPane extends AbstractTableDataPane { private class RefreshParameterAction extends UpdateAction { public RefreshParameterAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh")); + this.setName(Toolkit.i18nText("Fine-Design_Basic_Refresh")); this.setMnemonic('r'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png")); } diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/events/DesignerEditor.java b/designer-form/src/main/java/com/fr/design/designer/beans/events/DesignerEditor.java index a1c9f1ff9..f53f66d31 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/events/DesignerEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/events/DesignerEditor.java @@ -86,9 +86,15 @@ public class DesignerEditor implements PropertyChangeListe int horizonMargin = marginLeft + marginRight; int verticalMargin = marginTop + marginBottom; - comp.setSize(new Dimension(size.width - 2 - horizonMargin, size.height - 2 - verticalMargin)); + int x = 1 + marginLeft; + int y = 1 + marginTop; + int width = size.width - 2 - horizonMargin; + int height = size.height - 2 - verticalMargin; + + comp.setSize(new Dimension(width, height)); LayoutUtils.layoutContainer(comp); - Graphics clipg = g.create(1 + marginLeft, 1 + marginTop, size.width, size.height); + comp.setBounds(comp.getX() + x, comp.getY() + y, width, height); + Graphics clipg = g.create(x, y, width, height); this.comp.paint(clipg); } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java index abb833f97..dd37385aa 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java @@ -146,6 +146,9 @@ public class XChartEditor extends XBorderStyleWidgetCreator { if (isEditing) { g.setColor(OUTER_BORDER_COLOR); GraphHelper.draw(g, new Rectangle(bounds.x - BORDER_WIDTH, bounds.y - BORDER_WIDTH, bounds.width + BORDER_WIDTH + 1, bounds.height + BORDER_WIDTH + 1), Constants.LINE_LARGE); + + g.setColor(INNER_BORDER_COLOR); + GraphHelper.draw(g, new Rectangle(bounds.x, bounds.y, bounds.width, bounds.height), Constants.LINE_MEDIUM); } else if (!isHovering) { super.paintBorder(g, bounds); } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index a7860faec..2f5f0e628 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -830,4 +830,10 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo } } + public void hidePopup() { + if (popup != null) { + popup.setVisible(false); + } + } + } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 6cc1399b3..b46fffdfb 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -624,6 +624,8 @@ public class EditingMouseListener extends MouseInputAdapter { creator = processTopLayoutMouseClick(creator); if (creator != null) { + // tab块处于未编辑状态 + boolean uneditedTab = designer.getCursor().getType() != Cursor.HAND_CURSOR && creator.acceptType(XWCardMainBorderLayout.class) && !((XWCardMainBorderLayout) creator).isEditable(); // 点击不在tab块的button中 boolean clickedNonCardButton = !creator.acceptType(XCardAddButton.class, XCardSwitchButton.class); if (clickedNonCardButton && e.getClickCount() == 1 && designer.getCursor().getType() != Cursor.HAND_CURSOR) { @@ -641,7 +643,7 @@ public class EditingMouseListener extends MouseInputAdapter { } }); - } else if (clickedNonCardButton && responseTabLayout(oldCreator, e)) { + } else if (clickedNonCardButton && uneditedTab && responseTabLayout(oldCreator, e)) { // do nothing } else { creator.respondClick(this, e); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 08969c91a..bc32c5fd9 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -47,8 +47,6 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.form.FormECCompositeProvider; import com.fr.design.mainframe.form.FormECDesignerProvider; -import com.fr.design.mainframe.share.collect.ComponentCollector; -import com.fr.design.mainframe.share.util.ShareComponentUtils; import com.fr.design.mainframe.template.info.JFormProcessInfo; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.design.mainframe.toolbar.ToolBarMenuDock; @@ -79,10 +77,8 @@ import com.fr.form.ui.Widget; import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WLayout; import com.fr.general.ComparatorUtils; -import com.fr.json.JSONArray; import com.fr.log.FineLoggerFactory; import com.fr.page.PaperSettingProvider; -import com.fr.plugin.observer.PluginEventListener; import com.fr.report.cell.Elem; import com.fr.report.cell.cellattr.CellImage; import com.fr.report.worksheet.FormElementCase; @@ -93,6 +89,8 @@ import com.fr.stable.StringUtils; import com.fr.stable.bridge.StableFactory; import com.fr.web.controller.ViewRequestConstants; +import java.awt.event.ContainerAdapter; +import java.awt.event.ContainerEvent; import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JComponent; @@ -135,18 +133,36 @@ public class JForm extends JTemplate implements BaseJForm implements BaseJForm