}
public AbstractRibbonBand<?> createRibbonBand(String name, CustomRibbonBandGenerator customBandsGenerator) throws MissingResourceException, ResourceFormatException, MissingListenerException {
String title=getString(name+".Title");
JRibbonBand result=new JRibbonBand(title,null);
JComponent customComponent=customBandsGenerator.createRibbonComponent(name);
if (customComponent!=null){
JRibbonComponent ribbonComponent;
if (customComponent instanceof JRibbonComponent)
ribbonComponent=(JRibbonComponent)customComponent;
else ribbonComponent=new JRibbonComponent(customComponent);
result.addRibbonComponent(ribbonComponent,3);
return result;
}
@SuppressWarnings("unchecked")
List<String> buttons = (List<String>)getStringList(name);
//int i=0;
for (String s : buttons){
if (s.equals(SEPARATOR)) {
result.startGroup();
} else {
RibbonElementPriority priority=RibbonElementPriority.MEDIUM;
if (s.endsWith(".TOP")){
priority=RibbonElementPriority.TOP;
s=s.substring(0, s.length()-4);
}else if (s.endsWith(".LOW")){
priority=RibbonElementPriority.LOW;
s=s.substring(0, s.length()-4);
}
AbstractCommandButton button = createCommandButton(s);
// boolean visible = true;
// try {
// visible = getBoolean(s + ExtButtonFactory.VISIBLE_SUFFIX);
// } catch (MissingResourceException e) {}
// if (visible)
// result.add(button);
result.addCommandButton(button, /*i++ == 0 ? RibbonElementPriority.TOP :*/ priority);
}
}
List<RibbonBandResizePolicy> resizePolicies = new ArrayList<RibbonBandResizePolicy>();
resizePolicies.add(new CoreRibbonResizePolicies.Mirror(result.getControlPanel()));
// resizePolicies.add(new CoreRibbonResizePolicies.Mid2Low(result.getControlPanel()));
result.setResizePolicies(resizePolicies);
return result;
}