You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wookie.apache.org by rg...@apache.org on 2010/04/17 18:32:38 UTC
svn commit: r935202 -
/incubator/wookie/trunk/src/org/apache/wookie/WidgetWebMenuServlet.java
Author: rgardler
Date: Sat Apr 17 16:32:38 2010
New Revision: 935202
URL: http://svn.apache.org/viewvc?rev=935202&view=rev
Log:
Improve javadocs (YAY!) fixes wookie-138 (Thanks to Muhamed Senyonjo)
Modified:
incubator/wookie/trunk/src/org/apache/wookie/WidgetWebMenuServlet.java
Modified: incubator/wookie/trunk/src/org/apache/wookie/WidgetWebMenuServlet.java
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/WidgetWebMenuServlet.java?rev=935202&r1=935201&r2=935202&view=diff
==============================================================================
--- incubator/wookie/trunk/src/org/apache/wookie/WidgetWebMenuServlet.java (original)
+++ incubator/wookie/trunk/src/org/apache/wookie/WidgetWebMenuServlet.java Sat Apr 17 16:32:38 2010
@@ -180,12 +180,26 @@ public class WidgetWebMenuServlet extend
Widget[] widgets = Widget.findAll();
session.setAttribute("widgets", widgets); //$NON-NLS-1$
}
-
+ /**
+ * Creates a table, looks for widget definitions with a string (the name of
+ * the widget) and an instance of the widget which references the actual widget
+ * object and its putting widgets in widgets_hash"
+ * Results are returned in the session.
+ *
+ * @param request
+ * @param session
+ * @param manager
+ */
private void listOperation(HttpServletRequest request, HttpSession session, IWidgetAdminManager manager){
Hashtable<String, Widget> widgetsHash = new Hashtable<String, Widget>();
for(Widget widget:Widget.findAll()){
+
// Create an instance of the widget so that we can display it as the demo widget
+ // An instance of a widget refers to a widget that has data stored on
+ // to it and is going to be deployed on different platforms. In this
+ // case its windows.
+
WidgetInstance instance = null;
String apiKey = "TEST"; //$NON-NLS-1$
String userId = "testuser"; //$NON-NLS-1$
@@ -194,6 +208,8 @@ public class WidgetWebMenuServlet extend
instance = WidgetInstanceFactory.getWidgetFactory(session, LocaleHandler.localizeMessages(request)).newInstance(apiKey, userId, sharedDataKey, null, widgetId, null);
if (instance != null) {
widgetsHash.put(instance.getIdKey(), widget);
+ // widgets could be organised alphabetically here.
+
}
}