Gridarta Editor
FolderListCellRenderer.java
Go to the documentation of this file.
1 /*
2  * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games.
3  * Copyright (C) 2000-2023 The Gridarta Developers.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 package net.sf.gridarta.gui.panel.archetypechooser;
21 
22 import java.awt.Component;
23 import javax.swing.DefaultListCellRenderer;
24 import javax.swing.JList;
26 
32 public class FolderListCellRenderer extends DefaultListCellRenderer {
33 
37  private static final long serialVersionUID = 1L;
38 
39  @Override
40  public Component getListCellRendererComponent(final JList<?> list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) {
42  super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
43  setText(folder == null ? "" : folder.getName());
44  return this;
45  }
46 
47 }
net.sf.gridarta
Base package of all Gridarta classes.
net.sf.gridarta.model.archetypechooser
Definition: ArchetypeChooserFolder.java:20
net.sf
net.sf.gridarta.gui.panel.archetypechooser.FolderListCellRenderer.serialVersionUID
static final long serialVersionUID
The serial version UID.
Definition: FolderListCellRenderer.java:37
net.sf.gridarta.gui.panel.archetypechooser.FolderListCellRenderer.getListCellRendererComponent
Component getListCellRendererComponent(final JList<?> list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus)
Definition: FolderListCellRenderer.java:40
net.sf.gridarta.model.archetypechooser.ArchetypeChooserFolder
A named folder within the ArchetypeChooserModel.
Definition: ArchetypeChooserFolder.java:40
net
net.sf.gridarta.gui.panel.archetypechooser.FolderListCellRenderer
A DefaultListCellRenderer for rendering {} instances.
Definition: FolderListCellRenderer.java:32
list
This document describes some hints and requirements for general development on the CrossfireEditor If you plan to make changes to the editor code or setup please read the following and keep it in derived from a basic editor application called Gridder by Pasi Ker�nen so please communicate with best through the cf devel mailing list
Definition: Developer_README.txt:13
net.sf.gridarta.model
net.sf.gridarta.model.archetypechooser.ArchetypeChooserFolder.getName
String getName()
Returns the folder name.
Definition: ArchetypeChooserFolder.java:101