Search in sources :

Example 1 with ClipboardForm

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();
}
Also used : BinaryResource(org.eclipse.scout.rt.platform.resource.BinaryResource) ClipboardForm(org.eclipse.scout.rt.client.ui.form.clipboard.ClipboardForm)

Example 2 with ClipboardForm

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();
}
Also used : ClipboardForm(org.eclipse.scout.rt.client.ui.form.clipboard.ClipboardForm)

Aggregations

ClipboardForm (org.eclipse.scout.rt.client.ui.form.clipboard.ClipboardForm)2 BinaryResource (org.eclipse.scout.rt.platform.resource.BinaryResource)1