MCPcopy Create free account
hub / github.com/GateNLP/gate-core / getActions

Method getActions

src/main/java/gate/gui/ResourceHelper.java:66–75  ·  view source on GitHub ↗

Get the right-click menu items that this tool will add to the specified resource. Note that this implementation uses a cache so that the same items will be returned each time the menu is displayed. For a fully dynamic approach a subclass should override this method to simply call @{link {@link #buil

(NameBearerHandle handle)

Source from the content-addressed store, hash-verified

64 * to the right click menu of the specified handle
65 */
66 public List<Action> getActions(NameBearerHandle handle) {
67
68 if(!actions.containsKey(handle.getTarget())) {
69 // if we haven't seen this resource before then build the actions
70 actions.put(handle.getTarget(), buildActions(handle));
71 }
72
73 // return the actions from the cache
74 return actions.get(handle.getTarget());
75 }
76
77 /**
78 * Build the {@link javax.swing.Action} instances that should be used to

Callers

nothing calls this directly

Calls 5

buildActionsMethod · 0.95
getTargetMethod · 0.65
getMethod · 0.65
containsKeyMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected