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) {