use of net.runelite.client.config.RuneLiteConfig in project runelite by runelite.
the class ConfigPanel method rebuildPluginList.
final void rebuildPluginList() {
scrollBarPosition = getScrollPane().getVerticalScrollBar().getValue();
Map<String, JPanel> newChildren = new TreeMap<>();
pluginManager.getPlugins().stream().filter(plugin -> !plugin.getClass().getAnnotation(PluginDescriptor.class).hidden()).sorted(Comparator.comparing(left -> left.getClass().getAnnotation(PluginDescriptor.class).name())).forEach(plugin -> {
final Config pluginConfigProxy = pluginManager.getPluginConfigProxy(plugin);
final String pluginName = plugin.getClass().getAnnotation(PluginDescriptor.class).name();
final JPanel groupPanel = buildGroupPanel();
groupPanel.add(new JLabel(pluginName), BorderLayout.CENTER);
final JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new GridLayout(1, 2, 3, 0));
groupPanel.add(buttonPanel, BorderLayout.LINE_END);
final JButton editConfigButton = buildConfigButton(pluginConfigProxy);
buttonPanel.add(editConfigButton);
final JButton toggleButton = buildToggleButton(plugin);
buttonPanel.add(toggleButton);
newChildren.put(pluginName, groupPanel);
});
final JPanel groupPanel = buildGroupPanel();
groupPanel.add(new JLabel("RuneLite"), BorderLayout.CENTER);
final JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new GridLayout(1, 2, 3, 0));
groupPanel.add(buttonPanel, BorderLayout.LINE_END);
final JButton editConfigButton = buildConfigButton(runeLiteConfig);
buttonPanel.add(editConfigButton);
final JButton toggleButton = buildToggleButton(null);
buttonPanel.add(toggleButton);
newChildren.put("RuneLite", groupPanel);
children = newChildren;
openConfigList();
}
Aggregations