Пример #1
0
  private void addControls() {
    setLayout(new BorderLayout());

    model = new AlertsTableModel(alerts);
    add(new JScrollPane(table = new JTable(model)), BorderLayout.CENTER);
    add(editor = new AlertEditor(main), BorderLayout.SOUTH);

    editor.setBorder(BorderFactory.createTitledBorder("Selected Alert:"));

    list = new JList(model);
    list.setLayoutOrientation(JList.VERTICAL_WRAP);
    list.setPrototypeCellValue("  255.255.255.255  ");
    list.setVisibleRowCount(4);

    AlertCellRendererSorter renderer = new AlertCellRendererSorter(table, model);
    TableColumnModel cModel = table.getColumnModel();
    for (int i = 0; i < cModel.getColumnCount(); i++) {
      cModel.getColumn(i).setCellRenderer(renderer);
    }
    table.getTableHeader().addMouseListener(renderer);
    table.getSelectionModel().addListSelectionListener(this);

    list.addListSelectionListener(this);
    list.addMouseListener(this);
  }
Пример #2
0
  /**
   * Create the left panel, containing the movie name list and the performance date list.
   *
   * @return The left panel.
   */
  public JComponent createLeftPanel() {
    nameListModel = new DefaultListModel();

    nameList = new JList(nameListModel);
    nameList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    nameList.setPrototypeCellValue("123456789012");
    nameList.addListSelectionListener(new NameSelectionListener());
    JScrollPane p1 = new JScrollPane(nameList);

    dateListModel = new DefaultListModel();

    dateList = new JList(dateListModel);
    dateList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    dateList.setPrototypeCellValue("123456789012");
    dateList.addListSelectionListener(new DateSelectionListener());
    JScrollPane p2 = new JScrollPane(dateList);

    JPanel p = new JPanel();
    p.setLayout(new GridLayout(1, 2));
    p.add(p1);
    p.add(p2);
    return p;
  }
Пример #3
0
  private JPanel createPanel() {
    JPanel A =
        new JPanel() {

          private static final long serialVersionUID = -6042644671679973897L;

          public Insets getInsets() {
            return new Insets(10, 10, 10, 10);
          }
        };

    A.setLayout(new BorderLayout());

    JLabel l = new JLabel(symbolicName);
    A.add(l, BorderLayout.NORTH);

    final JList logList = new JList(log);
    logList.setPrototypeCellValue("9999 99999999 999999");

    MouseListener mouseListener =
        new MouseAdapter() {
          public void mouseClicked(MouseEvent e) {
            ISOMsg m = (ISOMsg) logList.getSelectedValue();
            if (m != null) {
              JFrame f = new JFrame(m.toString());
              ISOMsgPanel p = new ISOMsgPanel(m);
              f.getContentPane().add(p);
              f.pack();
              f.show();
            }
          }
        };
    logList.addMouseListener(mouseListener);

    JScrollPane scrollPane = new JScrollPane(logList);
    scrollPane.setPreferredSize(new Dimension(170, 200));
    A.add(scrollPane, BorderLayout.SOUTH);
    return A;
  }
Пример #4
0
  public LongListFrame() {
    wordList = new JList<String>(new WordListModel(3));
    wordList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    wordList.setPrototypeCellValue("www");
    JScrollPane scrollPane = new JScrollPane(wordList);

    JPanel p = new JPanel();
    p.add(scrollPane);
    wordList.addListSelectionListener(
        new ListSelectionListener() {
          public void valueChanged(ListSelectionEvent evt) {
            setSubject(wordList.getSelectedValue());
          }
        });

    Container contentPane = getContentPane();
    contentPane.add(p, BorderLayout.NORTH);
    label = new JLabel(prefix + suffix);
    contentPane.add(label, BorderLayout.CENTER);
    setSubject("fox");
    pack();
  }
Пример #5
0
  public PreferencesDialog(JabRefFrame parent) {
    super(parent, Localization.lang("JabRef preferences"), false);
    JabRefPreferences prefs = JabRefPreferences.getInstance();
    frame = parent;

    main = new JPanel();
    JPanel mainPanel = new JPanel();
    JPanel lower = new JPanel();

    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(mainPanel, BorderLayout.CENTER);
    getContentPane().add(lower, BorderLayout.SOUTH);

    final CardLayout cardLayout = new CardLayout();
    main.setLayout(cardLayout);

    List<PrefsTab> tabs = new ArrayList<>();
    tabs.add(new GeneralTab(prefs));
    tabs.add(new NetworkTab(prefs));
    tabs.add(new FileTab(frame, prefs));
    tabs.add(new FileSortTab(prefs));
    tabs.add(new EntryEditorPrefsTab(frame, prefs));
    tabs.add(new GroupsPrefsTab(prefs));
    tabs.add(new AppearancePrefsTab(prefs));
    tabs.add(new ExternalTab(frame, this, prefs));
    tabs.add(new TablePrefsTab(prefs));
    tabs.add(new TableColumnsTab(prefs, parent));
    tabs.add(new BibtexKeyPatternPrefTab(prefs, parent.getCurrentBasePanel()));
    tabs.add(new PreviewPrefsTab(prefs));
    tabs.add(new NameFormatterTab(prefs));
    tabs.add(new ImportSettingsTab(prefs));
    tabs.add(new XmpPrefsTab(prefs));
    tabs.add(new AdvancedTab(prefs));

    // add all tabs
    tabs.forEach(tab -> main.add((Component) tab, tab.getTabName()));

    mainPanel.setBorder(BorderFactory.createEtchedBorder());

    String[] tabNames = tabs.stream().map(PrefsTab::getTabName).toArray(String[]::new);
    JList<String> chooser = new JList<>(tabNames);
    chooser.setBorder(BorderFactory.createEtchedBorder());
    // Set a prototype value to control the width of the list:
    chooser.setPrototypeCellValue("This should be wide enough");
    chooser.setSelectedIndex(0);
    chooser.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    // Add the selection listener that will show the correct panel when
    // selection changes:
    chooser.addListSelectionListener(
        e -> {
          if (e.getValueIsAdjusting()) {
            return;
          }
          String o = chooser.getSelectedValue();
          cardLayout.show(main, o);
        });

    JPanel buttons = new JPanel();
    buttons.setLayout(new GridLayout(4, 1));
    buttons.add(importPreferences, 0);
    buttons.add(exportPreferences, 1);
    buttons.add(showPreferences, 2);
    buttons.add(resetPreferences, 3);

    JPanel westPanel = new JPanel();
    westPanel.setLayout(new BorderLayout());
    westPanel.add(chooser, BorderLayout.CENTER);
    westPanel.add(buttons, BorderLayout.SOUTH);
    mainPanel.setLayout(new BorderLayout());
    mainPanel.add(main, BorderLayout.CENTER);
    mainPanel.add(westPanel, BorderLayout.WEST);

    JButton ok = new JButton(Localization.lang("OK"));
    JButton cancel = new JButton(Localization.lang("Cancel"));
    ok.addActionListener(new OkAction());
    CancelAction cancelAction = new CancelAction();
    cancel.addActionListener(cancelAction);
    lower.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    ButtonBarBuilder buttonBarBuilder = new ButtonBarBuilder(lower);
    buttonBarBuilder.addGlue();
    buttonBarBuilder.addButton(ok);
    buttonBarBuilder.addButton(cancel);
    buttonBarBuilder.addGlue();

    // Key bindings:
    KeyBinder.bindCloseDialogKeyToCancelAction(this.getRootPane(), cancelAction);

    // Import and export actions:
    exportPreferences.setToolTipText(Localization.lang("Export preferences to file"));
    exportPreferences.addActionListener(
        e -> {
          Optional<Path> path =
              new NewFileDialogs(frame, System.getProperty("user.home"))
                  .withExtension(FileExtensions.XML)
                  .saveNewFile();
          path.ifPresent(
              exportFile -> {
                try {
                  prefs.exportPreferences(exportFile.toString());
                } catch (JabRefException ex) {
                  LOGGER.warn(ex.getMessage(), ex);
                  JOptionPane.showMessageDialog(
                      PreferencesDialog.this,
                      ex.getLocalizedMessage(),
                      Localization.lang("Export preferences"),
                      JOptionPane.ERROR_MESSAGE);
                }
              });
        });

    importPreferences.setToolTipText(Localization.lang("Import preferences from file"));
    importPreferences.addActionListener(
        e -> {
          Optional<Path> fileName =
              new NewFileDialogs(frame, System.getProperty("user.home"))
                  .withExtension(FileExtensions.XML)
                  .openDlgAndGetSelectedFile();

          if (fileName.isPresent()) {
            try {
              prefs.importPreferences(fileName.get().toString());
              updateAfterPreferenceChanges();
              JOptionPane.showMessageDialog(
                  PreferencesDialog.this,
                  Localization.lang("You must restart JabRef for this to come into effect."),
                  Localization.lang("Import preferences"),
                  JOptionPane.WARNING_MESSAGE);
            } catch (JabRefException ex) {
              LOGGER.warn(ex.getMessage(), ex);
              JOptionPane.showMessageDialog(
                  PreferencesDialog.this,
                  ex.getLocalizedMessage(),
                  Localization.lang("Import preferences"),
                  JOptionPane.ERROR_MESSAGE);
            }
          }
        });

    showPreferences.addActionListener(
        e ->
            new PreferencesFilterDialog(new JabRefPreferencesFilter(Globals.prefs), frame)
                .setVisible(true));
    resetPreferences.addActionListener(
        e -> {
          if (JOptionPane.showConfirmDialog(
                  PreferencesDialog.this,
                  Localization.lang(
                      "Are you sure you want to reset all settings to default values?"),
                  Localization.lang("Reset preferences"),
                  JOptionPane.OK_CANCEL_OPTION)
              == JOptionPane.OK_OPTION) {
            try {
              prefs.clear();
              JOptionPane.showMessageDialog(
                  PreferencesDialog.this,
                  Localization.lang("You must restart JabRef for this to come into effect."),
                  Localization.lang("Reset preferences"),
                  JOptionPane.WARNING_MESSAGE);
            } catch (BackingStoreException ex) {
              LOGGER.warn(ex.getMessage(), ex);
              JOptionPane.showMessageDialog(
                  PreferencesDialog.this,
                  ex.getLocalizedMessage(),
                  Localization.lang("Reset preferences"),
                  JOptionPane.ERROR_MESSAGE);
            }
            updateAfterPreferenceChanges();
          }
        });

    setValues();

    pack();
  }
  private void initComponents(String formato) {

    this.setTitle("Opciones");

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.NORTHWEST;
    GridBagLayout layout = new GridBagLayout();
    this.setLayout(layout);
    GridBagConstraints constraints = new GridBagConstraints();

    pruebasLabel = new javax.swing.JLabel("Pruebas");
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.WEST;
    constraints.insets = new Insets(10, 10, 10, 10);

    this.add(pruebasLabel, constraints);

    gruposLabel = new javax.swing.JLabel("Grupos");
    constraints.gridx = 1;
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.WEST;
    constraints.insets = new Insets(10, 10, 10, 10);
    this.add(gruposLabel, constraints);

    jScrollPane1 = new javax.swing.JScrollPane();
    pruebasList = new javax.swing.JList();
    pruebasListModel = new DefaultListModel();
    pruebasList.setModel(pruebasListModel);
    pruebasList.setPrototypeCellValue(
        "                                                            ");
    jScrollPane1.setViewportView(pruebasList);
    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.WEST;
    constraints.insets = new Insets(0, 10, 5, 0);
    this.add(jScrollPane1, constraints);

    jScrollPane2 = new javax.swing.JScrollPane();
    gruposList = new javax.swing.JList();
    gruposListModel = new DefaultListModel();
    gruposList.setModel(gruposListModel);
    gruposList.setPrototypeCellValue(
        "                                                            ");
    jScrollPane2.setViewportView(gruposList);
    constraints.gridx = 1;
    constraints.gridy = 1;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.WEST;
    constraints.insets = new Insets(0, 10, 5, 0);
    this.add(jScrollPane2, constraints);

    pruebasCheckBox = new javax.swing.JCheckBox("Todas las pruebas");
    constraints.gridx = 0;
    constraints.gridy = 2;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.WEST;
    constraints.insets = new Insets(0, 10, 0, 0);
    this.add(pruebasCheckBox, constraints);

    pruebasCheckBox.addChangeListener(
        new ChangeListener() {
          @Override
          public void stateChanged(ChangeEvent ce) {
            if (pruebasCheckBox.isSelected()) {
              pruebasList.clearSelection();
              pruebasList.setEnabled(false);
            } else {
              pruebasList.setEnabled(true);
            }
          }
        });

    gruposCheckBox = new javax.swing.JCheckBox("Todos los grupos");
    constraints.gridx = 0;
    constraints.gridy = 3;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.WEST;
    // constraints.insets = new Insets(10,10,10,10);
    this.add(gruposCheckBox, constraints);

    gruposCheckBox.addChangeListener(
        new ChangeListener() {
          @Override
          public void stateChanged(ChangeEvent ce) {
            if (gruposCheckBox.isSelected()) {
              gruposList.clearSelection();
              gruposList.setEnabled(false);
            } else {
              gruposList.setEnabled(true);
            }
          }
        });

    listaSalidaCheckBox = new javax.swing.JCheckBox("Generar lista de salida");
    constraints.gridx = 0;
    constraints.gridy = 4;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.WEST;
    constraints.insets = new Insets(0, 10, 5, 0);
    this.add(listaSalidaCheckBox, constraints);

    participantesAsignadosCheckBox = new JCheckBox("Solo participantes asignados");
    constraints.gridx = 1;
    constraints.gridy = 4;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.WEST;
    constraints.insets = new Insets(0, 10, 0, 0);
    this.add(participantesAsignadosCheckBox, constraints);

    listaSalidaCheckBox.addChangeListener(
        new ChangeListener() {
          @Override
          public void stateChanged(ChangeEvent ce) {
            if (listaSalidaCheckBox.isSelected()) {

              participantesAsignadosCheckBox.setEnabled(true);
            } else {
              participantesAsignadosCheckBox.setSelected(false);
              participantesAsignadosCheckBox.setEnabled(false);
            }
          }
        });

    imprimirButton = new javax.swing.JButton("Crear fichero " + formato);
    constraints.gridx = 0;
    constraints.gridy = 5;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.WEST;
    constraints.insets = new Insets(0, 10, 0, 0);
    constraints.weighty = 1.0;
    this.add(imprimirButton, constraints);

    cancelarButton = new javax.swing.JButton("Cancelar");
    constraints.gridx = 1;
    constraints.gridy = 5;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.WEST;
    // constraints.insets = new Insets(10,10,10,10);
    constraints.weightx = 1.0;
    this.add(cancelarButton, constraints);

    if (formato.equals("Excel")) {
      listaSalidaCheckBox.setVisible(false);

      constraints.gridx = 0;
      constraints.gridy = 4;
      constraints.gridwidth = 1;
      constraints.gridheight = 1;
      constraints.fill = GridBagConstraints.NONE;
      constraints.anchor = GridBagConstraints.WEST;
      constraints.insets = new Insets(0, 10, 5, 0);
      this.add(participantesAsignadosCheckBox, constraints);
    }
  }
Пример #7
0
  private void initLayout() {
    fieldNameField.setEnabled(false);
    fieldList.setVisibleRowCount(4);
    wordList.setVisibleRowCount(10);
    final String VAL = "Uren luren himmelturen, ja Besseggen.";
    fieldList.setPrototypeCellValue(VAL);
    wordList.setPrototypeCellValue(VAL);

    fieldPan.setBorder(
        BorderFactory.createTitledBorder(
            BorderFactory.createEtchedBorder(), Localization.lang("Field name")));
    wordPan.setBorder(
        BorderFactory.createTitledBorder(
            BorderFactory.createEtchedBorder(), Localization.lang("Keyword")));
    fieldPan.setLayout(gbl);
    wordPan.setLayout(gbl);
    con.insets = new Insets(2, 2, 2, 2);
    con.fill = GridBagConstraints.BOTH;
    con.gridwidth = 2;
    con.weightx = 1;
    con.weighty = 1;
    con.gridx = 0;
    con.gridy = 0;
    gbl.setConstraints(fPane, con);
    fieldPan.add(fPane);
    gbl.setConstraints(wPane, con);
    wordPan.add(wPane);
    con.gridwidth = 1;
    con.gridx = 2;
    // con.weightx = 0.7;
    con.gridheight = 2;
    gbl.setConstraints(fieldNamePan, con);
    fieldPan.add(fieldNamePan);
    gbl.setConstraints(wordEditPan, con);
    wordPan.add(wordEditPan);
    con.gridx = 0;
    con.gridy = 1;
    con.weightx = 0;
    con.weighty = 0;
    con.gridwidth = 1;
    con.gridheight = 1;
    con.fill = GridBagConstraints.NONE;
    con.anchor = GridBagConstraints.WEST;
    gbl.setConstraints(newField, con);
    fieldPan.add(newField);
    gbl.setConstraints(newWord, con);
    wordPan.add(newWord);
    con.gridx = 1;
    // con.anchor = GridBagConstraints.EAST;
    gbl.setConstraints(removeField, con);
    fieldPan.add(removeField);
    gbl.setConstraints(removeWord, con);
    wordPan.add(removeWord);
    con.anchor = GridBagConstraints.WEST;
    con.gridx = 0;
    con.gridy = 0;
    gbl.setConstraints(fieldNameField, con);
    fieldNamePan.add(fieldNameField);
    gbl.setConstraints(wordEditField, con);
    wordEditPan.add(wordEditField);

    // Add buttons:
    ButtonBarBuilder bsb = new ButtonBarBuilder(buttonPan);
    bsb.addGlue();
    bsb.addButton(ok);
    bsb.addButton(apply);
    bsb.addButton(cancel);
    bsb.addRelatedGap();
    bsb.addButton(new HelpAction(frame.helpDiag, GUIGlobals.contentSelectorHelp).getIconButton());
    bsb.addGlue();

    // Add panels to dialog:
    con.fill = GridBagConstraints.BOTH;
    getContentPane().setLayout(gbl);
    con.weightx = 1;
    con.weighty = 0.5;
    con.gridwidth = 1;
    con.gridheight = 1;
    con.gridx = 0;
    con.gridy = 0;
    gbl.setConstraints(fieldPan, con);
    getContentPane().add(fieldPan);
    con.gridy = 1;
    gbl.setConstraints(wordPan, con);
    getContentPane().add(wordPan);
    con.weighty = 0;
    con.gridy = 2;
    con.insets = new Insets(12, 2, 2, 2);
    gbl.setConstraints(buttonPan, con);
    getContentPane().add(buttonPan);
  }
Пример #8
0
  public JPanel makePanel() {
    GridLayout gridL = new GridLayout(1, 2);
    JPanel mainPanel = new JPanel(gridL); // has BorderLayout
    mainPanel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));

    // create function list area
    JPanel funcPanel = new JPanel(new BorderLayout());
    funcPanel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
    functionList = new JList();
    functionList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    functionList.addListSelectionListener(this);
    functionList.setVisibleRowCount(12);
    JScrollPane scrollPane = new JScrollPane(functionList);
    funcPanel.add(scrollPane);

    JPanel categoryPanel = new JPanel();
    JLabel label = new JLabel(categoriesLabel);
    categoryPanel.add(label);
    categoryMenu = new JComboBox();
    categoryPanel.add(categoryMenu);
    funcPanel.add(categoryPanel, BorderLayout.NORTH);

    // create control area on right (key bindings and buttons)
    JPanel controlPanel = new JPanel(new BorderLayout());
    controlPanel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
    // create area for key bindings
    JPanel keyPanel = new JPanel(new BorderLayout());
    JLabel kLabel = new JLabel(keyLabel);
    kLabel.setPreferredSize(categoryMenu.getPreferredSize());
    keyPanel.add(kLabel, BorderLayout.NORTH);
    keyList = new JList();
    keyList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    keyList.setPrototypeCellValue("shift-ctrl-delete");
    keyList.setVisibleRowCount(4);
    scrollPane = new JScrollPane(keyList);
    keyPanel.add(scrollPane, BorderLayout.CENTER);

    JPanel keyButtonPanel = new JPanel();
    addKeyButton = new JButton(addKeyLabel);
    addKeyButton.setMargin(new Insets(2, 2, 2, 2));
    keyButtonPanel.add(addKeyButton);

    delKeyButton = new JButton(delKeyLabel);
    delKeyButton.setMargin(new Insets(2, 2, 2, 2));
    keyButtonPanel.add(delKeyButton);

    defaultsButton = new JButton(defaultsLabel);
    keyButtonPanel.add(defaultsButton);
    keyPanel.add(keyButtonPanel, BorderLayout.SOUTH);
    controlPanel.add(keyPanel);

    // create help text area at bottom
    JPanel helpPanel = new JPanel(new GridLayout());
    helpPanel.setBorder(
        BorderFactory.createCompoundBorder(
            BorderFactory.createEmptyBorder(10, 0, 0, 0),
            BorderFactory.createLineBorder(Color.black)));
    helpLabel = new JTextArea();
    helpLabel.setRows(6);
    helpLabel.setLineWrap(true);
    helpLabel.setWrapStyleWord(true);
    helpLabel.setBackground(MoeEditor.infoColor);
    helpPanel.add(helpLabel);
    controlPanel.add(helpPanel, BorderLayout.SOUTH);

    mainPanel.add(funcPanel);
    mainPanel.add(controlPanel);
    updateDispay();

    return mainPanel;
  }
Пример #9
0
 // -----------------------------------------
 public JawtList(int rows) {
   listContents = new JListData();
   listWindow = new JList(listContents);
   listWindow.setPrototypeCellValue("Abcdefg Hijkmnop");
   getViewport().add(listWindow);
 }
Пример #10
0
  private void setupList() {
    _listMouseObserver = new LibraryPlaylistsMouseObserver();
    _listSelectionListener = new LibraryPlaylistsSelectionListener();

    SortedListModel sortedModel =
        new SortedListModel(
            _model,
            SortOrder.ASCENDING,
            new Comparator<LibraryPlaylistsListCell>() {

              @Override
              public int compare(LibraryPlaylistsListCell o1, LibraryPlaylistsListCell o2) {
                if (o1 == _newPlaylistCell) {
                  return -1;
                }
                if (o2 == _newPlaylistCell) {
                  return 1;
                }

                return o1.getText().compareTo(o2.getText());
              }
            });

    _list = new LibraryIconList(sortedModel);
    _list.setFixedCellHeight(TableSettings.DEFAULT_TABLE_ROW_HEIGHT.getValue());
    _list.setCellRenderer(new LibraryPlaylistsCellRenderer());
    _list.addMouseListener(new DefaultMouseListener(_listMouseObserver));
    _list.addListSelectionListener(_listSelectionListener);
    _list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    _list.setLayoutOrientation(JList.VERTICAL);
    _list.setPrototypeCellValue(
        new LibraryPlaylistsListCell(
            "test", "", GUIMediator.getThemeImage("playlist"), null, null));
    _list.setVisibleRowCount(-1);
    _list.setDragEnabled(true);
    _list.setTransferHandler(new LibraryPlaylistsTransferHandler(_list));
    ToolTipManager.sharedInstance().registerComponent(_list);

    _list.addKeyListener(
        new KeyAdapter() {
          @Override
          public void keyPressed(KeyEvent e) {
            list_keyPressed(e);
          }
        });

    _list.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
            if (e.getClickCount() > 1) {
              actionStartRename();
            }
          }
        });

    _textName = new JTextField();
    ThemeMediator.fixKeyStrokes(_textName);
    UIDefaults defaults = new UIDefaults();
    defaults.put("TextField.contentMargins", new InsetsUIResource(0, 4, 0, 4));
    _textName.putClientProperty("Nimbus.Overrides.InheritDefaults", Boolean.TRUE);
    _textName.putClientProperty("Nimbus.Overrides", defaults);
    _textName.addKeyListener(
        new KeyAdapter() {
          @Override
          public void keyPressed(KeyEvent e) {
            textName_keyPressed(e);
          }
        });
    _textName.setVisible(false);

    _list.add(_textName);
  }