1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portlet.messageboards.model.impl;
16  
17  import com.liferay.portlet.messageboards.model.MBCategory;
18  import com.liferay.portlet.messageboards.model.MBMessage;
19  import com.liferay.portlet.messageboards.model.MBMessageDisplay;
20  import com.liferay.portlet.messageboards.model.MBThread;
21  import com.liferay.portlet.messageboards.model.MBTreeWalker;
22  
23  /**
24   * <a href="MBMessageDisplayImpl.java.html"><b><i>View Source</i></b></a>
25   *
26   * @author Brian Wing Shun Chan
27   * @author Shuyang Zhou
28   */
29  public class MBMessageDisplayImpl implements MBMessageDisplay {
30  
31      public MBMessageDisplayImpl(
32          MBMessage message, MBMessage parentMessage, MBCategory category,
33          MBThread thread, MBThread previousThread, MBThread nextThread,
34          String threadView) {
35  
36          _message = message;
37          _parentMessage = parentMessage;
38          _category = category;
39          _thread = thread;
40  
41          if (!threadView.equals(MBThreadImpl.THREAD_VIEW_FLAT)) {
42              _treeWalker = new MBTreeWalkerImpl(message);
43          }
44  
45          _previousThread = previousThread;
46          _nextThread = nextThread;
47          _threadView = threadView;
48      }
49  
50      public MBCategory getCategory() {
51          return _category;
52      }
53  
54      public MBMessage getMessage() {
55          return _message;
56      }
57  
58      public MBThread getNextThread() {
59          return _nextThread;
60      }
61  
62      public MBMessage getParentMessage() {
63          return _parentMessage;
64      }
65  
66      public MBThread getPreviousThread() {
67          return _previousThread;
68      }
69  
70      public MBThread getThread() {
71          return _thread;
72      }
73  
74      public String getThreadView() {
75          return _threadView;
76      }
77  
78      public MBTreeWalker getTreeWalker() {
79          return _treeWalker;
80      }
81  
82      private MBCategory _category;
83      private MBMessage _message;
84      private MBThread _nextThread;
85      private MBMessage _parentMessage;
86      private MBThread _previousThread;
87      private MBThread _thread;
88      private String _threadView;
89      private MBTreeWalker _treeWalker;
90  
91  }