|
|
|
@ -11,6 +11,7 @@ import com.fr.design.dialog.FineJOptionPane;
|
|
|
|
|
import com.fr.design.gui.imenu.UIMenuItem; |
|
|
|
|
import com.fr.design.gui.imenu.UIPopupMenu; |
|
|
|
|
import com.fr.design.gui.imenu.UIScrollPopUpMenu; |
|
|
|
|
import com.fr.design.i18n.DesignSizeI18nManager; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
@ -199,17 +200,9 @@ public class MutilTempalteTabPane extends JComponent {
|
|
|
|
|
height += 25; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//当前i18n适配中英日,其中英日字符串长度较长,需调整popupMenu的宽度
|
|
|
|
|
//后续版本可考虑读取字符串像素宽度,以自适应调整menu
|
|
|
|
|
int popupMenuWidth; |
|
|
|
|
if(ComparatorUtils.equals(GeneralContext.getLocale(), Locale.US)){ |
|
|
|
|
popupMenuWidth = 350; |
|
|
|
|
}else if(ComparatorUtils.equals(GeneralContext.getLocale(), Locale.JAPAN)){ |
|
|
|
|
popupMenuWidth = 240; |
|
|
|
|
}else { |
|
|
|
|
popupMenuWidth = 170; |
|
|
|
|
} |
|
|
|
|
menu.setPreferredSize(new Dimension(popupMenuWidth, height)); |
|
|
|
|
//根据当前i18n语言环境,动态调整popupMenu的宽度
|
|
|
|
|
menu.setPreferredSize(new Dimension((int)DesignSizeI18nManager.getInstance(). |
|
|
|
|
i18nDimension("com.fr.design.file.MultiTemplateTabPane.popUpMenu").getWidth(),height)); |
|
|
|
|
GUICoreUtils.showPopupMenu(menu, MutilTempalteTabPane.getInstance(), e.getX(), MutilTempalteTabPane.getInstance().getY() - 1 + MutilTempalteTabPane.getInstance().getHeight()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|