コード例 #1
0
ファイル: RightClickMenu.java プロジェクト: tnoz/jabref
  /** Set the dynamic contents of "Add to group ..." submenu. */
  @Override
  public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
    BibtexEntry[] bes = panel.getSelectedEntries();
    panel.storeCurrentEdit();
    GroupTreeNode groups = panel.metaData().getGroups();
    if (groups == null) {
      groupAdd.setEnabled(false);
      groupRemove.setEnabled(false);
    } else {
      groupAdd.setEnabled(true);
      groupRemove.setEnabled(true);
    }

    addSeparator();
    floatMarked.setSelected(Globals.prefs.getBoolean(JabRefPreferences.FLOAT_MARKED_ENTRIES));
    add(floatMarked);
  }
コード例 #2
0
ファイル: RightClickMenu.java プロジェクト: tnoz/jabref
 /** Sets the font and icon to be used, depending on the group */
 private void setGroupFontAndIcon(JMenuItem menuItem, AbstractGroup group) {
   if (Globals.prefs.getBoolean(JabRefPreferences.GROUP_SHOW_DYNAMIC)) {
     menuItem.setFont(menuItem.getFont().deriveFont(group.isDynamic() ? Font.ITALIC : Font.PLAIN));
   }
   if (Globals.prefs.getBoolean(JabRefPreferences.GROUP_SHOW_ICONS)) {
     switch (group.getHierarchicalContext()) {
       case INCLUDING:
         menuItem.setIcon(GUIGlobals.getImage("groupIncluding"));
         break;
       case REFINING:
         menuItem.setIcon(GUIGlobals.getImage("groupRefining"));
         break;
       default:
         menuItem.setIcon(GUIGlobals.getImage("groupRegular"));
         break;
     }
   }
 }