org.eclipse.ecf.presence.ui.chatroom
Class ChatRoomManagerView
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.ui.part.WorkbenchPart
org.eclipse.ui.part.ViewPart
org.eclipse.ecf.presence.ui.chatroom.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
Fields inherited from interface org.eclipse.ui.IWorkbenchPart |
PROP_TITLE |
Method Summary |
protected void |
appendText(org.eclipse.ecf.presence.ui.chatroom.ChatRoomManagerView.ChatRoomTab chatRoomTab,
org.eclipse.swt.custom.StyledText st,
org.eclipse.ecf.internal.presence.ui.ChatLine text)
|
protected void |
clearInput()
|
void |
createPartControl(org.eclipse.swt.widgets.Composite parent)
|
void |
disconnect()
|
void |
disconnected()
|
void |
dispose()
|
protected void |
doJoinRoom(IChatRoomInfo roomInfo,
java.lang.String password)
|
IChatRoomContainer |
getActiveChatRoomContainer()
|
IChatRoomContainer[] |
getChatRoomContainers()
|
static java.lang.String |
getHostnameFromID(ID targetID)
|
protected java.lang.String |
getMessageString(ID fromID,
java.lang.String text)
|
IChatRoomContainer |
getRootChatRoomContainer()
|
protected org.eclipse.swt.custom.CTabItem |
getTabItem(java.lang.String targetName)
|
static java.lang.String |
getUsernameFromID(ID targetID)
|
void |
handleChatMessage(IChatMessage message)
A delegate method to handle chat messages. |
protected void |
handleEnter()
|
void |
handleInvitationReceived(ID roomID,
ID from,
java.lang.String subject,
java.lang.String body)
Handle notification of a received invitation to join a chat room. |
protected void |
handleKeyPressed(org.eclipse.swt.events.KeyEvent evt)
|
void |
handleMessage(ID fromID,
java.lang.String messageBody)
|
protected void |
handleTextInput(java.lang.String text)
|
void |
initializeWithManager(java.lang.String localUserName1,
java.lang.String hostName1,
IChatRoomContainer rootChatRoomContainer,
IChatRoomCommandListener commandListener1,
IChatRoomViewCloseListener closeListener)
|
void |
initializeWithoutManager(java.lang.String username,
java.lang.String hostname,
IChatRoomCommandListener commandListener1,
IChatRoomViewCloseListener closeListener)
|
boolean |
isEnabled()
|
void |
joinRoom(IChatRoomInfo info,
java.lang.String password)
|
protected void |
makeActions()
|
protected void |
outputClear()
|
protected void |
outputCopy()
|
protected void |
outputSelectAll()
|
protected java.lang.String |
processForCommand(IChatRoomContainer chatRoomContainer,
java.lang.String text)
|
protected void |
removeLocalUser()
|
void |
sendMessageLine(java.lang.String line)
|
void |
setEnabled(boolean enabled)
|
void |
setFocus()
|
void |
setMessageRenderer(IMessageRenderer defaultMessageRenderer)
|
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 |
VIEW_ID
public static final java.lang.String VIEW_ID
- See Also:
- Constant Field Values
PARTICIPANTS_MENU_ID
public static final java.lang.String PARTICIPANTS_MENU_ID
- 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
ChatRoomManagerView
public ChatRoomManagerView()
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
getRootChatRoomContainer
public IChatRoomContainer getRootChatRoomContainer()
getChatRoomContainers
public IChatRoomContainer[] getChatRoomContainers()
- Returns:
- a list of IChatRoomContainer for each open channel
or an empty array if there are no channels open.
- Since:
- 2.1
getActiveChatRoomContainer
public IChatRoomContainer getActiveChatRoomContainer()
- Returns:
- chat room container of currently selected tab or null if none found.
initializeWithoutManager
public void initializeWithoutManager(java.lang.String username,
java.lang.String hostname,
IChatRoomCommandListener commandListener1,
IChatRoomViewCloseListener closeListener)
initializeWithManager
public void initializeWithManager(java.lang.String localUserName1,
java.lang.String hostName1,
IChatRoomContainer rootChatRoomContainer,
IChatRoomCommandListener commandListener1,
IChatRoomViewCloseListener closeListener)
setEnabled
public void setEnabled(boolean enabled)
isEnabled
public boolean isEnabled()
clearInput
protected void clearInput()
sendMessageLine
public void sendMessageLine(java.lang.String line)
disconnected
public void disconnected()
getTabItem
protected org.eclipse.swt.custom.CTabItem getTabItem(java.lang.String targetName)
doJoinRoom
protected void doJoinRoom(IChatRoomInfo roomInfo,
java.lang.String password)
handleTextInput
protected void handleTextInput(java.lang.String text)
processForCommand
protected java.lang.String processForCommand(IChatRoomContainer chatRoomContainer,
java.lang.String text)
handleEnter
protected void handleEnter()
handleKeyPressed
protected void handleKeyPressed(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
joinRoom
public void joinRoom(IChatRoomInfo info,
java.lang.String password)
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)
handleChatMessage
public void handleChatMessage(IChatMessage message)
- A delegate method to handle chat messages.
- Parameters:
message
- the chat message that has been received- Since:
- 1.1
handleMessage
public void handleMessage(ID fromID,
java.lang.String messageBody)
getUsernameFromID
public static java.lang.String getUsernameFromID(ID targetID)
- Returns:
- String username for given
targetID
getHostnameFromID
public static java.lang.String getHostnameFromID(ID targetID)
- Returns:
- String hostname for given
targetID
disconnect
public void disconnect()
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 a chat room. This
method will be called by some thread when an invitation 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.ecf.presence.ui.chatroom.ChatRoomManagerView.ChatRoomTab chatRoomTab,
org.eclipse.swt.custom.StyledText st,
org.eclipse.ecf.internal.presence.ui.ChatLine text)
outputClear
protected void outputClear()
outputCopy
protected void outputCopy()
outputSelectAll
protected void outputSelectAll()
makeActions
protected void makeActions()
setMessageRenderer
public void setMessageRenderer(IMessageRenderer defaultMessageRenderer)