Methods Summary |
---|
public void | addContextMenuItem(TableContextMenuItem item)
try {
String name = item.getResourceKey();
String sTableID = item.getTableID();
try{
items_mon.enter();
Map mTypes = (Map)items.get(sTableID);
if (mTypes == null) {
// LinkedHashMap to preserve order
mTypes = new LinkedHashMap();
items.put(sTableID, mTypes);
}
mTypes.put(name, item);
}finally{
items_mon.exit();
}
} catch (Exception e) {
System.out.println("Error while adding Context Table Menu Item");
Debug.printStackTrace( e );
}
|
public TableContextMenuItem[] | getAllAsArray(java.lang.String sMenuID)
Map local_menu_item_map = (Map)this.items.get(sMenuID);
Map global_menu_item_map = (Map)this.items.get(null);
if (local_menu_item_map == null && global_menu_item_map == null) {
return new TableContextMenuItem[0];
}
ArrayList l = new ArrayList();
if (local_menu_item_map != null) {l.addAll(local_menu_item_map.values());}
if (global_menu_item_map != null) {l.addAll(global_menu_item_map.values());}
return (TableContextMenuItem[]) l.toArray(new TableContextMenuItem[l.size()]);
|
public static org.gudy.azureus2.ui.swt.views.table.utils.TableContextMenuManager | getInstance()Retrieve the static TableContextMenuManager instance
try{
class_mon.enter();
if (instance == null)
instance = new TableContextMenuManager();
return instance;
}finally{
class_mon.exit();
}
|
public void | removeContextMenuItem(TableContextMenuItem item)
Map menu_item_map = (Map)this.items.get(item.getTableID());
if (menu_item_map != null) {menu_item_map.remove(item.getResourceKey());}
|