MCPcopy Create free account
hub / github.com/PCGen/pcgen / RandomNamePlugin

Class RandomNamePlugin

code/src/java/plugin/doomsdaybook/RandomNamePlugin.java:36–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34import pcgen.system.LanguageBundle;
35
36public class RandomNamePlugin implements InteractivePlugin
37{
38 /** Log name */
39 private static final String LOG_NAME = "Random_Name_Generator";
40
41 /** The plugin menu item in the tools menu. */
42 private final JMenuItem nameToolsItem = new JMenuItem();
43
44 /** The user interface that this class will be using. */
45 private NameGenPanel theView;
46
47 /** The English name of the plugin. */
48 private static final String NAME = "Random Names"; //$NON-NLS-1$
49 /** Key of plugin tab. */
50 private static final String IN_NAME = "in_plugin_randomname_name"; //$NON-NLS-1$
51 /** Mnemonic in menu for {@link #IN_NAME} */
52 private static final String IN_NAME_MN = "in_mn_plugin_randomname_name"; //$NON-NLS-1$
53
54 /**
55 * Starts the plugin, registering itself with the {@code TabAddMessage}.
56 */
57 @Override
58 public void start(PCGenMessageHandler mh)
59 {
60 theView = new NameGenPanel(getDataDirectory());
61 initMenus();
62 }
63
64 @Override
65 public void stop()
66 {
67 }
68
69 @Override
70 public int getPriority()
71 {
72 return SettingsHandler.getGMGenOption(RandomNamePlugin.LOG_NAME + ".LoadOrder", 80);
73 }
74
75 /**
76 * Accessor for name
77 * @return name
78 */
79 @Override
80 public String getPluginName()
81 {
82 return RandomNamePlugin.NAME;
83 }
84
85 private static String getLocalizedName()
86 {
87 return LanguageBundle.getString(RandomNamePlugin.IN_NAME);
88 }
89
90 /**
91 * Gets the view that this class is using.
92 * @return the view.
93 */

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected