// 获取剪切板对象
private TCComponent[] getClipboardDatas() {
List<TCComponent> clipboardData = new ArrayList<TCComponent>();
// 获取剪切板内容
AIFClipboard aifclipboard = AIFPortal.getClipboard();
java.awt.datatransfer.Transferable transferable = aifclipboard.getContents(this);
List<InterfaceAIFComponent> list = null;
try {
list = (List) transferable
.getTransferData(new java.awt.datatransfer.DataFlavor(java.util.Vector.class, "AIF Vector"));
} catch (Exception e) {
e.printStackTrace();
}
if (list != null) {
for (InterfaceAIFComponent interfaceAIFComponent : list) {
if (interfaceAIFComponent instanceof TCComponentItem
|| interfaceAIFComponent instanceof TCComponentItemRevision) {
clipboardData.add((TCComponent) interfaceAIFComponent);
}
}
}
return clipboardData.toArray(new TCComponent[clipboardData.size()]);
}
TC10获取剪切板中对象
于 2023-04-06 16:52:26 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)