private MutableTreeNode populatePlot(Plot p) throws SQLException { DefaultMutableTreeNode tree = new DefaultMutableTreeNode(p); // tree.add(populateAttributes(p)); Statement stmt = db.statement(); for (Tree t : p.loadTrees(stmt)) { tree.add(populateTree(t)); } stmt.close(); return tree; }
/** Populates the tab completion map. */ public static void populateCompletionMap() { List<String> populator = new ArrayList<String>(); for (Town town : getUniverse().towns) { populator.add(town.getName()); } CommandCompletion.addCompletions("townCompletionAndAll", populator); CommandCompletion.addCompletion("townCompletionAndAll", "@a"); CommandCompletion.addCompletions("townCompletion", populator); populator = new ArrayList<String>(); for (Resident res : getUniverse().residents) { populator.add(res.getPlayerName()); } CommandCompletion.addCompletions("residentCompletion", populator); populator = new ArrayList<String>(); for (FlagType flag : FlagType.values()) { populator.add(flag.name.toLowerCase()); } CommandCompletion.addCompletions("flagCompletion", populator); populator = new ArrayList<String>(); for (FlagType flag : FlagType.values()) { if (flag.isWhitelistable) populator.add(flag.name.toLowerCase()); } CommandCompletion.addCompletions("flagCompletionWhitelist", populator); populator = new ArrayList<String>(); for (Plot plot : MyTownUniverse.instance.plots) { populator.add(plot.toString()); } CommandCompletion.addCompletions("plotCompletion", populator); populator = new ArrayList<String>(); for (Rank rank : Rank.defaultRanks) { populator.add(rank.getName()); } CommandCompletion.addCompletions("rankCompletion", populator); }