From 5810601058b9227c4a55fd4a4e208556ee5e206a Mon Sep 17 00:00:00 2001 From: plough Date: Tue, 25 Jul 2017 15:48:46 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E6=96=B0=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=9D=A2=E6=9D=BF=3D=E3=80=8B=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=88=97=E8=A1=A8=E9=A1=B9=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=8F=B0=E6=8A=A5=E9=94=99=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/controlpane/UINameableListCellRenderer.java | 6 ------ designer_base/src/com/fr/design/gui/ilist/UIList.java | 5 +++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/controlpane/UINameableListCellRenderer.java b/designer_base/src/com/fr/design/gui/controlpane/UINameableListCellRenderer.java index 70801736ac..8da13e6812 100644 --- a/designer_base/src/com/fr/design/gui/controlpane/UINameableListCellRenderer.java +++ b/designer_base/src/com/fr/design/gui/controlpane/UINameableListCellRenderer.java @@ -143,18 +143,12 @@ public class UINameableListCellRenderer extends Nameable wrappee = ((ListModelElement) value).wrapper; this.setText(((ListModelElement) value).wrapper.getName()); - boolean iconSet = false; for (NameableCreator creator : listControlPane.creators()) { if (creator.menuIcon() != null && creator.acceptObject2Populate(wrappee) != null) { -// this.setIcon(creator.menuIcon()); this.setToolTipText(creator.createTooltip()); - iconSet = true; break; } } -// if (!iconSet) { -// this.setIcon(BaseUtils.readIcon("/com/fr/base/images/oem/cpt.png")); -// } } return this; diff --git a/designer_base/src/com/fr/design/gui/ilist/UIList.java b/designer_base/src/com/fr/design/gui/ilist/UIList.java index 8916cf18c8..34a3a48d05 100644 --- a/designer_base/src/com/fr/design/gui/ilist/UIList.java +++ b/designer_base/src/com/fr/design/gui/ilist/UIList.java @@ -1,6 +1,7 @@ package com.fr.design.gui.ilist; import com.fr.data.core.db.TableProcedure; +import com.fr.design.gui.controlpane.UINameableListCellRenderer; import com.fr.design.gui.itooltip.UIToolTip; import com.fr.design.mainframe.JTemplate; import com.fr.stable.StringUtils; @@ -43,6 +44,10 @@ public class UIList extends JList { Object value = getModel().getElementAt(index); ListCellRenderer renderer = getCellRenderer(); Component rendererComp = renderer.getListCellRendererComponent(this, value, index, true, false); + // UINameableListCellRenderer 继承自JPanel,无法强转为JLabel,直接返回即可 + if (rendererComp instanceof UINameableListCellRenderer) { + return null; + } if (rendererComp.getPreferredSize().width > getVisibleRect().width) { String tips = (rendererComp instanceof JComponent) ? ((JComponent) rendererComp).getToolTipText() : null; if (tips == null) {