Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8337287: Update image in javax.swing.text.Document.insert #20376

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
28 changes: 14 additions & 14 deletions src/java.desktop/share/classes/javax/swing/text/Document.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -471,32 +471,32 @@ public interface Document {
public void remove(int offs, int len) throws BadLocationException;

/**
* Inserts a string of content. This will cause a DocumentEvent
* of type DocumentEvent.EventType.INSERT to be sent to the
* registered DocumentListeners, unless an exception is thrown.
* The DocumentEvent will be delivered by calling the
* insertUpdate method on the DocumentListener.
* The offset and length of the generated DocumentEvent
* will indicate what change was actually made to the Document.
* <p style="text-align:center"><img src="doc-files/Document-insert.gif"
* Inserts a string of content. This will cause a {@code DocumentEvent}
* of type {@code DocumentEvent.EventType.INSERT} to be sent to the
* registered {@code DocumentListener}s, unless an exception is thrown.
* The {@code DocumentEvent} will be delivered by calling the
* {@code insertUpdate} method on the {@code DocumentListener}.
* The offset and length of the generated {@code DocumentEvent}
* will indicate what change was actually made to the {@code Document}.
* <p style="text-align:center"><img src="doc-files/Document-insert.svg"
* alt="Diagram shows insertion of 'quick' in 'The quick brown fox'">
* <p>
* If the Document structure changed as result of the insertion,
* the details of what Elements were inserted and removed in
* If the {@code Document} structure changed as result of the insertion,
* the details of what {@code Element}s were inserted and removed in
* response to the change will also be contained in the generated
* DocumentEvent. It is up to the implementation of a Document
* {@code DocumentEvent}. It is up to the implementation of a {@code Document}
* to decide how the structure should change in response to an
* insertion.
* <p>
* If the Document supports undo/redo, an UndoableEditEvent will
* If the {@code Document} supports undo/redo, an {@code UndoableEditEvent} will
* also be generated.
*
* @param offset the offset into the document to insert the content &gt;= 0.
* All positions that track change at or after the given location
* will move.
* @param str the string to insert
* @param a the attributes to associate with the inserted
* content. This may be null if there are no attributes.
* content. This may be {@code null} if there are no attributes.
* @throws BadLocationException the given insert position is not a valid
* position within the document
* @see javax.swing.event.DocumentEvent
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.