add(new BrowserLayoutMenuItem(frame));
}
private void addPreviewItems() {
final ComboFrame frame = getComboFrame();
final Document doc = frame.getDocument();
final List<Preview> previews = doc.getEngine().getPreviews();
int previewCount = 0;
for ( final Preview preview : previews ) {
if (previewCount == 0) {
// The first preview is the "styles" preview, not for this menu.
previewCount++;
continue;
}
String name = preview.getName();
JMenuItem previewItem = new JMenuItem(name);
previewItem.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
doc.getEditor().setPreview( preview );
}
}
);
final KeyStroke stroke = getKeyStroke( previewCount++ );
previewItem.setAccelerator( stroke );