exbin / bined-netbeans-plugin

Hex viewer/editor plugin for NetBeans platform
https://bined.exbin.org/netbeans-plugin
Apache License 2.0
5 stars 1 forks source link

Exception on copy smth from the system #5

Closed Chris2011 closed 7 years ago

Chris2011 commented 8 years ago

I have a strange bug. I open chrome, select the address bar and hit ctrl + c (sometimes more than one times, to ensure, that I copied the text. Unfortunately netbeans give me this exception:

java.lang.IllegalStateException: cannot open system clipboard
    at sun.awt.windows.WClipboard.openClipboard(Native Method)
    at sun.awt.datatransfer.SunClipboard.getClipboardFormatsOpenClose(SunClipboard.java:327)
    at sun.awt.datatransfer.SunClipboard.isDataFlavorAvailable(SunClipboard.java:188)
    at org.exbin.deltahex.DefaultCodeAreaCommandHandler$1.flavorsChanged(DefaultCodeAreaCommandHandler.java:60)
    at sun.awt.datatransfer.SunClipboard$1SunFlavorChangeNotifier.run(SunClipboard.java:441)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
[catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

very strange, only happens inside the addressbar.

hajdam commented 8 years ago

Added ignoring for IllegalStateException with clipboard. You can test it here: http://deltahex.exbin.org/download.php?org-exbin-deltahex-netbeans.nbm

Chris2011 commented 8 years ago

Should be ok. Thx. :)

Chris2011 commented 7 years ago

It happens again, but I figured out when, only when I using the Windows Edge browser.

java.lang.IllegalStateException: cannot open system clipboard
    at sun.awt.windows.WClipboard.openClipboard(Native Method)
    at sun.awt.datatransfer.SunClipboard.getClipboardFormatsOpenClose(SunClipboard.java:327)
    at sun.awt.datatransfer.SunClipboard.isDataFlavorAvailable(SunClipboard.java:188)
    at org.exbin.deltahex.operation.CodeCommandHandler$1.flavorsChanged(CodeCommandHandler.java:98)
    at sun.awt.datatransfer.SunClipboard$1SunFlavorChangeNotifier.run(SunClipboard.java:441)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
[catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
hajdam commented 7 years ago

I tried to add more ignores. You can test it again here: http://deltahex.exbin.org/download.php?org-exbin-deltahex-netbeans.nbm

Chris2011 commented 7 years ago

I will test it thx, but why is the plugin listen to the copy/paste logic?

hajdam commented 7 years ago

Primary reason lies in deltahex editor, where it listens on changes of clipboard flavor to highlight if paste operation is available in toolbar. In netbeans plugin it's currently used only for context popup menu, but that might be called on menu creation, so maybe I could remove that...

hajdam commented 7 years ago

please increase your version number next time. I wanted to downloaded and installed it but it wasn't possible because I already have a version 0.1.4.

Versions of plugins in NetBeans seems to be a bit limited, therefore I cannot distinguish between release and development versions properly. Therefore I increase version only once after each release.

As you tried development version, to install release version with the same version number, you need to uninstall plugin first via Tools/Plugins - tab Installed - check Show details - search for deltahex - select plugin and hit uninstall. (Or faster way is to delete nbm file directly)

Chris2011 commented 7 years ago

Ok I understand that. thx.

Chris2011 commented 7 years ago

It seems fixed. thx for the work.

hajdam commented 7 years ago

I'll delete your comment on netbeans plugin page, as it's incorrect, I guess...