/**
* Initializes the list box that allows to select styles
* @param listBox the list box to initialize
* @param dataToName the mapping from the style ID to the human readable name of the style
* @param dataToStyleName the mapping from the style ID to the CSS style name
* @param defaultValue the default style ID that should be set as selected
*/
public void initializeListBox( final ListBox listBox, final Map<Integer, String> dataToName,
final Map<Integer, String> dataToStyleName, final int defaultValue) {
//Initialize the list box with data
Iterator< Entry<Integer,String> > entrySetIter = dataToName.entrySet().iterator();
while( entrySetIter.hasNext() ) {
Entry<Integer, String> entry = entrySetIter.next();
listBox.addItem( entry.getValue(), dataToStyleName.get( entry.getKey() ) );
}
listBox.setVisibleItemCount( 1 );
//Set the default value as being selected
setListBoxStyleID( listBox, defaultValue, dataToStyleName );
//Add the change listener
listBox.addChangeHandler(new ChangeHandler() {
public void onChange(ChangeEvent e) {
//Update the sample view
updateSampleViewStyles();
}
});
}
FontSelectorPanelUI.java 文件源码
java
阅读 30
收藏 0
点赞 0
评论 0
项目:x-cure-chat
作者:
评论列表
文章目录