• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java HTMLTransfer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.swt.dnd.HTMLTransfer的典型用法代码示例。如果您正苦于以下问题:Java HTMLTransfer类的具体用法?Java HTMLTransfer怎么用?Java HTMLTransfer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



HTMLTransfer类属于org.eclipse.swt.dnd包,在下文中一共展示了HTMLTransfer类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getTransferType

import org.eclipse.swt.dnd.HTMLTransfer; //导入依赖的package包/类
Transfer getTransferType(String mime) {
    if (mime.equals("text/plain")) {
      return TextTransfer.getInstance();
    }
    if (mime.equals("text/rtf")) {
      return RTFTransfer.getInstance();
    }
    if (mime.equals("text/html")) {
      return HTMLTransfer.getInstance();
    }
    if (mime.equals("text/uri-list")) {
      return URLTransfer.getInstance();
    }
    if (mime.equals("application/x-java-rawimage")) {
      return ImageTransfer.getInstance();
    }
    if (mime.equals("application/x-java-file-list") || mime.equals("java.file-list")) {
        return FileTransfer.getInstance();
    }
    return getCustomTransfer(mime);
}
 
开发者ID:TRUEJASONFANS,项目名称:JavaFX-FrameRateMeter,代码行数:22,代码来源:OldFXCanvas.java


示例2: getMime

import org.eclipse.swt.dnd.HTMLTransfer; //导入依赖的package包/类
String getMime(Transfer transfer) {
    if (transfer.equals(TextTransfer.getInstance())) {
      return "text/plain";
    }
    if (transfer.equals(RTFTransfer.getInstance())) {
      return "text/rtf";
    } ;
    if (transfer.equals( HTMLTransfer.getInstance())) {
      return "text/html";
    }
    if (transfer.equals(URLTransfer.getInstance())) {
      return "text/uri-list";
    }
    if (transfer.equals( ImageTransfer.getInstance())) {
      return "application/x-java-rawimage";
    }
    if (transfer.equals(FileTransfer.getInstance())) {
      return "application/x-java-file-list";
    }
    if (transfer instanceof CustomTransfer) {
      return ((CustomTransfer)transfer).getMime();
    }
    return null;
}
 
开发者ID:TRUEJASONFANS,项目名称:JavaFX-FrameRateMeter,代码行数:25,代码来源:OldFXCanvas.java


示例3: copyTaskAsHTML

import org.eclipse.swt.dnd.HTMLTransfer; //导入依赖的package包/类
public void copyTaskAsHTML(ITask task) {
	StringBuilder sb = new StringBuilder();
	String taskKey = task.getTaskId();
	if (taskKey != null) {
		sb.append("<a href=\"" + task.getUrl() + "\">");
		sb.append(taskKey);
		sb.append("</a>");
		sb.append(": ");
	}
	sb.append(task.getSummary());
	HTMLTransfer textTransfer = HTMLTransfer.getInstance();
	TextTransfer tt = TextTransfer.getInstance();
	Clipboard clipboard = new Clipboard(Display.getCurrent());
	clipboard.setContents(new String[] { sb.toString(), sb.toString() }, new Transfer[] { textTransfer, tt });
	clipboard.dispose();
}
 
开发者ID:turesheim,项目名称:eclipse-timekeeper,代码行数:17,代码来源:CopyTaskDetailsToHTML.java


示例4: getTransferTypes

import org.eclipse.swt.dnd.HTMLTransfer; //导入依赖的package包/类
/**
 * Get transferTypes, if null, create them
 *
 * @return
 */
private Transfer[] getTransferTypes() {
    if (transferTypes == null) {
        transferTypes = new Transfer[] {
            TextTransfer.getInstance(),
            HTMLTransfer.getInstance()
        };
    }

    return transferTypes;
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:16,代码来源:ShelvesetDetailsDialog.java


示例5: copyToClipboard

import org.eclipse.swt.dnd.HTMLTransfer; //导入依赖的package包/类
public static void copyToClipboard(String html) {
	if (html == null || html.length() == 0)
		return;
	html = html.replace("<table", "<table border=\"1\"");
	Clipboard clipboard = new Clipboard(Display.getCurrent());
	TextTransfer textTransfer = TextTransfer.getInstance();
	HTMLTransfer htmlTransfer = HTMLTransfer.getInstance();
	Transfer[] transfers = new Transfer[] {textTransfer, htmlTransfer};
	Object[] data = new Object[] {html, html};
	clipboard.setContents(data, transfers);
	clipboard.dispose();	
}
 
开发者ID:DaveVoorhis,项目名称:Rel,代码行数:13,代码来源:BrowserManager.java


示例6: isThereSomethingToPaste

import org.eclipse.swt.dnd.HTMLTransfer; //导入依赖的package包/类
private boolean isThereSomethingToPaste() {
	Clipboard clipboard = new Clipboard(Display.getCurrent());
	try {
		TextTransfer textTransfer = TextTransfer.getInstance();
		HTMLTransfer htmlTransfer = HTMLTransfer.getInstance();
		String textData = (String)clipboard.getContents(textTransfer);
		String htmlData = (String)clipboard.getContents(htmlTransfer);
		return (textData != null && textData.length() > 0) || (htmlData != null && htmlData.length() > 0);
	} finally {
		clipboard.dispose();	
	}
}
 
开发者ID:DaveVoorhis,项目名称:Rel,代码行数:13,代码来源:Paste.java


示例7: execute

import org.eclipse.swt.dnd.HTMLTransfer; //导入依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
	if (activePart instanceof WorkWeekView) {
		LocalDate firstDayOfWeek = ((WorkWeekView) activePart).getFirstDayOfWeek();
		HTMLExporter export = new HTMLExporter();
		String result = export.getData(firstDayOfWeek);
		HTMLTransfer textTransfer = HTMLTransfer.getInstance();
		TextTransfer tt = TextTransfer.getInstance();
		Clipboard clipboard = new Clipboard(Display.getCurrent());
		clipboard.setContents(new String[] { result, result }, new Transfer[] { textTransfer, tt });
		clipboard.dispose();
	}
	return null;
}
 
开发者ID:turesheim,项目名称:eclipse-timekeeper,代码行数:16,代码来源:HTMLToClipboardHandler.java


示例8: getTransferType

import org.eclipse.swt.dnd.HTMLTransfer; //导入依赖的package包/类
Transfer getTransferType(String mime) {
    if (mime.equals("text/plain")) return TextTransfer.getInstance();
    if (mime.equals("text/rtf")) return RTFTransfer.getInstance();
    if (mime.equals("text/html")) return HTMLTransfer.getInstance();
    if (mime.equals("text/uri-list")) return URLTransfer.getInstance();
    if (mime.equals("application/x-java-rawimage")) return ImageTransfer.getInstance();
    if (mime.equals("application/x-java-file-list") || mime.equals("java.file-list")) {
        return FileTransfer.getInstance();
    }
    return getCustomTransfer(mime);
}
 
开发者ID:SkyLandTW,项目名称:JXTN,代码行数:12,代码来源:FXCanvas.java


示例9: getMime

import org.eclipse.swt.dnd.HTMLTransfer; //导入依赖的package包/类
String getMime(Transfer transfer) {
    if (transfer.equals(TextTransfer.getInstance())) return "text/plain";
    if (transfer.equals(RTFTransfer.getInstance())) return "text/rtf"; ;
    if (transfer.equals( HTMLTransfer.getInstance())) return "text/html";
    if (transfer.equals(URLTransfer.getInstance())) return "text/uri-list";
    if (transfer.equals( ImageTransfer.getInstance())) return "application/x-java-rawimage";
    if (transfer.equals(FileTransfer.getInstance())) return "application/x-java-file-list";
    if (transfer instanceof CustomTransfer) return ((CustomTransfer)transfer).getMime();
    return null;
}
 
开发者ID:SkyLandTW,项目名称:JXTN,代码行数:11,代码来源:FXCanvas.java


示例10: pasteClipboard

import org.eclipse.swt.dnd.HTMLTransfer; //导入依赖的package包/类
private void pasteClipboard( )
{
	Clipboard cb = new Clipboard( Display.getCurrent( ) );
	// TransferData[] types = cb.getAvailableTypes( );
	RTFTransfer rtfTransfer = RTFTransfer.getInstance( );
	Object contents = cb.getContents( rtfTransfer );
	// textEditor.paste( );
	if ( contents != null )
	{
		RTFHTMLHandler handler = new RTFHTMLHandler( );
		try
		{
			RTFParser.parse( contents.toString( ), handler );
			textEditor.insert( handler.toHTML( ) );
			return;
		}
		catch ( Exception e1 )
		{
		}
	}
	else
	{
		HTMLTransfer htmlTransfer = HTMLTransfer.getInstance( );
		contents = cb.getContents( htmlTransfer );
		if ( contents != null )
		{
			textEditor.insert( contents.toString( ) );
			return;
		}
	}

	TextTransfer plainTextTransfer = TextTransfer.getInstance( );
	String text = (String) cb.getContents( plainTextTransfer, DND.CLIPBOARD );
	textEditor.insert( text );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:36,代码来源:TextEditor.java


示例11: getTransfer

import org.eclipse.swt.dnd.HTMLTransfer; //导入依赖的package包/类
@Override
public Transfer getTransfer() {
	return HTMLTransfer.getInstance(); 
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:5,代码来源:HTMLTransferProvider.java



注:本文中的org.eclipse.swt.dnd.HTMLTransfer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Message类代码示例发布时间:2022-05-22
下一篇:
Java SetBalancerBandwidthRequestProto类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap