ui_data: move newsfeed image to the top 96/17796/1
Simon Marchetto [Wed, 10 Feb 2016 09:11:45 +0000 (10:11 +0100)]
Change-Id: I328a9a08bc02a31d137d56244017f91d62004585

scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/newsfeed/NewsFeedWidget.java

index 7a3d093..9ae8a60 100644 (file)
@@ -134,24 +134,20 @@ public class NewsFeedWidget extends JPanel implements NewsFeedEventListener, Hyp
     private void displayNews(News news) {\r
         StringBuilder newsHtmlBuilder = new StringBuilder();\r
 \r
+        // Add media content (image) if exist\r
+        NewsMediaContent mediaContent = news.getMediaContent();\r
+        if (mediaContent != null) {\r
+            newsHtmlBuilder.append(getDivHtml(getImageHtml(mediaContent.getURL(), mediaContent.getWidth(), mediaContent.getHeight()), NEWS_MEDIA_CONTENT_HTML_ID));\r
+        }\r
+\r
         if (news.getContent() != null) {\r
             // if given, use RSS item content\r
             newsHtmlBuilder.append(getDivHtml(news.getContent(), NEWS_CONTENT_HTML_ID));\r
         } else {\r
-            // otherwise get content : date, description\r
-            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE dd MMM yyyy HH:mm");\r
-            String dateStr = simpleDateFormat.format(news.getDate());\r
-            String newsDateHtml = getSpanHtml(dateStr, NEWS_DATE_HTML_ID);\r
-            newsHtmlBuilder.append(getDivHtml(newsDateHtml));\r
+            // otherwise get content from description\r
             newsHtmlBuilder.append(getDivHtml(news.getDescription(), NEWS_DESCRIPTION_HTML_ID));\r
         }\r
 \r
-        // Add media content (image) if exist\r
-        NewsMediaContent mediaContent = news.getMediaContent();\r
-        if (mediaContent != null) {\r
-            newsHtmlBuilder.append(getDivHtml(getImageHtml(mediaContent.getURL(), mediaContent.getWidth(), mediaContent.getHeight()), NEWS_MEDIA_CONTENT_HTML_ID));\r
-        }\r
-\r
         // Add news link if exist\r
         if (news.getLink() != null) {\r
             newsHtmlBuilder.append(getDivHtml(getLinkHtml(news.getLink(), news.getLink()), NEWS_LINK_HTML_ID));\r