From b37b7415c74c6e527c2f3ce0dc92b2f675f6673f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Wed, 18 Sep 2024 13:56:50 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-134842=20&=20REPORT-134740=20fix:?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E8=BF=87=E7=A8=8B=E5=91=BD=E5=90=8D=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E9=97=AE=E9=A2=98=20&=20=E6=97=A5=E6=9C=9F=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A1=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/TableDataTreePane.java | 10 ++-- .../com/fr/design/gui/date/UIDatePicker.java | 51 ++++++++++--------- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java index 7c542e4c5d..0552f836e8 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java @@ -81,7 +81,6 @@ import javax.swing.JScrollBar; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; import javax.swing.ToolTipManager; -import javax.swing.border.EmptyBorder; import javax.swing.tree.TreePath; import java.awt.BorderLayout; import java.awt.Color; @@ -509,11 +508,10 @@ public class TableDataTreePane extends BasicTableDataTreePane { } else if (!ComparatorUtils.equals(oldName, tempName) && isDsNameRepeaded(tempName)) { nPanel.setShowText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Table_Data_Duplicate_Name_Tips", tempName)); dg.setButtonEnabled(false); - } else if (oldName.length() >= PROCEDURE_NAME_INDEX && tableDataPane.updateBean() instanceof MultiResultTableData) { - if (isIncludeUnderline(tempName)) { - nPanel.setShowText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Multi_Result_Table_Data_Name_Tips")); - dg.setButtonEnabled(false); - } + } else if (oldName.length() >= PROCEDURE_NAME_INDEX && tableDataPane.updateBean() instanceof MultiResultTableData + && isIncludeUnderline(tempName)) { + nPanel.setShowText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Multi_Result_Table_Data_Name_Tips")); + dg.setButtonEnabled(false); } else if (!BasicTableDataUtils.checkName(tempName)) { dg.setButtonEnabled(false); } else { diff --git a/designer-base/src/main/java/com/fr/design/gui/date/UIDatePicker.java b/designer-base/src/main/java/com/fr/design/gui/date/UIDatePicker.java index cbbc8ceeea..c37f5e88cd 100644 --- a/designer-base/src/main/java/com/fr/design/gui/date/UIDatePicker.java +++ b/designer-base/src/main/java/com/fr/design/gui/date/UIDatePicker.java @@ -1,10 +1,7 @@ package com.fr.design.gui.date; -import com.fine.theme.icon.LazyIcon; -import com.fine.theme.utils.FineUIStyle; -import com.fr.design.gui.ibutton.UIButton; +import com.fine.theme.light.ui.FineComboBoxUI; import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.icombobox.UIComboBoxUI; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; @@ -13,6 +10,7 @@ import com.fr.stable.StringUtils; import com.fr.design.carton.FeedbackToolboxDialog; import javax.swing.BorderFactory; +import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JPanel; @@ -26,6 +24,7 @@ import javax.swing.plaf.basic.ComboPopup; import java.awt.BorderLayout; import java.awt.Cursor; import java.awt.LayoutManager; +import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.Serializable; import java.text.ParseException; @@ -292,40 +291,44 @@ public class UIDatePicker extends UIComboBox implements Serializable { @Override protected ComboBoxUI getUIComboBoxUI() { - return new UIComboBoxUI() { + return new FineComboBoxUI() { @Override - protected UIButton createArrowButton() { - arrowButton = new UIButton(new LazyIcon("down_arrow")) { - public boolean shouldResponseChangeListener() { - return false; - } - }; - arrowButton.addMouseListener(this); - comboBox.addMouseListener(this); - FineUIStyle.setStyle(arrowButton, FineUIStyle.PLAIN_BUTTON); - return (UIButton) arrowButton; + protected JButton createArrowButton() { + JButton button = super.createArrowButton(); + button.addMouseListener(getPopupMouseAdapter()); + return button; } @Override protected ComboPopup createPopup() { return new DatePopup(comboBox); } + @Override - public void mousePressed(MouseEvent e) { - if (UIDatePicker.this.isPopupVisible()) { - willHide = true; - UIDatePicker.this.hidePopup(); - } else { - willHide = false; - UIDatePicker.this.showPopup(); - } + protected void installListeners() { + super.installListeners(); + comboBox.addMouseListener(getPopupMouseAdapter()); + } + + MouseAdapter getPopupMouseAdapter() { + return new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + if (UIDatePicker.this.isPopupVisible()) { + willHide = true; + UIDatePicker.this.hidePopup(); + } else { + willHide = false; + UIDatePicker.this.showPopup(); + } + } + }; } }; } - //č®¾ē½®dataFormat public void setDateFormat(SimpleDateFormat format){ this.dateFormat = format;