Revision 46301 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/gui/projectpanel/ProjectDocumentsPanelPage.java
ProjectDocumentsPanelPage.java | ||
---|---|---|
1 | 1 |
package org.gvsig.app.project.documents.gui.projectpanel; |
2 | 2 |
|
3 | 3 |
import java.awt.BorderLayout; |
4 |
import java.awt.Component; |
|
4 | 5 |
import org.gvsig.app.project.documents.gui.*; |
5 | 6 |
import java.awt.Dimension; |
6 | 7 |
import java.awt.FlowLayout; |
... | ... | |
18 | 19 |
import java.util.Iterator; |
19 | 20 |
import java.util.List; |
20 | 21 |
import javax.swing.ButtonGroup; |
22 |
import javax.swing.DefaultListCellRenderer; |
|
21 | 23 |
import javax.swing.JComponent; |
22 | 24 |
import javax.swing.JLabel; |
23 | 25 |
import javax.swing.JList; |
... | ... | |
30 | 32 |
import javax.swing.event.ListSelectionEvent; |
31 | 33 |
import javax.swing.event.ListSelectionListener; |
32 | 34 |
import org.apache.commons.lang3.StringUtils; |
35 |
import org.gvsig.andami.IconThemeHelper; |
|
33 | 36 |
import org.gvsig.andami.PluginServices; |
34 | 37 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
35 | 38 |
import org.gvsig.andami.ui.mdiManager.MDIManager; |
... | ... | |
170 | 173 |
} |
171 | 174 |
} |
172 | 175 |
}); |
176 |
|
|
177 |
this.lstDocuments.setCellRenderer(new DefaultListCellRenderer(){ |
|
178 |
@Override |
|
179 |
public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { |
|
180 |
JLabel c = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); |
|
181 |
c.setIcon(null); |
|
182 |
if(value instanceof Document){ |
|
183 |
Document doc = (Document) value; |
|
184 |
if(((Document) value).isTemporary()){ |
|
185 |
c.setIcon(IconThemeHelper.getImageIcon("temporary-table-icon")); |
|
186 |
} |
|
187 |
} |
|
188 |
return c; |
|
189 |
} |
|
190 |
}); |
|
173 | 191 |
this.translate(); |
174 | 192 |
} |
175 | 193 |
|
Also available in: Unified diff