Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOC] Rework JTourBus tour for "Creating a new Activity type"
Change-Id: I5e7bc2b9b076f59bf28a74cec7c845728d3aa021 Reviewed-on: http://saros-build.imp.fu-berlin.de/gerrit/1579 Tested-by: Jenkins CI Reviewed-by: Bernd Bieber <brotlee@zedat.fu-berlin.de> Reviewed-by: Damla Durmaz <ddurmaz88@gmail.com> Reviewed-by: Franz Zieris <zieris@inf.fu-berlin.de>
- Loading branch information
Showing
8 changed files
with
153 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 36 additions & 31 deletions
67
de.fu_berlin.inf.dpp.core/src/de/fu_berlin/inf/dpp/activities/IActivityReceiver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,63 @@ | ||
package de.fu_berlin.inf.dpp.activities; | ||
|
||
/** | ||
* @JTourBusStop 5, Activity creation, Triple dispatch interface: | ||
* | ||
* The below interface is used for the triple dispatch of the | ||
* activity providers. For a new IActivity implementation you will | ||
* need to add a new receive overload to the interface and fix the | ||
* compilation in the AbstractActivityReceiver class. | ||
*/ | ||
/** | ||
* A Receiver is an interface for handling multiple dispatch in Java. | ||
* | ||
* In our case we want to call one of the specialized receive methods in | ||
* IActivityReceiver for a given IActivity. | ||
* | ||
* For instance, if an IActivity is a TextSelectionActivity, we want the method | ||
* This interface is for implementing multiple dispatch in Java (see <a | ||
* href="http://en.wikipedia.org/wiki/Multiple_dispatch">Wikipedia entry</a>). | ||
* <p> | ||
* In our case we want to call one of the specialized {@code receive()} methods | ||
* in {@link IActivityReceiver} for a given {@link IActivity}. For instance, if | ||
* an activity is a {@link TextSelectionActivity}, we want the method | ||
* {@link #receive(TextSelectionActivity)} to be called. | ||
* | ||
*/ | ||
public interface IActivityReceiver { | ||
/** | ||
* @JTourBusStop 3, Creating a new Activity type, Triple dispatch interface: | ||
* | ||
* This interface provides a receive() method for each | ||
* activity implementation. This is part of the so-called | ||
* "triple dispatch" (see "Activity sending" tour). For now, | ||
* it is enough to know that you need to declare a new | ||
* receive() method with your new Activity type in this | ||
* interface (follow the alphabet, please), and then go to the | ||
* next stop in this tour. | ||
*/ | ||
|
||
/***/ | ||
|
||
void receive(ViewportActivity viewportActivity); | ||
|
||
void receive(TextSelectionActivity textSelectionActivity); | ||
void receive(ChangeColorActivity changeColorActivity); | ||
|
||
void receive(TextEditActivity textEditActivity); | ||
void receive(ChecksumActivity checksumActivity); | ||
|
||
void receive(PermissionActivity permissionActivity); | ||
void receive(ChecksumErrorActivity checksumErrorActivity); | ||
|
||
void receive(FolderActivity folderActivity); | ||
void receive(EditorActivity editorActivity); | ||
|
||
void receive(FileActivity fileActivity); | ||
|
||
void receive(EditorActivity editorActivity); | ||
void receive(FolderActivity folderActivity); | ||
|
||
void receive(JupiterActivity jupiterActivity); | ||
|
||
void receive(StopActivity stopActivity); | ||
|
||
void receive(ChecksumActivity checksumActivity); | ||
void receive(NOPActivity nopActivity); | ||
|
||
void receive(ChecksumErrorActivity checksumErrorActivity); | ||
void receive(PermissionActivity permissionActivity); | ||
|
||
void receive(ProgressActivity progressActivity); | ||
|
||
void receive(VCSActivity activity); | ||
|
||
void receive(ChangeColorActivity changeColorActivity); | ||
void receive(ShareConsoleActivity shareConsoleActivity); | ||
|
||
void receive(StartFollowingActivity startFollowingActivity); | ||
|
||
void receive(StopActivity stopActivity); | ||
|
||
void receive(StopFollowingActivity stopFollowingActivity); | ||
|
||
void receive(NOPActivity nopActivity); | ||
void receive(TextEditActivity textEditActivity); | ||
|
||
void receive(TextSelectionActivity textSelectionActivity); | ||
|
||
void receive(ViewportActivity viewportActivity); | ||
|
||
void receive(VCSActivity activity); | ||
|
||
void receive(ShareConsoleActivity shareConsoleActivity); | ||
} |
1 change: 0 additions & 1 deletion
1
de.fu_berlin.inf.dpp.core/src/de/fu_berlin/inf/dpp/activities/IResourceActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters