}
if (initialIndex == -1)
initialIndex = normalIndex;
zoomLevel_ = new SelectWidget("Zoom:",
zoomLabels,
zoomValues,
false);
zoomLevel_.getListBox().setSelectedIndex(initialIndex);
initialZoomLevel_ = zoomValues[initialIndex];
leftPanel.add(zoomLevel_);
zoomLevel_.getListBox().addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event)
{
updatePreviewZoomLevel();
preview_.reload();
}
});
}
String[] fonts = Desktop.getFrame().getFixedWidthFontList().split("\\n");
fontFace_ = new SelectWidget("Editor font:", fonts, fonts, false, false, false);
String value = Desktop.getFrame().getFixedWidthFont();
String label = Desktop.getFrame().getFixedWidthFont().replaceAll("\\\"",
"");
if (!fontFace_.setValue(label))
{
fontFace_.insertValue(0, label, value);
fontFace_.setValue(value);
}
initialFontFace_ = StringUtil.notNull(fontFace_.getValue());
leftPanel.add(fontFace_);
fontFace_.addChangeHandler(new ChangeHandler()
{
@Override
public void onChange(ChangeEvent event)
{
String font = fontFace_.getValue();
if (font != null)
preview_.setFont(font);
else
preview_.setFont(ThemeFonts.getFixedWidthFont());
}
});
}
String[] labels = {"7", "8", "9", "10", "11", "12", "13", "14", "16", "18", "24", "36"};
String[] values = new String[labels.length];
for (int i = 0; i < labels.length; i++)
values[i] = Double.parseDouble(labels[i]) + "";
fontSize_ = new SelectWidget("Font size:",
labels,
values,
false);
if (!fontSize_.setValue(uiPrefs.fontSize().getGlobalValue() + ""))
fontSize_.getListBox().setSelectedIndex(3);
fontSize_.getListBox().addChangeHandler(new ChangeHandler()
{
public void onChange(ChangeEvent event)
{
preview_.setFontSize(Double.parseDouble(fontSize_.getValue()));
}
});
leftPanel.add(fontSize_);
theme_ = new SelectWidget("Editor theme:",
themes.getThemeNames(),
themes.getThemeNames(),
true);
theme_.getListBox().addChangeHandler(new ChangeHandler()
{