diff --git a/designer-base/src/main/java/com/fine/theme/light/ui/FineMenuItemUI.java b/designer-base/src/main/java/com/fine/theme/light/ui/FineMenuItemUI.java index 58237f59d9..4e47d1587e 100644 --- a/designer-base/src/main/java/com/fine/theme/light/ui/FineMenuItemUI.java +++ b/designer-base/src/main/java/com/fine/theme/light/ui/FineMenuItemUI.java @@ -1,8 +1,8 @@ package com.fine.theme.light.ui; +import com.fine.theme.icon.LazyIcon; import com.fine.theme.utils.FineClientProperties; import com.formdev.flatlaf.ui.FlatMenuItemUI; -import com.fr.design.editlock.EditLockUtils; import javax.swing.JComponent; import javax.swing.plaf.ComponentUI; @@ -35,7 +35,9 @@ public class FineMenuItemUI extends FlatMenuItemUI { Object itemType = c.getClientProperty(FineClientProperties.MENU_ITEM_TYPE); if (FineClientProperties.MENU_ITEM_TYPE_LOCK.equals(itemType)) { - g.drawImage(EditLockUtils.LOCKED_IMAGE, c.getWidth() - rightMargin - iconSize, (c.getHeight() - iconSize) / 2, iconSize, iconSize, null); + LazyIcon icon = new LazyIcon("locked"); + + icon.paintIcon(c, g, c.getWidth() - rightMargin - iconSize, (c.getHeight() - iconSize) / 2); } } } diff --git a/designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItem.java b/designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItem.java index 4127b3eec8..eaa368a4f7 100644 --- a/designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItem.java +++ b/designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItem.java @@ -33,7 +33,6 @@ public class UILockMenuItem extends UIMenuItem implements EditLockChangeListener this.lockedTooltips = lockedTooltips; this.normalTooltips = normalTooltips; this.lockItem = lockItem; - this.putClientProperty(FineClientProperties.MENU_ITEM_TYPE, FineClientProperties.MENU_ITEM_TYPE_LOCK); } public LockItem getLockItem() { @@ -43,6 +42,11 @@ public class UILockMenuItem extends UIMenuItem implements EditLockChangeListener @Override public void updateLockedState(EditLockChangeEvent event) { this.setToolTipText(event.isLocked() ? lockedTooltips : normalTooltips); + if (event.isLocked()) { + this.putClientProperty(FineClientProperties.MENU_ITEM_TYPE, FineClientProperties.MENU_ITEM_TYPE_LOCK); + } else { + this.putClientProperty(FineClientProperties.MENU_ITEM_TYPE, null); + } this.repaint(); } } diff --git a/designer-realize/src/main/java/com/fr/design/sort/celldscolumn/CellDSColumnSortGroupPane.java b/designer-realize/src/main/java/com/fr/design/sort/celldscolumn/CellDSColumnSortGroupPane.java index 01c5eafc05..dce0f5fffe 100644 --- a/designer-realize/src/main/java/com/fr/design/sort/celldscolumn/CellDSColumnSortGroupPane.java +++ b/designer-realize/src/main/java/com/fr/design/sort/celldscolumn/CellDSColumnSortGroupPane.java @@ -27,16 +27,19 @@ public class CellDSColumnSortGroupPane extends AbstractSortGroupPane { java.util.Map tableDataWrapperMap = DesignTableDataManager.getAllEditingDataSet(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget()); Map allDataSetIncludingProcedure = DesignTableDataManager.getAllDataSetIncludingProcedure(tableDataWrapperMap); - TableDataWrapper tableDataWrapper = allDataSetIncludingProcedure.get(dsColumn.getDSName()); - if (tableDataWrapper != null) { - java.util.List columnNameList = tableDataWrapper.calculateColumnNameList(); - String[] columnNames = new String[columnNameList.size()]; - columnNameList.toArray(columnNames); - cellDSColumnSortItemPane.sortAreaUiComboBox.removeAllItems(); - for (String columnName : columnNames) { - cellDSColumnSortItemPane.sortAreaUiComboBox.addItem(columnName); + if (dsColumn != null) { + TableDataWrapper tableDataWrapper = allDataSetIncludingProcedure.get(dsColumn.getDSName()); + if (tableDataWrapper != null) { + java.util.List columnNameList = tableDataWrapper.calculateColumnNameList(); + String[] columnNames = new String[columnNameList.size()]; + columnNameList.toArray(columnNames); + cellDSColumnSortItemPane.sortAreaUiComboBox.removeAllItems(); + for (String columnName : columnNames) { + cellDSColumnSortItemPane.sortAreaUiComboBox.addItem(columnName); + } } } + cellDSColumnSortItemPane.populateBean(sortExpression); return cellDSColumnSortItemPane; }