Dne čtvrtek 20. května 2021 14:14:10 CEST, Rahul Khandelwal napsal(a):
> Hi All,
> 
> I am trying to add "compare with clipboard" functionality in netbeans.
> On a high level, this will do the following -
> 1. either compare clipboard text to opened file
> 2. or compare clipboard text to selected text in file.
> 
> I have got the functionality working in similar way as following tutorial -
> http://netbeans.apache.org/wiki/DevFaqEditorHowToAddDiffView.asciidoc
> 
> I have now the following questions -
> 1. Do we already have something similar to *EditableStreamSource*, which we
> can reuse?
> 2. How do I write unit tests for this functionality? At the very least I
> need to be able to mock FileObject, 

No need to create own mock, use one of existing: Like 
FileUtil.createMemoryFileSystem().

> Clipboard, 

There is 
https://bits.netbeans.org/12.0/javadoc/org-openide-util-ui/org/openide/util/
datatransfer/ExClipboard.html - its subclass NbClipboard is registered via 
@ServiceProvider and that could be mocked by MockServices.

-jt

> EditorRegistry and
> DiffController.
> 
> Please help me over here.
> 
> Thanks and regards,
> Rahul Khandelwal





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to