-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
6465404: some problems in CellEditor related API docs #6608
Conversation
/covered |
Hi @TejeshR13, welcome to this OpenJDK project and thanks for contributing! We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user TejeshR13" as summary for the issue. If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing |
Thank you! Please allow for a few business days to verify that your employer has signed the OCA. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated! |
@TejeshR13 The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
|
@TejeshR13 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 736 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@prsadhuk, @aivanov-jdk, @azuev-java, @mrserb, @prrace) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also update the copyright year.
* an editor of values for the component <code>JTable</code> that | ||
* needs to implement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* an editor of values for the component <code>JTable</code> that | |
* needs to implement. | |
* an editor of values for the {@code JTable} component needs to implement. |
‘that’ after JTable
shouldn't be there.
However, I would suggest rephrasing the Javadoc to make it easier to understand: the sentence has two levels of dependent clauses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this fix is going in the right direction. Isn't the doc saying that if you want to use one of these components as the cell of a JTable it should implement this interface ?
And the problem with JListBox is that it is actually just called JList ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I read it, the interface TableCellEditor
adds the getTableCellEditorComponent
method to the generic CellEditor
interface.
There's also TreeCellEditor
interface which adds getTreeCellEditorComponent
specifically for JTree
. This one has a cleaner Javadoc:
Adds to CellEditor the extensions necessary to configure an editor in a tree.
The TableCellEditor
interface should say something similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the Javadoc says, “…that would like to be an editor of values for components such as JListBox, JComboBox, JTree, or JTable…” Yet the interface adds a method which is relevant for JTable
only. JList
has no cell editor. JComboBox
uses its own ComboBoxEditor
interface, and JTree
uses TreeCellEditor
.
So, I think we're in the right direction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, update the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After going on through the example, what I felt is "Adds to CellEditor the extensions necessary to configure an editor in a tree" is little generic description than the updated PR Definition.
The interface is generic, so the generic description fits well.
I still find the proposed version quite hard to parse. In my first comment, I suggested rephrasing the Javadoc to make it clearer and easier to understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, they don't. At the same time
TableCellEditor
interface can't be used to return a cell editor forJComboBox
and forJTree
components. These components useComboBoxEditor
andTreeCellEditor
correspondingly.
Right the TableCellEditor should not be used as a JComboBox/JTree editor, it is only for JTable. But the objects implemented TableCellEditor interface can be used to modify the values stored as the JComboBox/JTree when the user edits the cell of the table. So the user selects the cell -> the TableCellEditor is activated for editing that cell -> if the data for the cell may be stored as a list then the JComboBox could be shown -> the user may change/edit the current value of the cell using JComboBox and its values? And the list of components in the spec is just an example of what components can be used by the TableCellEditor.
At least this is how I read it, might be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it probably referred to components which can be used as an editor. DefaultEditorCell
supports three components: JCheckBox
, JComboBox
, and JTextField
.
But the objects implemented TableCellEditor interface can be used to modify the values stored as the JComboBox/JTree when the user edits the cell of the table.
And this just adds to the confusion rather than clarifies the purpose of the interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, the CellEditor
interface describes how the interface can be used for JTable
and JTree
and gives JTextField
, JCheckBox
, JComboBox
as the examples of specific editors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I have updated the PR as per latest discussions and Input, any other suggestions or Inputs......?
@azuev-java please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also expand the wildcard import at line 30:
import javax.swing.*;
to a specific class import. In fact, this interface imports only JTable
with the wildcard since CellEditor
is already imported explicitly.
/reviewers 2 |
@aivanov-jdk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also update the copyright year to 2021.
@aivanov-jdk , updated the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
The only question left: Do we keep the Javadoc as it is, or do we update it to be similar to TreeCellEditor
?
src/java.desktop/share/classes/javax/swing/table/TableCellEditor.java
Outdated
Show resolved
Hide resolved
/CSR |
@TejeshR13 has indicated that a compatibility and specification (CSR) request is needed for this pull request. |
* an editor of values for components such as <code>JListBox</code>, | ||
* <code>JComboBox</code>, <code>JTree</code>, or <code>JTable</code> | ||
* needs to implement. | ||
* an editor of values for the {@code JTable} component needs to implement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"This interface must be implemented to provide an editor of cell values for a {@code JTable}" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clear and to the point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it makes sense to update the Javadoc for TreeCellEditor
for consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this description is clear and to the point. Will updated the PR.
Should we add |
I don't think that is necessary. We are in JTable documentation already. |
I don't see the CSR yet. Create it from the "More" menu of the JBS issue. |
Yes, CSR is created from JBS.. |
@TejeshR13 usage: |
Please Review the csr https://bugs.openjdk.java.net/browse/JDK-8279421 |
/integrate |
@TejeshR13 |
/sponsor |
Going to push as commit 44fe958.
Your commit was automatically rebased without conflicts. |
@prsadhuk @TejeshR13 Pushed as commit 44fe958. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
JListBox is invalid component. CellTableEditor Interface doesn't support JComboBox and JTree components. Hence its removed from Documentation.
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6608/head:pull/6608
$ git checkout pull/6608
Update a local copy of the PR:
$ git checkout pull/6608
$ git pull https://git.openjdk.java.net/jdk pull/6608/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 6608
View PR using the GUI difftool:
$ git pr show -t 6608
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6608.diff