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

GetNewsView bug fixed #139

Merged
merged 2 commits into from Nov 27, 2023
Merged

GetNewsView bug fixed #139

merged 2 commits into from Nov 27, 2023

Conversation

quiz3
Copy link
Collaborator

@quiz3 quiz3 commented Nov 27, 2023

Extraneous addition/rendering of too many articles bug fixed. Also, rendering improved for longer string values in the tables.

@quiz3 quiz3 linked an issue Nov 27, 2023 that may be closed by this pull request
Copy link
Collaborator

@gursi26 gursi26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested this locally and looks to be working. Great job.

Comment on lines +46 to +65
// Custom cell renderer to allow displaying a clipped preview of a larger String using tooltip
private static class ClippedPreviewTableCellRenderer extends DefaultTableCellRenderer {
private static final int MAX_PREVIEW_LENGTH = 60;

@Override
public Component getTableCellRendererComponent(
JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (value != null) {
String text = value.toString();
if (text.length() > MAX_PREVIEW_LENGTH) {
String previewText = text.substring(0, MAX_PREVIEW_LENGTH) + " ...";
setToolTipText("<html><p width='300'>" + text + "</p></html>");
setText(previewText);
}
}
return c;
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this code segment for?

@gursi26
Copy link
Collaborator

gursi26 commented Nov 27, 2023

Also, there are now conflicts due to recent merges, please fix those.

Copy link
Collaborator

@gursi26 gursi26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now

@gursi26 gursi26 merged commit ceb928e into main Nov 27, 2023
2 checks passed
@gursi26 gursi26 deleted the get-news-view-bug branch November 27, 2023 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GetNews view adds more articles when hitting search repeatedly
3 participants