### Eclipse Workspace Patch 1.0
#P org.sophie2.main.app.layout
|
|
|
35 | 35 | */ |
36 | 36 | @SkinElementId("main.view.layout.books.open-books-palette") |
37 | 37 | public class OpenBooksPalette extends ListPalette<OpenBooksPalette.BookItem> { |
38 | | |
| 38 | private static final int MAX_LABLE_SIZE = 20; |
39 | 39 | private Map<BookDocView, BookItem> itemsCache = new HashMap<BookDocView, BookItem>(); |
40 | 40 | |
41 | 41 | @Override |
… |
… |
|
168 | 168 | |
169 | 169 | JPanel centerPanel = new JPanel(); |
170 | 170 | centerPanel.setLayout(new BoxLayout(centerPanel, BoxLayout.Y_AXIS)); |
171 | | |
172 | | JLabel bookTitle = new JLabel(documentWindow().get().title().get()); |
| 171 | String bookName = documentWindow().get().title().get(); |
| 172 | JLabel bookTitle = null; |
| 173 | |
| 174 | if(bookName.length() >= MAX_LABLE_SIZE) { |
| 175 | bookTitle = new JLabel(bookName.substring(0, MAX_LABLE_SIZE - 3)+"..."); |
| 176 | } else { |
| 177 | bookTitle = new JLabel(bookName); |
| 178 | } |
173 | 179 | bookTitle.setAlignmentX(Component.CENTER_ALIGNMENT); |
174 | 180 | |
175 | 181 | this.thumbnail.setPreferredSize(new Dimension(82, 64)); |