Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions ide/editor/src/org/netbeans/modules/editor/EditorModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,18 @@ public void saveSetting(String settingName, Object value) {
initAndCheckEditorKitTypeRegistry("text/html", HTMLEditorKit.class.getName()); //NOI18N
initAndCheckEditorKitTypeRegistry("text/rtf", RTFEditorKit.class.getName()); //NOI18N
initAndCheckEditorKitTypeRegistry("application/rtf", RTFEditorKit.class.getName()); //NOI18N

// Now hook up to the JDK's editor kit registry
// XXX: This all should be removed, see IZ #80110
// TODO: This all should be removed, see IZ #80110 or #9523
if (!Boolean.parseBoolean(System.getProperty("nb.disable.editorkit.hack", "false" /*TODO true in future*/))) {
LOG.log(Level.WARNING,
"""
Setting content type by mime type String for NetBeans editor kits is no longer supported and will fail on JDK 27 and later, obtain the EditorKit instead:
jtextarea.setContentType("text/x-properties") =>
jtextarea.setEditorKit(CloneableEditorSupport.getEditorKit("text/x-properties"))
Set the sytem property 'nb.disable.editorkit.hack=true' to disable this warning.
"""
);
try {
Field keyField = JEditorPane.class.getDeclaredField("kitRegistryKey"); // NOI18N
keyField.setAccessible(true);
Expand All @@ -166,21 +175,10 @@ public void saveSetting(String settingName, Object value) {
// Hashtable kitMapping = (Hashtable)sun.awt.AppContext.getAppContext().get(key);
// sun.awt.AppContext.getAppContext().put(key, new HackMap(kitMapping));
} catch (Throwable t) {
if (debug) {
LOG.log(Level.WARNING, "Can't hack in to the JEditorPane's registry for kits.", t);
} else {
LOG.log(Level.WARNING, "Can''t hack in to the JEditorPane''s registry for kits: {0}", new Object[] {t});
}
LOG.log(Level.WARNING, "Can't hack in to the JEditorPane's registry to replace editor kits.");
}

// Registration of the editor kits to JEditorPane
// for (int i = 0; i < replacements.length; i++) {
// JEditorPane.registerEditorKitForContentType(
// replacements[i].contentType,
// replacements[i].newKitClassName,
// getClass().getClassLoader()
// );
// }
}
// removeme end

// ------------------------------------------------------------

Expand Down
Loading