void () { Cursor customCursor = getCustomCursor(); if (customCursor == null && myCursorSetExternally && myEditorComponent.isCursorSet()) { Cursor cursor = myEditorComponent.getCursor(); if (cursor != Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR) && cursor != Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR) && cursor != EMPTY_CURSOR && (!SystemInfo.isMac || cursor != MacUIUtil.getInvertedTextCursor())) { // someone else has set cursor, don't touch it return; } } UIUtil.setCursor(myEditorComponent, customCursor == null ? myDefaultCursor : customCursor); myCursorSetExternally = false; }