@param peer the platform specific implementation for all actions for this type @param parent the parent of this menu, null if the parent is the system tray @param imageResizeUtil the utility used to resize images. This can be Tray specific because of cache requirements
(final MenuPeer peer, final Menu parent, ImageResizeUtil imageResizeUtil)
| 153 | * @param imageResizeUtil the utility used to resize images. This can be Tray specific because of cache requirements |
| 154 | */ |
| 155 | public |
| 156 | void bind(final MenuPeer peer, final Menu parent, ImageResizeUtil imageResizeUtil) { |
| 157 | super.bind(peer, parent, imageResizeUtil); |
| 158 | |
| 159 | List<Entry> copy; |
| 160 | synchronized (menuEntries) { |
| 161 | // access on this object must be synchronized for object visibility |
| 162 | // a copy is made to prevent deadlocks from occurring when operating in different threads |
| 163 | copy = new ArrayList<>(menuEntries); |
| 164 | } |
| 165 | |
| 166 | for (int i = 0, menuEntriesSize = copy.size(); i < menuEntriesSize; i++) { |
| 167 | final Entry menuEntry = copy.get(i); |
| 168 | peer.add(this, menuEntry, i); |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | /** |
| 173 | * Adds a menu entry, separator, or sub-menu to this menu |
no test coverage detected