You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
A class cast exception happens when a user cut/copy the text contains in a RTextArea (-> not the syntax text one):
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: class org.monflabs.devtoolbox.swing.components.TextArea cannot be cast to class org.fife.ui.rsyntaxtextarea.RSyntaxTextArea (org.monflabs.devtoolbox.swing.components.TextArea and org.fife.ui.rsyntaxtextarea.RSyntaxTextArea are in unnamed module of loader 'app')
at org.fife.ui.rsyntaxtextarea.RSyntaxTextAreaEditorKit$CopyCutAsStyledTextAction.actionPerformedImpl(RSyntaxTextAreaEditorKit.java:684)
at org.fife.ui.rtextarea.RecordableTextAction.actionPerformed(RecordableTextAction.java:106)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
It happens in this statement: ((RSyntaxTextArea)textArea).copyAsStyledText(theme);
When I look at the editor kit assigned to the RTextArea, it is of class org.fife.ui.rtextarea.RTextAreaEditorKit, so I'm not sure how it delegates to RSyntaxTextAreaEditorKit
Steps to Reproduce
Create an application with both a RTextArea and a RSyntaxTextArea. In the former, display the popup menu and select 'copy' or 'cut'
Expected behavior
Test should be properly copied
Actual behavior
Text is not copied and an exception is thrown
Java version
17
The text was updated successfully, but these errors were encountered:
This should be fixed in a more robust way, but fixing this in the simplest way possible for now. The actual issue is how how RTextArea and RSyntaxTextArea instances share the actions displayed in their context menus, which means if you mix both components in an application, they'll both get the RSTA actions.
Description
A class cast exception happens when a user cut/copy the text contains in a
RTextArea
(-> not the syntax text one):It happens in this statement:
((RSyntaxTextArea)textArea).copyAsStyledText(theme);
When I look at the editor kit assigned to the RTextArea, it is of class
org.fife.ui.rtextarea.RTextAreaEditorKit
, so I'm not sure how it delegates toRSyntaxTextAreaEditorKit
Steps to Reproduce
Create an application with both a RTextArea and a RSyntaxTextArea. In the former, display the popup menu and select 'copy' or 'cut'
Expected behavior
Test should be properly copied
Actual behavior
Text is not copied and an exception is thrown
Java version
17
The text was updated successfully, but these errors were encountered: