use of org.jabref.gui.actions.ChangeTypeAction in project jabref by JabRef.
the class ChangeEntryTypeMenu method createEntryTypeSection.
private void createEntryTypeSection(BasePanel panel, JMenu menu, String title, List<? extends EntryType> types) {
// bibtex
JMenuItem header = new JMenuItem(title);
Font font = new Font(menu.getFont().getName(), Font.ITALIC, menu.getFont().getSize());
header.setFont(font);
header.setEnabled(false);
if (!types.isEmpty()) {
menu.add(header);
}
for (EntryType type : types) {
menu.add(new ChangeTypeAction(type, panel));
}
}
use of org.jabref.gui.actions.ChangeTypeAction in project jabref by JabRef.
the class ChangeEntryTypeMenu method populateChangeEntryTypeMenu.
/**
* Remove all types from the menu. Then cycle through all available
* types, and add them.
*/
private void populateChangeEntryTypeMenu(JMenu menu, BasePanel panel) {
menu.removeAll();
// biblatex?
if (panel.getBibDatabaseContext().isBiblatexMode()) {
for (EntryType type : EntryTypes.getAllValues(BibDatabaseMode.BIBLATEX)) {
menu.add(new ChangeTypeAction(type, panel));
}
List<EntryType> customTypes = EntryTypes.getAllCustomTypes(BibDatabaseMode.BIBLATEX);
if (!customTypes.isEmpty()) {
menu.addSeparator();
// custom types
createEntryTypeSection(panel, menu, "Custom Entries", customTypes);
}
} else {
// Bibtex
createEntryTypeSection(panel, menu, "BibTeX Entries", BibtexEntryTypes.ALL);
menu.addSeparator();
// ieeetran
createEntryTypeSection(panel, menu, "IEEETran Entries", IEEETranEntryTypes.ALL);
List<EntryType> customTypes = EntryTypes.getAllCustomTypes(BibDatabaseMode.BIBTEX);
if (!customTypes.isEmpty()) {
menu.addSeparator();
// custom types
createEntryTypeSection(panel, menu, "Custom Entries", customTypes);
}
}
}
Aggregations