-
Notifications
You must be signed in to change notification settings - Fork 14
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
AttributeTable : non-editable cells are now selectable #131
Conversation
// layer.getFeatureCollectionWrapper().getFeatureSchema(); | ||
// if (schema.isAttributeReadOnly(schema.getAttributeIndex(getColumn( | ||
// columnIndex).getName()))) | ||
// return false; |
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.
does attribute is readonly not work? why did you comment this?
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.
It works, but to make selection possible, I now always use a cellEditor. Once cellEditor is activated, we still can disable edition for readonly-attributes (done in prepareEditor method). I did not find an easier path as cellRenderer is not selectable.
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.
let me rephrase. why is this still there but commented so it does not do anything?
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 will remove the comments
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 sometimes leave commented code but prefix it with a comment that it is some reference of how to do something alternatively or such
but if it really is just old/redundant please remove :)
} | ||
// if (!layer.isEditable()) { | ||
// return false; | ||
// } |
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.
same as below
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.
what about this?
tried the changeset but fail to see the difference in behaviour. could you please explain in more detail what this solves? with and without this patch i can select rows in attribute table and copy the contents, regardless if the layer is editable or not. |
b1cbd61
to
37d26c3
Compare
Yes, Jukka got it. Before the change, if you wanted to copy paste a single value from the attribute table of a non editable layer to your favorite text editor, you could not. Now, you can. |
|
ok, then some sub-selection decoration as mentioned in 1. is clearly not needed. wondering how intuitive this is tough. a possibility to select single cells and rows and columns by select the table headers would be more in line what a user would expect or? |
Thank you for the complete review Jukka. |
@jratike80 sounds like you are pretty satisfied with the status quo? wrt. this patch i approve. @mukoki feel free to squash/merge it :) |
Yes, I am satisfied with this PR. |
@jratike80 nope, i mean with the selection capabilities in general as of now in the Atrribut Table. or do you miss something crucial? |
Original request
User request was to be able to copy/paste attribute value from AttributeTable, in the case of not editable layers.
Use TableCellEditor instead of TableCellRenderer
I could not make cell values selectable from the TableCellRenderer. Hence, to make selection/copy/paste possible TableCellEditor is now used in both cases of editable and non-editable layers.
To prevent edit operation in the non-editable layer case, the editable component is finalized (made editable or not) during the preparation phase of the component (prepareEditor).
Other improvements
Small improvements in the cell rendering (do not truncate letters anymore in edition mode) and in the popupmenu used to manage null values.