本文整理汇总了Java中org.gudy.azureus2.core3.download.DownloadManager.getDisplayName方法的典型用法代码示例。如果您正苦于以下问题:Java DownloadManager.getDisplayName方法的具体用法?Java DownloadManager.getDisplayName怎么用?Java DownloadManager.getDisplayName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.gudy.azureus2.core3.download.DownloadManager
的用法示例。
在下文中一共展示了DownloadManager.getDisplayName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: describe
import org.gudy.azureus2.core3.download.DownloadManager; //导入方法依赖的package包/类
static String describe(DownloadManager dm, ContextDescriptor cs) {
if (cs == null) {return describe(dm);}
if (dm == null) {
return "\"" + cs.getContext() + "\"";
}
return "\"" + dm.getDisplayName() + "\" with regard to \"" + cs.getContext() + "\"";
}
示例2: getContentTitle2
import org.gudy.azureus2.core3.download.DownloadManager; //导入方法依赖的package包/类
/**
* @param torrent
*
* @since 3.0.4.3
*/
public static String getContentTitle2(DownloadManager dm) {
if (dm == null) {
return null;
}
// DM state's display name can be set by user, so show that if we have it
String name = dm.getDownloadState().getDisplayName();
if (name == null || name.length() == 0) {
name = PlatformTorrentUtils.getContentTitle(dm.getTorrent());
if (name == null) {
name = dm.getDisplayName();
}
}
return name;
}
示例3: execute
import org.gudy.azureus2.core3.download.DownloadManager; //导入方法依赖的package包/类
public void execute(String commandName, ConsoleInput ci, List args) {
if( args.isEmpty() )
{
ci.out.println("> Missing subcommand for 'move'\r\n> move syntax: move <#from> [<#to>]");
return;
}
if (ci.torrents.isEmpty())
{
ci.out.println("> Command 'move': No torrents in list.");
return;
}
int ncommand;
int nmoveto = -1;
boolean moveto = false;
try {
ncommand = Integer.parseInt((String) args.get(0));
if (args.size() > 1) {
nmoveto = Integer.parseInt((String) args.get(1));
moveto = true;
}
} catch (NumberFormatException e) {
ci.out.println("> Command 'move': Subcommand '" + args.get(0) + "' unknown.");
return;
}
int number = Math.abs(ncommand);
if (number == 0 || number > ci.torrents.size()) {
ci.out.println("> Command 'move': Torrent #" + Integer.toString(number) + " unknown.");
return;
}
DownloadManager dm = (DownloadManager) ci.torrents.get(number - 1);
String name = dm.getDisplayName();
if (name == null)
name = "?";
GlobalManager gm = dm.getGlobalManager();
if (moveto) {
gm.moveTo(dm, nmoveto - 1);
gm.fixUpDownloadManagerPositions();
ci.out.println("> Torrent #" + Integer.toString(number) + " (" + name + ") moved to #" + Integer.toString(nmoveto) + ".");
} else if (ncommand > 0) {
if (gm.isMoveableUp(dm)) {
while (gm.isMoveableUp(dm))
gm.moveUp(dm);
gm.fixUpDownloadManagerPositions();
ci.out.println("> Torrent #" + Integer.toString(number) + " (" + name + ") moved to top.");
} else {
ci.out.println("> Torrent #" + Integer.toString(number) + " (" + name + ") already at top.");
}
} else {
if (gm.isMoveableDown(dm)) {
while (gm.isMoveableDown(dm))
gm.moveDown(dm);
gm.fixUpDownloadManagerPositions();
ci.out.println("> Torrent #" + Integer.toString(number) + " (" + name + ") moved to bottom.");
} else {
ci.out.println("> Torrent #" + Integer.toString(number) + " (" + name + ") already at bottom.");
}
}
}
示例4: describe
import org.gudy.azureus2.core3.download.DownloadManager; //导入方法依赖的package包/类
static String describe(DownloadManager dm) {
if (dm == null) {return "";}
return "\"" + dm.getDisplayName() + "\"";
}