use of org.eclipse.wb.internal.swing.laf.model.PluginLafInfo in project windowbuilder by eclipse.
the class LafSupport method createLAFList.
/**
* Enumerates all available {@link LafInfo} and stores it into <code>m_lafList</code>.
*/
private static void createLAFList() {
if (m_lafList == null) {
m_lafList = Lists.newArrayList();
CategoryInfo rootCategory = new CategoryInfo(ROOT_ID, "<root>");
m_lafList.add(rootCategory);
// add "undefined" and "current system"
rootCategory.add(SystemLafInfo.INSTANCE);
rootCategory.add(UndefinedLafInfo.INSTANCE);
rootCategory.add(new SeparatorLafInfo());
// enumerate system LAFs
CategoryInfo jdkCategory = new CategoryInfo("JRE", "JRE");
m_lafList.add(jdkCategory);
LookAndFeelInfo[] systemLAFs = UIManager.getInstalledLookAndFeels();
for (int i = 0; i < systemLAFs.length; i++) {
LookAndFeelInfo laf = systemLAFs[i];
jdkCategory.add(new LafInfo(laf.getName(), laf.getName(), laf.getClassName()));
}
// add LAFs using plugin API
List<IConfigurationElement> categoryElements = ExternalFactoriesHelper.getElements(EXTERNAL_LAF_POINT, "category");
for (IConfigurationElement categoryElement : categoryElements) {
CategoryInfo category;
if (ROOT_ID.equals(ExternalFactoriesHelper.getRequiredAttribute(categoryElement, "id"))) {
category = rootCategory;
} else {
category = new CategoryInfo(categoryElement);
m_lafList.add(category);
}
for (IConfigurationElement lafElement : categoryElement.getChildren("LookAndFeel")) {
if (isConditionTrue(lafElement)) {
category.add(new PluginLafInfo(lafElement));
}
}
}
// apply commands
commands_apply();
}
}
Aggregations