📄 commenticonitem.java
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: CommentIconItem.java
package org.gudy.azureus2.ui.swt.views.tableitems.mytorrents;
import com.aelitis.azureus.ui.swt.imageloader.ImageLoader;
import org.gudy.azureus2.core3.download.DownloadManager;
import org.gudy.azureus2.core3.download.DownloadManagerState;
import org.gudy.azureus2.plugins.download.Download;
import org.gudy.azureus2.plugins.ui.tables.*;
import org.gudy.azureus2.ui.swt.TorrentUtil;
import org.gudy.azureus2.ui.swt.plugins.UISWTGraphic;
import org.gudy.azureus2.ui.swt.pluginsimpl.UISWTGraphicImpl;
import org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn;
public class CommentIconItem extends CoreTableColumn
implements TableCellRefreshListener, TableCellMouseListener
{
public static final Class DATASOURCE_TYPE = org/gudy/azureus2/plugins/download/Download;
static final UISWTGraphic graphicComment = new UISWTGraphicImpl(ImageLoader.getInstance().getImage("comment"));
static final UISWTGraphic noGraphicComment = new UISWTGraphicImpl(ImageLoader.getInstance().getImage("no_comment"));
public static final String COLUMN_ID = "commenticon";
public void fillTableColumnInfo(TableColumnInfo info)
{
info.addCategories(new String[] {
"content"
});
}
public CommentIconItem(String sTableID)
{
super(DATASOURCE_TYPE, "commenticon", -2, 20, sTableID);
setRefreshInterval(-2);
initializeAsGraphic(-2, 20);
setMinWidth(20);
}
public void cellMouseTrigger(TableCellMouseEvent event)
{
DownloadManager dm = (DownloadManager)event.cell.getDataSource();
if (dm == null)
return;
if (event.eventType != 1)
return;
if (event.button != 1)
{
return;
} else
{
event.skipCoreFunctionality = true;
TorrentUtil.promptUserForComment(new DownloadManager[] {
dm
});
refresh(event.cell);
return;
}
}
public void refresh(TableCell cell)
{
if (cell.isDisposed())
return;
DownloadManager dm = (DownloadManager)cell.getDataSource();
String comment = null;
if (dm != null)
{
comment = dm.getDownloadState().getUserComment();
if (comment != null && comment.length() == 0)
comment = null;
}
org.gudy.azureus2.plugins.ui.Graphic oldGraphic = cell.getGraphic();
if (comment == null && oldGraphic != noGraphicComment)
{
cell.setGraphic(noGraphicComment);
cell.setToolTip(null);
cell.setSortValue(null);
} else
if (comment != null && oldGraphic != graphicComment)
{
cell.setGraphic(graphicComment);
cell.setToolTip(comment);
cell.setSortValue(comment);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -