<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">### Eclipse Workspace Patch 1.0
#P Saros
Index: src/de/fu_berlin/inf/dpp/ui/RosterView.java
===================================================================
--- src/de/fu_berlin/inf/dpp/ui/RosterView.java	(revision 2290)
+++ src/de/fu_berlin/inf/dpp/ui/RosterView.java	(working copy)
@@ -32,6 +32,7 @@
 import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.action.Separator;
 import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
 import org.eclipse.jface.viewers.IStructuredContentProvider;
 import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.LabelProvider;
@@ -39,7 +40,6 @@
 import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.layout.GridData;
@@ -56,8 +56,8 @@
 import org.jivesoftware.smack.RosterGroup;
 import org.jivesoftware.smack.XMPPConnection;
 import org.jivesoftware.smack.packet.Presence;
-import org.jivesoftware.smack.packet.RosterPacket;
 import org.jivesoftware.smack.packet.Presence.Type;
+import org.jivesoftware.smack.packet.RosterPacket;
 import org.picocontainer.Disposable;
 import org.picocontainer.annotations.Inject;
 
@@ -73,9 +73,9 @@
 import de.fu_berlin.inf.dpp.net.RosterTracker;
 import de.fu_berlin.inf.dpp.net.internal.ConnectionTestManager;
 import de.fu_berlin.inf.dpp.net.internal.DataTransferManager;
-import de.fu_berlin.inf.dpp.net.internal.DiscoveryManager;
 import de.fu_berlin.inf.dpp.net.internal.DataTransferManager.IBytestreamConnection;
 import de.fu_berlin.inf.dpp.net.internal.DataTransferManager.NetTransferMode;
+import de.fu_berlin.inf.dpp.net.internal.DiscoveryManager;
 import de.fu_berlin.inf.dpp.observables.InvitationProcessObservable;
 import de.fu_berlin.inf.dpp.preferences.PreferenceUtils;
 import de.fu_berlin.inf.dpp.project.SessionManager;
@@ -95,6 +95,17 @@
  * 
  * @author rdjemili
  */
+
+/**
+ * @JTourBusStop 5, The Interface Tour:
+ * 
+ *               This class implements the roster, another very important view
+ *               when using Saros.
+ * 
+ *               You should notice that this class function similarly to the
+ *               SessionView.
+ */
+
 @Component(module = "ui")
 public class RosterView extends ViewPart {
 
@@ -104,8 +115,8 @@
     public static final Image personImage = SarosUI.getImage("icons/user.png");
     public static final Image personAwayImage = SarosUI
         .getImage("icons/clock.png");
-    public static final Image personOfflineImage = new Image(Display
-        .getDefault(), personImage, SWT.IMAGE_DISABLE);
+    public static final Image personOfflineImage = new Image(
+        Display.getDefault(), personImage, SWT.IMAGE_DISABLE);
 
     protected TreeViewer viewer;
 
@@ -431,8 +442,8 @@
         }
 
         public Collection&lt;TreeItem&gt; getChildren() {
-            final List&lt;TreeItem&gt; result = new ArrayList&lt;TreeItem&gt;(group
-                .getEntryCount());
+            final List&lt;TreeItem&gt; result = new ArrayList&lt;TreeItem&gt;(
+                group.getEntryCount());
             for (RosterEntry rosterEntry : group.getEntries()) {
                 result.add(new ContactItem(rosterEntry.getUser()));
             }
@@ -478,8 +489,8 @@
     protected class UnfiledGroupItem extends AbstractGroupItem {
 
         public Collection&lt;TreeItem&gt; getChildren() {
-            final List&lt;TreeItem&gt; result = new ArrayList&lt;TreeItem&gt;(roster
-                .getUnfiledEntryCount());
+            final List&lt;TreeItem&gt; result = new ArrayList&lt;TreeItem&gt;(
+                roster.getUnfiledEntryCount());
             for (RosterEntry rosterEntry : roster.getUnfiledEntries()) {
                 result.add(new ContactItem(rosterEntry.getUser()));
             }
@@ -635,8 +646,8 @@
 
         saros.addListener(connectionListener);
         rosterTracker.addRosterListener(rosterListener);
-        connectionListener.connectionStateChanged(saros.getConnection(), saros
-            .getConnectionState());
+        connectionListener.connectionStateChanged(saros.getConnection(),
+            saros.getConnectionState());
         rosterListener.rosterChanged(saros.getRoster());
     }
 
Index: src/de/fu_berlin/inf/dpp/ui/SessionView.java
===================================================================
--- src/de/fu_berlin/inf/dpp/ui/SessionView.java	(revision 2290)
+++ src/de/fu_berlin/inf/dpp/ui/SessionView.java	(working copy)
@@ -94,6 +94,23 @@
  * color, who is being followed, and provide actions for changing roles and
  * follow mode.
  */
+
+/**
+ * @JTourBusStop 1, The Interface Tour:
+ * 
+ *               This tour shows you a few keys parts of the Saros interface and
+ *               how it functions. It will give you a glimpse of the main views
+ *               used by Saros, an idea about how to code the user interface and
+ *               how it communicates with the underlying business logic.
+ * 
+ *               We begin here at the SessionView, the class that implements the
+ *               view entitled 'Shared Project Session', and so is one of the
+ *               more important views. Notice that each view inherits from the
+ *               Eclipse ViewPart, which manages most of the view's mechanics,
+ *               leaving us to fill in the missing parts specific to our view.
+ * 
+ * 
+ */
 @Component(module = "ui")
 public class SessionView extends ViewPart {
 
@@ -174,6 +191,31 @@
 
     protected ISharedProject sharedProject;
 
+    /**
+     * @JTourBusStop 3, The Interface Tour:
+     * 
+     *               This stop shows how the session view maintains the member
+     *               list. Recall that list of people who are in your current
+     *               session? The SessionContentProvider class implements the
+     *               functionality for that.
+     * 
+     *               Firstly, hover over the inputChanged method, right-click,
+     *               go to References-&gt;Workspace, to find out who calls the
+     *               inputChanged method. Notice that it is *never* called
+     *               within Saros, but only by native Eclipse objects. The same
+     *               is true of some other methods in this class.
+     * 
+     *               That's because the class implements certain interfaces
+     *               (IStructuredContentProvider in the case of the inputChanged
+     *               method). Look back at stop #2 and the second line of
+     *               createPartControl(), where the viewer object is told that
+     *               its content provider is a new SessionContentProvider
+     *               instance. Thus, Eclipse expects this class to have methods
+     *               such as inputChanged implemented, because it will call them
+     *               later as it manages the interface.
+     * 
+     */
+
     protected class SessionContentProvider implements
         IStructuredContentProvider, ISharedProjectListener {
 
@@ -192,8 +234,8 @@
                     return -1;
                 if (user2.isHost())
                     return +1;
-                return user1.getJID().toString().toLowerCase().compareTo(
-                    user2.getJID().toString().toLowerCase());
+                return user1.getJID().toString().toLowerCase()
+                    .compareTo(user2.getJID().toString().toLowerCase());
             }
         };
 
@@ -256,6 +298,22 @@
         }
     }
 
+    /**
+     * @JTourBusStop 4, The Interface Tour:
+     * 
+     *               The SessionLabelProvider works very much like the
+     *               SessionContentProvider, by implementing certain interfaces
+     *               that Eclipse's GUI objects expects, defining the behaviour
+     *               in the implemented methods, then is given to Eclipse to be
+     *               used in managing the interface on our behalf.
+     * 
+     *               This class implements individual entries with the session
+     *               view user list. Take a look within it for examples of how
+     *               fonts, colours and images are used. Note the use of the
+     *               dispose method, a rare use of the Java programmer having to
+     *               worry about explicit resource management.
+     */
+
     protected class SessionLabelProvider extends LabelProvider implements
         ITableLabelProvider, ITableColorProvider, ITableFontProvider {
 
@@ -401,6 +459,28 @@
     }
 
     /**
+     * @JTourBusStop 2, The Interface Tour:
+     * 
+     *               The createPartControl method constructs the view's
+     *               controls.
+     * 
+     *               Look further down and you will see a list of lines like
+     *               this: "container.addComponent(...)". Each argument to the
+     *               addComponent method is a class that implements a piece of
+     *               functionality. Most of them are Actions, which must provide
+     *               a run() method that is executed when it the widget is
+     *               activated.
+     * 
+     *               For instance, you will notice a button in the Session View
+     *               with the tooltip "Send a file to selected user". This
+     *               button is implemented by the SendFileAction class.
+     * 
+     *               Why not take a look at the SendFileAction class; look
+     *               especially at its constructor and run() method.
+     * 
+     */
+
+    /**
      * This is a callback that will allow us to create the viewer and initialize
      * it.
      */
Index: src/de/fu_berlin/inf/dpp/ui/wizards/CreateAccountWizard.java
===================================================================
--- src/de/fu_berlin/inf/dpp/ui/wizards/CreateAccountWizard.java	(revision 2290)
+++ src/de/fu_berlin/inf/dpp/ui/wizards/CreateAccountWizard.java	(working copy)
@@ -33,6 +33,18 @@
  */
 public class CreateAccountWizard extends Wizard {
 
+    /**
+     * @JTourBusStop 6, The Interface Tour:
+     * 
+     *               Another important element to the Saros interface is the
+     *               Wizard. Eclipse supplies an abstract Wizard class that can
+     *               be extended with your concrete functionality.
+     * 
+     *               In this example, the RegisterAccountPage class is added as
+     *               the content of this wizard. Take a look at
+     *               RegisterAccountPage.java.
+     */
+
     protected final RegisterAccountPage page;
 
     protected final Saros saros;
</pre></body></html>