MCPcopy Create free account
hub / github.com/dorkbox/SystemTray / getLast

Method getLast

src/dorkbox/systemTray/Menu.java:259–276  ·  view source on GitHub ↗

Gets the last menu entry or sub-menu, ignoring status and separators

()

Source from the content-addressed store, hash-verified

257 * Gets the last menu entry or sub-menu, ignoring status and separators
258 */
259 public
260 Entry getLast() {
261 synchronized (menuEntries) {
262 // access on this object must be synchronized for object visibility
263 if (!menuEntries.isEmpty()) {
264 Entry entry;
265 for (int i = menuEntries.size() - 1; i >= 0; i--) {
266 entry = menuEntries.get(i);
267
268 if (!(entry instanceof Separator || entry instanceof Status)) {
269 return entry;
270 }
271 }
272 }
273 }
274
275 return null;
276 }
277
278 /**
279 * Gets the menu entry or sub-menu for a specified index (zero-index), ignoring status and separators

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected