/** * Creates a new <tt>JMenuItem</tt> and adds it to this <tt>JPopupMenu</tt>. * * @param textKey the key of the internationalized string in the resources of the application * which represents the text of the new <tt>JMenuItem</tt> * @param iconID the <tt>ImageID</tt> of the image in the resources of the application which * represents the icon of the new <tt>JMenuItem</tt> * @param name the name of the new <tt>JMenuItem</tt> * @return a new <tt>JMenuItem</tt> instance which has been added to this <tt>JPopupMenu</tt> */ private JMenuItem createMenuItem(String textKey, ImageID iconID, String name) { ResourceManagementService resources = GuiActivator.getResources(); JMenuItem menuItem = new JMenuItem( resources.getI18NString(textKey), new ImageIcon(ImageLoader.getImage(iconID))); menuItem.setMnemonic(resources.getI18nMnemonic(textKey)); menuItem.setName(name); menuItem.addActionListener(this); add(menuItem); return menuItem; }