Package javax.swing

Examples of javax.swing.DefaultListCellRenderer$UIResource


    removeAll();
    if ((o != null) && (o.getClass().isArray())) {
      Class elementClass = o.getClass().getComponentType();   
      PropertyEditor editor = PropertyEditorManager.findEditor(elementClass);
      Component view = null;
      ListCellRenderer lcr = new DefaultListCellRenderer();
      if (editor != null) {
  if (editor instanceof GenericObjectEditor) {
    ((GenericObjectEditor) editor).setClassType(elementClass);
  }
View Full Code Here


        public void selectAll() {
          defaultEditor.selectAll();
        }
      });
    this.categoryComboBox.setRenderer(new DefaultListCellRenderer() {
        public Component getListCellRendererComponent(JList list, Object value, int index,
                                                      boolean isSelected, boolean cellHasFocus) {
          if (value == null) {
            value = " ";
          } else {
View Full Code Here

      }
    }
    mList = new SelectableItemList(selectedItems.toArray(), allItems);
    mList.addCenterRendererComponent(String.class,
        new SelectableItemRendererCenterComponentIf() {
          private DefaultListCellRenderer mRenderer = new DefaultListCellRenderer();

          @Override
          public void calculateSize(JList list, int index, JPanel contentPane) {
          }

          @Override
          public JPanel createCenterPanel(JList list, Object value, int index,
              boolean isSelected, boolean isEnabled,
              JScrollPane parentScrollPane, int leftColumnWidth) {
            DefaultListCellRenderer label = (DefaultListCellRenderer) mRenderer
                .getListCellRendererComponent(list, value, index, isSelected,
                    false);
            label.setIcon(ProgramInfoHelper.getInfoIcons()[index]);
            label.setHorizontalAlignment(SwingConstants.LEADING);
            label.setVerticalAlignment(SwingConstants.CENTER);
            label.setOpaque(false);

            JPanel panel = new JPanel(new BorderLayout());
            if (isSelected && isEnabled) {
              panel.setOpaque(true);
              panel.setForeground(list.getSelectionForeground());
View Full Code Here

  public FurnitureLanguageComboBox(final FurnitureLibrary library,
                                   final FurnitureLibraryUserPreferences  preferences,
                                   final FurnitureLanguageController controller) {
    super(LOCALES.toArray());
    setRenderer(new DefaultListCellRenderer() {
        private Font defaultFont;
        private Font supportedLanguageFont;
       
        @Override
        public Component getListCellRendererComponent(JList list,
View Full Code Here

    mSettingsPn.add(new JLabel(mLocalizer.msg("language", "Language:")), cc.xy(2,3));
    Locale[] allLocales = mLocalizer.getAllAvailableLocales();
    ArrayList<Locale> localesList = new ArrayList<Locale>(Arrays.asList(allLocales));
    mSettingsPn.add(mLanguageCB = new JComboBox(allLocales), cc.xy(4,3));

    mLanguageCB.setRenderer(new DefaultListCellRenderer() {
      @Override
      public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
        return super.getListCellRendererComponent(list, ((Locale)value).getDisplayName(), index, isSelected, cellHasFocus);
      }
    });
View Full Code Here

    CellConstraints cc = new CellConstraints();
   
    content.add(new JLabel(mLocalizer.msg("colorTheme", "Color-Theme") ":"), cc.xy(1,1));
   
    mColorScheme = new JComboBox(themes);
    mColorScheme.setRenderer(new DefaultListCellRenderer() {
      public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
        JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
        label.setText(((PlasticTheme)value).getName());
        return label;
      }
View Full Code Here

    IconPlugin[] allPluginArr = getAvailableIconPlugins();
    IconPlugin[] pluginOrderArr = getSelectedIconPlugins(allPluginArr);
    mIconPluginOCh = new OrderChooser(pluginOrderArr, allPluginArr, IconPlugin.class,
        new SelectableItemRendererCenterComponentIf() {
          private DefaultListCellRenderer mRenderer = new DefaultListCellRenderer();

          @Override
          public JPanel createCenterPanel(JList list, Object value, int index, boolean isSelected, boolean isEnabled,
              JScrollPane parentScrollPane, int leftColumnWidth) {
            DefaultListCellRenderer label = (DefaultListCellRenderer) mRenderer.getListCellRendererComponent(list,
                value, index, isSelected, false);
            IconPlugin iconPlugin = (IconPlugin) value;
            label.setIcon(iconPlugin.getIcon());
            label.setHorizontalAlignment(SwingConstants.LEADING);
            label.setVerticalAlignment(SwingConstants.CENTER);
            label.setOpaque(false);

            JPanel panel = new JPanel(new BorderLayout());
            if (isSelected && isEnabled) {
              panel.setOpaque(true);
              panel.setForeground(list.getSelectionForeground());
View Full Code Here

  public ComponentListCellRenderer(final Class aComponentType)
  {
    try
    {
      setLayout(new BorderLayout());
      defaultComp = new DefaultListCellRenderer();
      abstractButton = (AbstractButton) aComponentType.newInstance();
      add(abstractButton);
    }
    catch (Exception e)
    {
View Full Code Here

        for (DataFilter df : filters)
            comboFilters.addItem(df);
       
        comboCriteria.getEditor().getEditorComponent().addKeyListener(this);
        comboCriteria.getEditor().getEditorComponent().addMouseListener(this);
        comboCriteria.setRenderer(new DefaultListCellRenderer());
       
        comboFilters.addActionListener(this);
        comboFilters.setActionCommand("filterSelected");
       
        comboFields.addActionListener(this);
View Full Code Here

    JCheckBox checkbox;

    public CheckBoxListCellRenderer() {
      setLayout(new BorderLayout());
      defaultComp = new DefaultListCellRenderer();
      checkbox = new JCheckBox();
      add(defaultComp, BorderLayout.CENTER);
      add(checkbox, BorderLayout.EAST);
    }
View Full Code Here

TOP

Related Classes of javax.swing.DefaultListCellRenderer$UIResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.