Пример #1
0
  public LibraryManagerUI(Frame parent, Platform platform) {
    super(parent, "Library Manager", Dialog.ModalityType.APPLICATION_MODAL, _("Unable to reach Arduino.cc due to possible network issues."));
    this.platform = platform;

    filtersContainer.add(new JLabel(_("Topic")), 1);
    filtersContainer.remove(2);

    typeChooser = new JComboBox();
    typeChooser.setMaximumRowCount(20);
    typeChooser.setEnabled(false);

    filtersContainer.add(Box.createHorizontalStrut(5), 0);
    filtersContainer.add(new JLabel(_("Type")), 1);
    filtersContainer.add(Box.createHorizontalStrut(5), 2);
    filtersContainer.add(typeChooser, 3);
  }
Пример #2
0
  private void createComponents() {
    categoryLabel = new JLabel(Language.text("contrib.category"));

    categoryChooser = new JComboBox<String>();
    categoryChooser.setMaximumRowCount(20);
    categoryChooser.setFont(Toolkit.getSansFont(14, Font.PLAIN));

    updateCategoryChooser();

    categoryChooser.addItemListener(
        new ItemListener() {
          public void itemStateChanged(ItemEvent e) {
            category = (String) categoryChooser.getSelectedItem();
            if (ContributionManagerDialog.ANY_CATEGORY.equals(category)) {
              category = null;
            }
            filterLibraries(category, filterField.filters);
            contributionListPanel.updateColors();
          }
        });

    filterField = new FilterField();
  }