2
* Copyright (C) 2006 Aelitis, All Rights Reserved.
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (at your option) any later version.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
* You should have received a copy of the GNU General Public License
13
* along with this program; if not, write to the Free Software
14
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
* AELITIS, SAS au capital de 63.529,40 euros
17
* 8 Allee Lenotre, La Grille Royale, 78600 Le Mesnil le Roi, France.
21
package com.aelitis.azureus.ui.swt.views.skin;
23
import org.gudy.azureus2.core3.internat.MessageText;
25
import com.aelitis.azureus.ui.swt.skin.*;
26
import com.aelitis.azureus.ui.swt.skin.SWTSkinButtonUtility.ButtonListenerAdapter;
27
import com.aelitis.azureus.ui.swt.views.TorrentListView;
28
import com.aelitis.azureus.ui.swt.views.TorrentListViewListener;
29
import com.aelitis.azureus.ui.swt.views.skin.sidebar.SideBar;
33
* @created Sep 30, 2006
35
* TODO Code similaries between MiniRecentList, MiniDownloadList, ManageCdList,
36
* and ManageDlList. Need to combine
38
public class MiniRecentList
41
private static String PREFIX = "minirecent-";
43
private TorrentListView view;
45
private SWTSkinObjectText skinHeaderText;
47
public Object skinObjectInitialShow(SWTSkinObject skinObject, Object params) {
48
final SWTSkin skin = skinObject.getSkin();
50
skinObject = skin.getSkinObject(PREFIX + "header-text");
51
if (skinObject instanceof SWTSkinObjectText) {
52
skinHeaderText = (SWTSkinObjectText) skinObject;
55
skinObject = skin.getSkinObject(PREFIX + "link");
56
if (skinObject instanceof SWTSkinObjectText) {
57
SWTSkinButtonUtility btn = new SWTSkinButtonUtility(skinObject);
58
btn.addSelectionListener(new ButtonListenerAdapter() {
59
public void pressed(SWTSkinButtonUtility buttonUtility, SWTSkinObject skinObject, int stateMask) {
60
SideBar sidebar = (SideBar)SkinViewManager.getByClass(SideBar.class);
61
if (sidebar != null) {
62
sidebar.showItemByID(SideBar.SIDEBAR_SECTION_LIBRARY);
68
view = new TorrentListView(this, PREFIX,
69
TorrentListView.VIEW_RECENT_DOWNLOADED, true, false);
71
if (skinHeaderText != null) {
72
view.addListener(new TorrentListViewListener() {
73
public void countChanged() {
74
skinHeaderText.setText(MessageText.getString(
75
"v3.MainWindow.recentDL", new String[] {