"); //$NON-NLS-1$
+ buf.append(clean(channel.getTitle()));
+ buf.append(""); //$NON-NLS-1$
+ buf.append("
"); //$NON-NLS-1$
+ buf.append(clean(channel.getDescription()));
+ buf.append("
"); //$NON-NLS-1$
+ for (Item item : channel.getItems()) {
+ buf.append("
"); //$NON-NLS-1$
+ buf.append(clean(item.getTitle()));
+ buf.append(""); //$NON-NLS-1$
+ buf.append("
"); //$NON-NLS-1$
+ buf.append(clean(item.getDescription()));
+ buf.append("
"); //$NON-NLS-1$
+ }
+ }
+ buf.append(HTML_BODY_FOOTER);
+ System.out.println(buf.toString());
+ browser.setText(buf.toString());
+ }
+
+ private String clean(String s) {
+ for (Pattern pattern : EXCLUDE_TAG_PATTERNS) {
+ s = pattern.matcher(s).replaceAll(""); //$NON-NLS-1$
+ }
+ return s.length() > MAX_ELEM_LEN ? s.substring(0, MAX_ELEM_LEN) : s;
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ protected Set
makeActions() {
+ Set actions = new LinkedHashSet();
+ for (IAction action : super.makeActions()) {
+ if (action.getText().equals(Messages.AbstractBrowserPortalPage_RefreshLabel)) {
+ IAction a = new Action(Messages.AbstractBrowserPortalPage_RefreshLabel) {
+ @Override
+ public void run() {
+ if (browser != null) {
+ if (browserHasURL())
+ browser.refresh();
+ else
+ displayRSS();
+ actionBar.update();
+ }
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return browser != null ? !actionBar.isLoading() : false;
+ }
+ };
+ actions.add(a);
+ }
+ else
+ actions.add(action);
+ }
+
+ actions.add(new Action(Messages.AbstractRSSPortalPageLayer_ReturnToFeedLabel) {
+ @Override
+ public void run() {
+ displayRSS();
+ actionBar.update();
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return browserHasURL();
+ }
+ });
+
+ return actions;
+ }
+
+}
diff -r c3599e02bf7f -r 18638adda547 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/IPortalPageLayer.java
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/IPortalPageLayer.java Thu Jul 29 09:51:07 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/IPortalPageLayer.java Thu Jul 29 13:28:20 2010 -0500
@@ -27,12 +27,6 @@
public interface IPortalPageLayer {
/**
- * The title of this portal page layer
- * @return String
- */
- String getTitle();
-
- /**
* Interface to an action/navigation bar for the portal portal page layer
*/
public interface IActionBar {
diff -r c3599e02bf7f -r 18638adda547 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/CreatingCarbidePage.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/CreatingCarbidePage.java Thu Jul 29 13:28:20 2010 -0500
@@ -0,0 +1,18 @@
+package com.nokia.carbide.internal.discovery.ui.view;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import com.nokia.carbide.internal.discovery.ui.extension.AbstractRSSPortalPageLayer;
+
+public class CreatingCarbidePage extends AbstractRSSPortalPageLayer {
+
+ @Override
+ protected URL getURL() {
+ try {
+ return new URL("http://creatingcarbide.blogspot.com/feeds/posts/default?alt=rss"); //$NON-NLS-1$
+ } catch (MalformedURLException e) {
+ }
+ return null;
+ }
+}
diff -r c3599e02bf7f -r 18638adda547 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/HomePage.java
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/HomePage.java Thu Jul 29 09:51:07 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/HomePage.java Thu Jul 29 13:28:20 2010 -0500
@@ -1,13 +1,6 @@
package com.nokia.carbide.internal.discovery.ui.view;
-import com.nokia.carbide.discovery.ui.Messages;
-import com.nokia.carbide.internal.discovery.ui.extension.AbstractBrowserPortalPage;
-
-public class HomePage extends AbstractBrowserPortalPage {
+import com.nokia.carbide.internal.discovery.ui.extension.AbstractBrowserPortalPageLayer;
- @Override
- public String getTitle() {
- return Messages.HomePage_Title;
- }
-
+public class HomePage extends AbstractBrowserPortalPageLayer {
}
diff -r c3599e02bf7f -r 18638adda547 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/InstallExtensionsPortalExtension.java
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/InstallExtensionsPortalExtension.java Thu Jul 29 09:51:07 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/InstallExtensionsPortalExtension.java Thu Jul 29 13:28:20 2010 -0500
@@ -80,7 +80,7 @@
@Override
public String getTitle() {
- return Messages.InstallExtensionsPage_ActionBarTitle;
+ return Messages.InstallExtensionsPortalExtension_InstallExtensionsTitle;
}
@Override
@@ -133,11 +133,6 @@
}
@Override
- public String getTitle() {
- return Messages.InstallExtensionsPage_Title;
- }
-
- @Override
public Control createControl(Composite parent, IEditorPart part) {
Composite c = new Composite(parent, SWT.NONE);
GridLayoutFactory.swtDefaults().applyTo(c);
diff -r c3599e02bf7f -r 18638adda547 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/SupportPage.java
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/SupportPage.java Thu Jul 29 09:51:07 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/SupportPage.java Thu Jul 29 13:28:20 2010 -0500
@@ -1,16 +1,6 @@
package com.nokia.carbide.internal.discovery.ui.view;
-import com.nokia.carbide.discovery.ui.Messages;
-import com.nokia.carbide.internal.discovery.ui.extension.AbstractBrowserPortalPage;
-
-public class SupportPage extends AbstractBrowserPortalPage {
+import com.nokia.carbide.internal.discovery.ui.extension.AbstractBrowserPortalPageLayer;
- public SupportPage() {
- }
-
- @Override
- public String getTitle() {
- return Messages.SupportPage_Title;
- }
-
+public class SupportPage extends AbstractBrowserPortalPageLayer {
}
diff -r c3599e02bf7f -r 18638adda547 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/WrenchSciencePage.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/WrenchSciencePage.java Thu Jul 29 13:28:20 2010 -0500
@@ -0,0 +1,18 @@
+package com.nokia.carbide.internal.discovery.ui.view;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import com.nokia.carbide.internal.discovery.ui.extension.AbstractRSSPortalPageLayer;
+
+public class WrenchSciencePage extends AbstractRSSPortalPageLayer {
+
+ @Override
+ protected URL getURL() {
+ try {
+ return new URL("http://blogs.in.nokia.com/wrenchscience/rss.xml"); //$NON-NLS-1$
+ } catch (MalformedURLException e) {
+ }
+ return null;
+ }
+}