org.eclipse.ecf.ui.views
Class ChatRoomManagerView

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.ui.part.WorkbenchPart
          extended by org.eclipse.ui.part.ViewPart
              extended by org.eclipse.ecf.ui.views.ChatRoomManagerView
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, IChatRoomInvitationListener, org.eclipse.ui.IPersistable, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.IWorkbenchPart3, org.eclipse.ui.part.IWorkbenchPartOrientation

public class ChatRoomManagerView
extends org.eclipse.ui.part.ViewPart
implements IChatRoomInvitationListener


Field Summary
protected static java.lang.String DEFAULT_DATE_COLOR
           
protected static java.lang.String DEFAULT_DATE_FORMAT
           
protected static java.lang.String DEFAULT_HIGHLIGHT_COLOR
          The default color used to highlight the string of text when the user's name is referred to in the chatroom.
protected static int DEFAULT_INPUT_HEIGHT
           
protected static int DEFAULT_INPUT_SEPARATOR
           
protected static java.lang.String DEFAULT_ME_COLOR
           
protected static java.lang.String DEFAULT_OTHER_COLOR
           
protected static java.lang.String DEFAULT_SYSTEM_COLOR
           
protected static java.lang.String DEFAULT_TIME_FORMAT
           
static java.lang.String VIEW_ID
           
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
ChatRoomManagerView()
           
 
Method Summary
protected  void appendText(org.eclipse.swt.custom.StyledText readText, ChatLine text)
           
protected  void cleanUp()
           
protected  void clearInput()
           
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
           
 void disconnected()
           
 void dispose()
           
protected  void doJoin(java.lang.String target, java.lang.String key)
           
protected  void doQuit()
           
protected  java.lang.String getCurrentDate(java.lang.String format)
           
protected  java.lang.String getDateTime()
           
protected  java.lang.String getMessageString(ID fromID, java.lang.String text)
           
protected  org.eclipse.swt.custom.CTabItem getTabItem(java.lang.String targetName)
           
protected  void handleCommands(java.lang.String line, java.lang.String[] tokens)
           
protected  void handleEnter()
           
protected  void handleInputLine(java.lang.String line)
           
 void handleInvitationReceived(ID roomID, ID from, java.lang.String subject, java.lang.String body)
          Handle notification of a received invitation to join chat room.
protected  void handleKeyPressed(org.eclipse.swt.events.KeyEvent evt)
           
protected  void handleKeyReleased(org.eclipse.swt.events.KeyEvent evt)
           
 void handleMessage(ID fromID, java.lang.String messageBody)
           
protected  void handleTextInput(java.lang.String text)
           
 void initialize(IChatRoomViewCloseListener parent, IChatRoomContainer container, IChatRoomManager chatRoomManager, ID targetID, IChatRoomMessageSender sender)
           
 boolean isEnabled()
           
 void joinRoom(java.lang.String room)
           
protected  void makeActions()
           
protected  void outputClear()
           
protected  void outputCopy()
           
protected  void outputPaste()
           
protected  void outputSelectAll()
           
protected  void removeLocalUser()
           
protected  void sendMessageLine(java.lang.String line)
           
 void setEnabled(boolean enabled)
           
 void setFocus()
           
protected  void setUsernameAndHost(ID chatHostID)
           
 
Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, init, saveState, setContentDescription, setInitializationData, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

VIEW_ID

public static final java.lang.String VIEW_ID
See Also:
Constant Field Values

DEFAULT_ME_COLOR

protected static final java.lang.String DEFAULT_ME_COLOR
See Also:
Constant Field Values

DEFAULT_OTHER_COLOR

protected static final java.lang.String DEFAULT_OTHER_COLOR
See Also:
Constant Field Values

DEFAULT_SYSTEM_COLOR

protected static final java.lang.String DEFAULT_SYSTEM_COLOR
See Also:
Constant Field Values

DEFAULT_HIGHLIGHT_COLOR

protected static final java.lang.String DEFAULT_HIGHLIGHT_COLOR
The default color used to highlight the string of text when the user's name is referred to in the chatroom. The default color is red.

See Also:
Constant Field Values

DEFAULT_DATE_COLOR

protected static final java.lang.String DEFAULT_DATE_COLOR
See Also:
Constant Field Values

DEFAULT_TIME_FORMAT

protected static final java.lang.String DEFAULT_TIME_FORMAT
See Also:
Constant Field Values

DEFAULT_DATE_FORMAT

protected static final java.lang.String DEFAULT_DATE_FORMAT
See Also:
Constant Field Values

DEFAULT_INPUT_HEIGHT

protected static final int DEFAULT_INPUT_HEIGHT
See Also:
Constant Field Values

DEFAULT_INPUT_SEPARATOR

protected static final int DEFAULT_INPUT_SEPARATOR
See Also:
Constant Field Values
Constructor Detail

ChatRoomManagerView

public ChatRoomManagerView()
Method Detail

createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)
Specified by:
createPartControl in interface org.eclipse.ui.IWorkbenchPart
Specified by:
createPartControl in class org.eclipse.ui.part.WorkbenchPart

initialize

public void initialize(IChatRoomViewCloseListener parent,
                       IChatRoomContainer container,
                       IChatRoomManager chatRoomManager,
                       ID targetID,
                       IChatRoomMessageSender sender)

setEnabled

public void setEnabled(boolean enabled)

isEnabled

public boolean isEnabled()

clearInput

protected void clearInput()

handleCommands

protected void handleCommands(java.lang.String line,
                              java.lang.String[] tokens)

sendMessageLine

protected void sendMessageLine(java.lang.String line)

disconnected

public void disconnected()

doQuit

protected void doQuit()

getTabItem

protected org.eclipse.swt.custom.CTabItem getTabItem(java.lang.String targetName)

doJoin

protected void doJoin(java.lang.String target,
                      java.lang.String key)

handleInputLine

protected void handleInputLine(java.lang.String line)

handleTextInput

protected void handleTextInput(java.lang.String text)

handleEnter

protected void handleEnter()

handleKeyPressed

protected void handleKeyPressed(org.eclipse.swt.events.KeyEvent evt)

handleKeyReleased

protected void handleKeyReleased(org.eclipse.swt.events.KeyEvent evt)

setFocus

public void setFocus()
Specified by:
setFocus in interface org.eclipse.ui.IWorkbenchPart
Specified by:
setFocus in class org.eclipse.ui.part.WorkbenchPart

setUsernameAndHost

protected void setUsernameAndHost(ID chatHostID)

joinRoom

public void joinRoom(java.lang.String room)

dispose

public void dispose()
Specified by:
dispose in interface org.eclipse.ui.IWorkbenchPart
Overrides:
dispose in class org.eclipse.ui.part.WorkbenchPart

getMessageString

protected java.lang.String getMessageString(ID fromID,
                                            java.lang.String text)

handleMessage

public void handleMessage(ID fromID,
                          java.lang.String messageBody)

getCurrentDate

protected java.lang.String getCurrentDate(java.lang.String format)

getDateTime

protected java.lang.String getDateTime()

cleanUp

protected void cleanUp()

removeLocalUser

protected void removeLocalUser()

handleInvitationReceived

public void handleInvitationReceived(ID roomID,
                                     ID from,
                                     java.lang.String subject,
                                     java.lang.String body)
Description copied from interface: IChatRoomInvitationListener
Handle notification of a received invitation to join chat room. This method will be called by some thread when an invitiation is received by this user account to join a chat room

Specified by:
handleInvitationReceived in interface IChatRoomInvitationListener
Parameters:
roomID - the room id associated with the invitation. Will not be null.
from - the id of the sender. Will not be null.
subject - a subject for the invitation. May be null.
body - a message body for the invitation. May be null.

appendText

protected void appendText(org.eclipse.swt.custom.StyledText readText,
                          ChatLine text)

outputClear

protected void outputClear()

outputCopy

protected void outputCopy()

outputPaste

protected void outputPaste()

outputSelectAll

protected void outputSelectAll()

makeActions

protected void makeActions()