diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/MultiResultTableDataWrapper.java b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/MultiResultTableDataWrapper.java index 6146e30d3a..09d7882438 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/MultiResultTableDataWrapper.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/MultiResultTableDataWrapper.java @@ -4,18 +4,18 @@ import com.fr.base.TableData; import com.fr.data.MultiResultTableData; import com.fr.data.impl.NameDataModel; import com.fr.data.impl.storeproc.StoreProcedure; -import com.fr.data.operator.DataOperator; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.preview.ConnectionInfoBeanHelper; import com.fr.design.data.datapane.preview.PreviewTablePane; +import com.fr.design.dialog.CollapsibleDetailDialog; import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.iprogressbar.AutoProgressBar; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; -import com.fr.workspace.server.entity.connection.ConnectionBean; import com.fr.workspace.server.repository.connection.ConnectionRepository; import javax.swing.Icon; @@ -230,7 +230,12 @@ public final class MultiResultTableDataWrapper implements TableDataWrapper { loadingBar.close(); if (!(e instanceof CancellationException)) { FineLoggerFactory.getLogger().error(e.getMessage(), e); - FineJOptionPane.showMessageDialog(parent, e.getMessage()); + if (tableData instanceof StoreProcedure) { + CollapsibleDetailDialog dialog = new CollapsibleDetailDialog(DesignerContext.getDesignerFrame(), new UILabel(Toolkit.i18nText("Fine-Design_Stored_Procedure_Query_Failed")), e.getMessage()); + dialog.setVisible(true); + } else { + FineJOptionPane.showMessageDialog(parent, e.getMessage()); + } } } } diff --git a/designer-base/src/main/java/com/fr/design/dialog/CollapsibleDetailDialog.java b/designer-base/src/main/java/com/fr/design/dialog/CollapsibleDetailDialog.java new file mode 100644 index 0000000000..cc73abc36d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/dialog/CollapsibleDetailDialog.java @@ -0,0 +1,145 @@ +package com.fr.design.dialog; + +import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineUIScale; +import com.fine.theme.utils.FineUIStyle; +import com.formdev.flatlaf.ui.FlatUIUtils; +import com.formdev.flatlaf.util.ScaledEmptyBorder; +import com.fr.design.constants.LayoutConstants; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.utils.gui.GUICoreUtils; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.JPanel; +import javax.swing.JDialog; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; + + +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.row; +import static com.fine.swing.ui.layout.Layouts.column; +import static com.fine.swing.ui.layout.Layouts.flex; +import static com.fine.swing.ui.layout.Layouts.fix; + +/** + * 折叠弹窗 + * + * @author Richard + * @since 11.0 + * Created on 2024/10/22 + */ +public class CollapsibleDetailDialog extends JDialog implements ActionListener { + + public JPanel upInTopPanel; + private JPanel downInTopPanel; + private JPanel topPanel; + public JPanel hiddenPanel; + private JPanel bottomPanel; + private UILabel directUILabel; + private UILabel detailLabel; + // 内容标题 + private final UILabel messageLabel; + // 详情 + private final String detailText; + private final Dimension collapseDimension = FineUIScale.createScaleDimension(450, 185); + private final Dimension unfoldDimension = FineUIScale.createScaleDimension(450, 280); + + public CollapsibleDetailDialog(Frame parent, UILabel label, String detailText) { + super(parent, true); + this.detailText = detailText; + this.messageLabel = label; + initComponent(); + } + + private void initComponent() { + initTopPanel(); + initHiddenPanel(); + initBottomPanel(); + addListeners(); + this.setResizable(false); + this.add(topPanel, BorderLayout.NORTH); + this.add(hiddenPanel, BorderLayout.CENTER); + this.add(bottomPanel, BorderLayout.SOUTH); + this.setSize(this.collapseDimension); + GUICoreUtils.centerWindow(this); + this.setAlwaysOnTop(true); + } + + private void initTopPanel() { + initUpInTopPanel(); + // 查看详情按钮 + directUILabel = new UILabel(); + directUILabel.setIcon(new LazyIcon("plus")); + detailLabel = new UILabel(); + detailLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine_Designer_Look_Detail")); + downInTopPanel = row(fix(30), row(cell(directUILabel), cell(detailLabel), flex())).getComponent(); + topPanel = column(cell(upInTopPanel), cell(downInTopPanel)).getComponent(); + } + + private void initUpInTopPanel() { + upInTopPanel = row(LayoutConstants.HORIZONTAL_GAP, + column(cell(new UILabel(new LazyIcon("error", 20))), flex()), + column(cell(messageLabel))).getComponent(); + upInTopPanel.setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); + } + + private void initHiddenPanel() { + hiddenPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + JScrollPane scrollPane = new JScrollPane(); + JTextArea textArea = new JTextArea(detailText); + scrollPane.setViewportView(textArea); + scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); + scrollPane.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE)); + scrollPane.getViewport().setOpaque(false); + textArea.setOpaque(false); + textArea.setEditable(false); + hiddenPanel = row(fix(30), cell(scrollPane).weight(1)).getComponent(); + hiddenPanel.setVisible(false); + hiddenPanel.setBorder(new ScaledEmptyBorder(0, 0, 0, 10)); + } + + private void initBottomPanel() { + //底部的按钮面板 + UIButton okButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")); + FineUIStyle.setStyle(okButton, FineUIStyle.STYLE_PRIMARY); + okButton.addActionListener(this); + bottomPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + bottomPanel.setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); + bottomPanel.add(okButton, BorderLayout.EAST); + } + + private void addListeners() { + downInTopPanel.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + toggleHiddenPanel(); + } + }); + } + + private void toggleHiddenPanel() { + if (hiddenPanel.isVisible()) { + hiddenPanel.setVisible(false); + setSize(collapseDimension); + detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail")); + directUILabel.setIcon(new LazyIcon("plus")); + } else { + setSize(unfoldDimension); + hiddenPanel.setVisible(true); + detailLabel.setText(Toolkit.i18nText("Fine_Designer_Hide_Detail")); + directUILabel.setIcon(new LazyIcon("minus")); + } + } + + @Override + public void actionPerformed(ActionEvent e) { + this.dispose(); + } +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/dialog/UIDetailErrorLinkDialog.java b/designer-base/src/main/java/com/fr/design/dialog/UIDetailErrorLinkDialog.java index 67b7ffeda8..c736c2e81f 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/UIDetailErrorLinkDialog.java +++ b/designer-base/src/main/java/com/fr/design/dialog/UIDetailErrorLinkDialog.java @@ -76,6 +76,7 @@ public class UIDetailErrorLinkDialog extends UIDialog { // 顶部 图标和提示 UILabel errorIcon = new UILabel(new LazyIcon("error", 20)); UILabel errorInfo= new UILabel(builder.reason); + errorInfo.setToolTipText(builder.reason); FineUIStyle.setStyle(errorInfo, FineUIStyle.LABEL_TIP_WINDOW_TITLE); // 中部 详细内容 diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java index 18ac4eaeeb..2e52922777 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java @@ -44,6 +44,7 @@ public class UIModeControlContainer extends JLayeredPane { private static final int NUM5 = 5; private JComponent upPane; private JComponent downPane; + private JComponent sheetNameTabPane; private JPanel horizontToolPane; private CoverPane coverPane; @@ -115,6 +116,10 @@ public class UIModeControlContainer extends JLayeredPane { this.downPane = downPane; } + public void setSheetNameTabPane(JComponent sheetNameTabPane) { + this.sheetNameTabPane = sheetNameTabPane; + } + protected void onResize(int distance) { } @@ -215,7 +220,8 @@ public class UIModeControlContainer extends JLayeredPane { } if (DesignerMode.isAuthorityEditing() && isSheeetCovered) { - sheetInvisibleCoverPane.setBounds(0, toolPaneY + toolPaneHeight + UIConstants.SIZE, getWidth(), getHeight() - toolPaneY - toolPaneHeight - sheetCorverGap); + sheetInvisibleCoverPane.setBounds(0, toolPaneY + toolPaneHeight + UIConstants.SIZE, + getWidth(), downPane.getHeight() - sheetNameTabPane.getHeight()); UIModeControlContainer.this.add(sheetInvisibleCoverPane); UIModeControlContainer.this.setLayer(sheetInvisibleCoverPane, 2); sheetInvisibleCoverPane.setVisible(true); diff --git a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java index 401065a010..34d20e161d 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java @@ -1,6 +1,7 @@ package com.fr.design.javascript; import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIUtils; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.DesignerEnvManager; @@ -187,6 +188,7 @@ public class JSContentPane extends BasicPane { JPanel jsParaPane = new JPanel(new BorderLayout()); funNameLabel.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal")); UIScrollPane scrollPane = new UIScrollPane(funNameLabel); + scrollPane.setPreferredSize(new Dimension(super.getPreferredSize().width, FineUIScale.scale(80))); scrollPane.setOpaque(true); jsParaPane.add(row(4, cell(scrollPane).weight(1), diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index 1ebc487fc4..d6f46b9332 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -457,9 +457,9 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen private class ChartChangeButton extends UIToggleButton { - private final double DEL_WIDTH = scale(10); + private final double DEL_WIDTH = scale(13); private final double DOWN_HEIGHT = scale(1); - private final Icon closeIcon = new LazyIcon("closeTag", 8); + private final Icon closeIcon = new LazyIcon("closeTag", 12); private boolean isMoveOn = false; private String buttonName = ""; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java index dd21ff1ed0..b3f628cdb6 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java @@ -123,6 +123,7 @@ public class ReportComponentComposite extends JPanel implements RemoveListener { centerCardPane.populate(workbook.getTemplateReport(newIndex)); if (parentContainer != null) { parentContainer.setDownPane(ReportComponentComposite.this); + parentContainer.setSheetNameTabPane(sheetNameTab); } if (templateStateList.size() > newIndex) { diff --git a/designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java b/designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java index b2d0e6dd08..6b8929bf22 100644 --- a/designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java +++ b/designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java @@ -82,9 +82,9 @@ public class SortColumnRowPane extends JPanel implements UIObserver { void initTextField() { colJTextField = new JTextField(); - colJTextField.setEditable(false); + colJTextField.setEnabled(false); rowJTextField = new JTextField(); - rowJTextField.setEditable(false); + rowJTextField.setEnabled(false); } void initSelectButton() { diff --git a/designer-realize/src/main/java/com/fr/design/sort/header/HeaderSortRulePane.java b/designer-realize/src/main/java/com/fr/design/sort/header/HeaderSortRulePane.java index 6df0272410..1befa18bf3 100644 --- a/designer-realize/src/main/java/com/fr/design/sort/header/HeaderSortRulePane.java +++ b/designer-realize/src/main/java/com/fr/design/sort/header/HeaderSortRulePane.java @@ -94,6 +94,7 @@ public class HeaderSortRulePane extends JPanel { private ColorControlWindow colorSelector; IconButton(SortRule sortRule) { + this.setLayout(new BorderLayout()); this.sortRule = sortRule; initComponents(); }