Browse Source

bug fix

master
XiaXiang 7 years ago
parent
commit
1ab9909905
  1. 6
      designer/src/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java
  2. 13
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

6
designer/src/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java

@ -4,6 +4,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -38,8 +39,9 @@ public class ContentCellRender implements ListCellRenderer<Object> {
name.setForeground(AlphaFineConstants.BLACK); name.setForeground(AlphaFineConstants.BLACK);
name.setVerticalTextPosition(SwingConstants.CENTER); name.setVerticalTextPosition(SwingConstants.CENTER);
name.setHorizontalTextPosition(SwingConstants.RIGHT); name.setHorizontalTextPosition(SwingConstants.RIGHT);
if (model.getDescription() != null) { String description = model.getDescription();
content.setText("-" + model.getDescription()); if (StringUtils.isNotBlank(description)) {
content.setText("-" + description);
content.setForeground(AlphaFineConstants.LIGHT_GRAY); content.setForeground(AlphaFineConstants.LIGHT_GRAY);
panel.add(content, BorderLayout.CENTER); panel.add(content, BorderLayout.CENTER);
} }

13
designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -34,6 +34,7 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -157,7 +158,7 @@ public abstract class ToolBarMenuDock {
private void addAllUpdateActionsToList(List<MenuDef> menuList) { private void addAllUpdateActionsToList(List<MenuDef> menuList) {
shortCutsList = new ArrayList<>(); shortCutsList = new ArrayList<>();
for (MenuDef menuDef : menuList) { for (MenuDef menuDef : menuList) {
addUpdateActionToList(menuDef); addUpdateActionToList(menuDef, 0);
} }
} }
@ -165,16 +166,20 @@ public abstract class ToolBarMenuDock {
* 递归获取所有UpdateAction * 递归获取所有UpdateAction
* @param menuDef * @param menuDef
*/ */
private void addUpdateActionToList(MenuDef menuDef) { private void addUpdateActionToList(MenuDef menuDef, int level) {
if (menuDef instanceof OpenRecentReportMenuDef) { if (menuDef instanceof OpenRecentReportMenuDef) {
return; return;
} }
String parentName = menuDef.getName(); String parentName = StringUtils.EMPTY;
if (level > 0) {
parentName = menuDef.getName();
}
level++;
for (ShortCut shortCut : menuDef.getShortcutList()) { for (ShortCut shortCut : menuDef.getShortcutList()) {
if (shortCut instanceof UpdateAction) { if (shortCut instanceof UpdateAction) {
shortCutsList.add(new UpdateActionModel(parentName, (UpdateAction) shortCut)); shortCutsList.add(new UpdateActionModel(parentName, (UpdateAction) shortCut));
} else if (shortCut instanceof MenuDef) { } else if (shortCut instanceof MenuDef) {
addUpdateActionToList((MenuDef) shortCut); addUpdateActionToList((MenuDef) shortCut, level);
} }
} }
} }

Loading…
Cancel
Save