Browse Source

bug fix

master
XiaXiang 8 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.cell.model.AlphaCellModel;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
@ -38,8 +39,9 @@ public class ContentCellRender implements ListCellRenderer<Object> {
name.setForeground(AlphaFineConstants.BLACK);
name.setVerticalTextPosition(SwingConstants.CENTER);
name.setHorizontalTextPosition(SwingConstants.RIGHT);
if (model.getDescription() != null) {
content.setText("-" + model.getDescription());
String description = model.getDescription();
if (StringUtils.isNotBlank(description)) {
content.setText("-" + description);
content.setForeground(AlphaFineConstants.LIGHT_GRAY);
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.stable.ArrayUtils;
import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
@ -157,7 +158,7 @@ public abstract class ToolBarMenuDock {
private void addAllUpdateActionsToList(List<MenuDef> menuList) {
shortCutsList = new ArrayList<>();
for (MenuDef menuDef : menuList) {
addUpdateActionToList(menuDef);
addUpdateActionToList(menuDef, 0);
}
}
@ -165,16 +166,20 @@ public abstract class ToolBarMenuDock {
* 递归获取所有UpdateAction
* @param menuDef
*/
private void addUpdateActionToList(MenuDef menuDef) {
private void addUpdateActionToList(MenuDef menuDef, int level) {
if (menuDef instanceof OpenRecentReportMenuDef) {
return;
}
String parentName = menuDef.getName();
String parentName = StringUtils.EMPTY;
if (level > 0) {
parentName = menuDef.getName();
}
level++;
for (ShortCut shortCut : menuDef.getShortcutList()) {
if (shortCut instanceof UpdateAction) {
shortCutsList.add(new UpdateActionModel(parentName, (UpdateAction) shortCut));
} else if (shortCut instanceof MenuDef) {
addUpdateActionToList((MenuDef) shortCut);
addUpdateActionToList((MenuDef) shortCut, level);
}
}
}

Loading…
Cancel
Save