diff options
| author | 2014-07-31 22:27:26 -0400 | |
|---|---|---|
| committer | 2014-07-31 22:27:26 -0400 | |
| commit | faae0a6514c2565a10f9a62dd18c5d79fbbe4156 (patch) | |
| tree | 9369f3b920919dd4a4bb2aa449c3dc467d4a43ea /src/cuchaz/enigma/gui/ClassListCellRenderer.java | |
| parent | switched to line-by-line mergable, human-readable file format for mappings (diff) | |
| download | enigma-fork-faae0a6514c2565a10f9a62dd18c5d79fbbe4156.tar.gz enigma-fork-faae0a6514c2565a10f9a62dd18c5d79fbbe4156.tar.xz enigma-fork-faae0a6514c2565a10f9a62dd18c5d79fbbe4156.zip | |
fixed bug with save mappings menu
gui shows deobfuscated classes list now
working on name validation/sanitization
Diffstat (limited to 'src/cuchaz/enigma/gui/ClassListCellRenderer.java')
| -rw-r--r-- | src/cuchaz/enigma/gui/ClassListCellRenderer.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/cuchaz/enigma/gui/ClassListCellRenderer.java b/src/cuchaz/enigma/gui/ClassListCellRenderer.java new file mode 100644 index 0000000..302f140 --- /dev/null +++ b/src/cuchaz/enigma/gui/ClassListCellRenderer.java | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2014 Jeff Martin. | ||
| 3 | * All rights reserved. This program and the accompanying materials | ||
| 4 | * are made available under the terms of the GNU Public License v3.0 | ||
| 5 | * which accompanies this distribution, and is available at | ||
| 6 | * http://www.gnu.org/licenses/gpl.html | ||
| 7 | * | ||
| 8 | * Contributors: | ||
| 9 | * Jeff Martin - initial API and implementation | ||
| 10 | ******************************************************************************/ | ||
| 11 | package cuchaz.enigma.gui; | ||
| 12 | |||
| 13 | import java.awt.Component; | ||
| 14 | |||
| 15 | import javax.swing.DefaultListCellRenderer; | ||
| 16 | import javax.swing.JLabel; | ||
| 17 | import javax.swing.JList; | ||
| 18 | import javax.swing.ListCellRenderer; | ||
| 19 | |||
| 20 | import cuchaz.enigma.ClassFile; | ||
| 21 | |||
| 22 | public class ClassListCellRenderer implements ListCellRenderer<ClassFile> | ||
| 23 | { | ||
| 24 | private DefaultListCellRenderer m_defaultRenderer; | ||
| 25 | |||
| 26 | public ClassListCellRenderer( ) | ||
| 27 | { | ||
| 28 | m_defaultRenderer = new DefaultListCellRenderer(); | ||
| 29 | } | ||
| 30 | |||
| 31 | @Override | ||
| 32 | public Component getListCellRendererComponent( JList<? extends ClassFile> list, ClassFile classFile, int index, boolean isSelected, boolean hasFocus ) | ||
| 33 | { | ||
| 34 | JLabel label = (JLabel)m_defaultRenderer.getListCellRendererComponent( list, classFile, index, isSelected, hasFocus ); | ||
| 35 | |||
| 36 | label.setText( classFile.getName() ); | ||
| 37 | |||
| 38 | return label; | ||
| 39 | } | ||
| 40 | } | ||