use of org.eclipse.scout.rt.client.ui.form.clipboard.ClipboardForm in project scout.rt by eclipse.
the class HtmlScoutClipboardService method setTextContents.
@Override
public void setTextContents(String textContents) {
ClipboardForm form = new ClipboardForm();
form.setMimeTypes(MimeType.TXT);
// anonymous text paste, no filename
BinaryResource binaryResource = BinaryResources.create().withContentType(MimeType.TXT.getType()).withContent(StringUtility.emptyIfNull(textContents)).build();
form.getClipboardField().setValue(Collections.singleton(binaryResource));
execInitClipboardForm(form);
form.startCopy();
}
use of org.eclipse.scout.rt.client.ui.form.clipboard.ClipboardForm in project scout.rt by eclipse.
the class HtmlScoutClipboardService method getClipboardContents.
@Override
public Collection<BinaryResource> getClipboardContents(MimeType... mimeTypes) {
ClipboardForm form = new ClipboardForm();
form.setMimeTypes(mimeTypes);
execInitClipboardForm(form);
form.startPaste();
form.waitFor();
if (form.isFormStored()) {
return form.getClipboardField().getValue();
}
return Collections.emptyList();
}
Aggregations