Author: jflesch
Date: 2007-08-13 10:04:31 +0000 (Mon, 13 Aug 2007)
New Revision: 14640
Added:
trunk/apps/Thaw/src/thaw/plugins/miniFrost/SentMessages.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/SpecialBoardFactory.java
Log:
Forgot files / to commit : Implements a special boards to see the messages sent
Added: trunk/apps/Thaw/src/thaw/plugins/miniFrost/SentMessages.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/SentMessages.java
(rev 0)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/SentMessages.java
2007-08-13 10:04:31 UTC (rev 14640)
@@ -0,0 +1,107 @@
+package thaw.plugins.miniFrost;
+
+import java.util.Vector;
+import java.util.Collections;
+
+import thaw.core.I18n;
+import thaw.plugins.MiniFrost;
+import thaw.core.Logger;
+
+import thaw.plugins.miniFrost.interfaces.BoardFactory;
+import thaw.plugins.miniFrost.interfaces.Draft;
+import thaw.plugins.miniFrost.interfaces.Message;
+
+
+public class SentMessages
+ implements thaw.plugins.miniFrost.interfaces.Board {
+
+ private MiniFrost miniFrost;
+
+ public SentMessages(MiniFrost miniFrost) {
+ this.miniFrost = miniFrost;
+ }
+
+ public String getName() {
+ return I18n.getMessage("thaw.plugin.miniFrost.sentBox");
+ }
+
+ /**
+ * don't store/cache the messages,
+ * just give them.
+ * @param keywords can be null
+ * @param orderBy specify an order
+ * @param desc
+ * @param archived If true, archived messages will also be returned
+ */
+ public Vector getMessages(String[] keywords,
+ int orderBy,
+ boolean desc,
+ boolean archived,
+ boolean unsigned,
+ int minTrustLevel) {
+ BoardFactory[] factories = miniFrost.getFactories();
+
+ Vector v = new Vector();
+
+ for (int i = 0 ; i < factories.length ; i++) {
+ v.addAll(factories[i].getSentMessages());
+ }
+
+ Collections.sort(v);
+
+ return v;
+
+ }
+
+ public Draft getDraft(Message inReplyTo) {
+ return null;
+ }
+
+ /**
+ * @return null if none
+ */
+ public Message getNextUnreadMessage(boolean unsigned, int
minTrustLevel) {
+ return null;
+ }
+
+
+ /**
+ * must refresh() the board list each time a new message is found
+ * and when the refresh is finished.
+ * MUST NOT BE BLOCKING.
+ */
+ public void refresh() {
+ return;
+ }
+
+ public boolean isRefreshing() {
+ return false;
+ }
+
+ public int getNewMessageNumber() {
+ return 0;
+ }
+
+ public boolean destroy() {
+ Logger.warning(this, "Can't destroy this 'board'");
+ return false;
+ }
+
+ /**
+ * Always return the board name,
+ * without anything more
+ */
+ public String toString() {
+ return getName();
+ }
+
+
+ public int compareTo(Object o) {
+ //return toString().compareToIgnoreCase(o.toString());
+ return -1; /* always */
+ }
+
+ public boolean equals(Object o) {
+ return false;
+ }
+}
Added: trunk/apps/Thaw/src/thaw/plugins/miniFrost/SpecialBoardFactory.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/SpecialBoardFactory.java
(rev 0)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/SpecialBoardFactory.java
2007-08-13 10:04:31 UTC (rev 14640)
@@ -0,0 +1,81 @@
+package thaw.plugins.miniFrost;
+
+import java.util.Vector;
+import java.util.Iterator;
+
+import thaw.core.Logger;
+import thaw.plugins.Hsqldb;
+import thaw.plugins.MiniFrost;
+import thaw.core.Core;
+
+import thaw.plugins.miniFrost.interfaces.BoardFactory;
+
+
+public class SpecialBoardFactory
+ implements BoardFactory {
+
+
+ private MiniFrost miniFrost;
+
+
+ public SpecialBoardFactory() {
+
+ }
+
+ /**
+ * Init
+ */
+ public boolean init(Hsqldb db, thaw.core.Core core,
+ MiniFrost miniFrost) {
+ this.miniFrost = miniFrost;
+ return true;
+ }
+
+
+ public boolean cleanUp(int archiveAfter, int deleteAfter) {
+ /* nothing to do */
+ return true;
+ }
+
+ /**
+ * @return all the boards managed by this factory
+ */
+ public Vector getBoards() {
+ Vector v = new Vector();
+
+ v.add(new SentMessages(miniFrost));
+
+ return v;
+ }
+
+
+ public Vector getAllMessages(String[] keywords, int orderBy,
+ boolean desc, boolean archived,
+ boolean unsigned, int minTrustLevel) {
+ /* NADA */
+ return new Vector();
+ }
+
+ public Vector getSentMessages() {
+ /* NADA */
+ return new Vector();
+ }
+
+
+ /**
+ * display the dialog asking for a name, etc.
+ * the tree will be reloaded after that
+ */
+ public void createBoard(thaw.core.MainWindow mainWindow /*BoardFolder
parent*/) {
+ Logger.warning(this, "NI !");
+ }
+
+
+ /**
+ * For example 'frost boards' ; Use I18n ...
+ */
+ public String toString() {
+ return null;
+ }
+
+}