Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions ide/editor/src/org/netbeans/modules/editor/EditorModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ public void run() {
if (topComponentRegistryListener != null) {
TopComponent.getRegistry().removePropertyChangeListener(topComponentRegistryListener);
}

// TODO AppContext and kitRegistryKey don't exist anymore in JDK 27+

// unregister our registry
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.awt.EventQueue;
import java.awt.Rectangle;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import static java.lang.Thread.NORM_PRIORITY;
import java.util.Map;
import java.util.WeakHashMap;
Expand Down Expand Up @@ -53,6 +52,7 @@
import org.openide.explorer.ExplorerManager;
import org.openide.filesystems.FileObject;
import org.openide.nodes.Node;
import org.openide.text.CloneableEditorSupport;
import org.openide.text.NbDocument;
import org.openide.util.NbBundle;
import org.openide.util.RequestProcessor;
Expand Down Expand Up @@ -450,8 +450,8 @@ public void setText(final String text,
* (in this case, MIME-type only) must be set _before_ the text
* is set.
*/
if ((editorMimeType == null) || !editorMimeType.equals(mimeType)) {
editorPane.setContentType(mimeType);
if (editorMimeType == null || !editorMimeType.equals(mimeType)) {
editorPane.setEditorKit(CloneableEditorSupport.getEditorKit(mimeType));
editorMimeType = mimeType;
}
editorPane.setText(text);
Expand Down Expand Up @@ -488,12 +488,8 @@ public void run() {

if (location != null) {
final Document document = editorPane.getDocument();
if (document instanceof StyledDocument) {
StyledDocument styledDocument
= (StyledDocument) document;
int cursorOffset = getCursorOffset(
(StyledDocument) document,
location.getLine() - 1);
if (document instanceof StyledDocument sd) {
int cursorOffset = getCursorOffset(sd, location.getLine() - 1);
int startOff = cursorOffset + location.getColumn() - 1;
int endOff = startOff + location.getMarkLength();
editorPane.setSelectionStart(startOff);
Expand Down
Loading