Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 74432 Details for
Bug 192762
[IRC] Support common operations on usernames like op,voice,etc
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
1b + basic irc actions
patch.txt (text/plain), 15.72 KB, created by
Jacek Pospychala
on 2007-07-24 04:45:11 EDT
(
hide
)
Description:
1b + basic irc actions
Filename:
MIME Type:
Creator:
Jacek Pospychala
Created:
2007-07-24 04:45:11 EDT
Size:
15.72 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ecf.presence.ui >Index: src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java,v >retrieving revision 1.14 >diff -u -r1.14 ChatRoomManagerView.java >--- src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java 23 Jul 2007 18:13:29 -0000 1.14 >+++ src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java 24 Jul 2007 08:45:10 -0000 >@@ -480,6 +480,21 @@ > } > } > >+ /** >+ * @return chat room container of currently selected tab or null if none found. >+ */ >+ public IChatRoomContainer getActiveChatRoomContainer() { >+ CTabItem selection = rootTabFolder.getSelection(); >+ if (selection != null) { >+ ChatRoom chatRoom = findChatRoomForTabItem(selection); >+ if (chatRoom != null) { >+ return chatRoom.chatRoomContainer; >+ } >+ } >+ >+ return null; >+ } >+ > private ChatRoom findChatRoomForTabItem(CTabItem tabItem) { > for (Iterator i = chatRooms.values().iterator(); i.hasNext();) { > ChatRoom cr = (ChatRoom) i.next(); >#P org.eclipse.ecf.provider.irc.ui >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.provider.irc.ui/plugin.properties,v >retrieving revision 1.3 >diff -u -r1.3 plugin.properties >--- plugin.properties 8 Jun 2007 21:06:07 -0000 1.3 >+++ plugin.properties 24 Jul 2007 08:45:14 -0000 >@@ -11,3 +11,11 @@ > > TextEditorHyperlinkTarget= Textual Editors > IRCHyperlinkDetector= IRC >+ >+KickAction_Label=Kick >+BanAction_Label=Ban >+OpAction_Label=Op >+DeopAction_Label=Deop >+VoiceAction_Label=Voice >+DevoiceAction_Label=Devoice >+WhoisAction_Label=Whois >\ No newline at end of file >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.provider.irc.ui/plugin.xml,v >retrieving revision 1.5 >diff -u -r1.5 plugin.xml >--- plugin.xml 26 Apr 2007 19:53:23 -0000 1.5 >+++ plugin.xml 24 Jul 2007 08:45:14 -0000 >@@ -20,5 +20,60 @@ > targetId="org.eclipse.ui.DefaultTextEditor"> > </hyperlinkDetector> > </extension> >+ <extension >+ point="org.eclipse.ui.popupMenus"> >+ <viewerContribution >+ id="org.eclipse.ecf.provider.irc.ui.viewerContribution1" >+ targetID="org.eclipse.ecf.presence.ui.chatroom.participantsView"> >+ <action >+ class="org.eclipse.ecf.internal.irc.ui.actions.KickAction" >+ id="org.eclipse.ecf.provider.irc.ui.action2" >+ label="%KickAction_Label" >+ menubarPath="additions"> >+ </action> >+ <action >+ class="org.eclipse.ecf.internal.irc.ui.actions.BanAction" >+ id="org.eclipse.ecf.provider.irc.ui.action2" >+ label="%BanAction_Label" >+ menubarPath="additions"> >+ </action> >+ <action >+ class="org.eclipse.ecf.internal.irc.ui.actions.OpAction" >+ id="org.eclipse.ecf.provider.irc.ui.action2" >+ label="%OpAction_Label" >+ menubarPath="additions"> >+ </action> >+ <action >+ class="org.eclipse.ecf.internal.irc.ui.actions.DeopAction" >+ id="org.eclipse.ecf.provider.irc.ui.action2" >+ label="%DeopAction_Label" >+ menubarPath="additions"> >+ </action> >+ <action >+ class="org.eclipse.ecf.internal.irc.ui.actions.VoiceAction" >+ id="org.eclipse.ecf.provider.irc.ui.action2" >+ label="%VoiceAction_Label" >+ menubarPath="additions"> >+ </action> >+ <action >+ class="org.eclipse.ecf.internal.irc.ui.actions.DevoiceAction" >+ id="org.eclipse.ecf.provider.irc.ui.action2" >+ label="%DevoiceAction_Label" >+ menubarPath="additions"> >+ </action> >+ <action >+ class="org.eclipse.ecf.internal.irc.ui.actions.WhoisAction" >+ id="org.eclipse.ecf.provider.irc.ui.action2" >+ label="%WhoisAction_Label" >+ menubarPath="additions"> >+ </action> >+ <visibility> >+ <objectState >+ name="scheme" >+ value="irc"> >+ </objectState> >+ </visibility> >+ </viewerContribution> >+ </extension> > > </plugin> >Index: src/org/eclipse/ecf/internal/irc/ui/actions/VoiceAction.java >=================================================================== >RCS file: src/org/eclipse/ecf/internal/irc/ui/actions/VoiceAction.java >diff -N src/org/eclipse/ecf/internal/irc/ui/actions/VoiceAction.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/internal/irc/ui/actions/VoiceAction.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,18 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 Composent, Inc. and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bug 192762 >+ ******************************************************************************/ >+package org.eclipse.ecf.internal.irc.ui.actions; >+ >+public class VoiceAction extends AbstractActionDelegate { >+ >+ protected String getMessage() { >+ return "/mode +v "+getUsername(); >+ } >+} >Index: src/org/eclipse/ecf/internal/irc/ui/actions/DevoiceAction.java >=================================================================== >RCS file: src/org/eclipse/ecf/internal/irc/ui/actions/DevoiceAction.java >diff -N src/org/eclipse/ecf/internal/irc/ui/actions/DevoiceAction.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/internal/irc/ui/actions/DevoiceAction.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,18 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 Composent, Inc. and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bug 192762 >+ ******************************************************************************/ >+package org.eclipse.ecf.internal.irc.ui.actions; >+ >+public class DevoiceAction extends AbstractActionDelegate { >+ >+ protected String getMessage() { >+ return "/mode -v "+getUsername(); >+ } >+} >Index: src/org/eclipse/ecf/internal/irc/ui/actions/WhoisAction.java >=================================================================== >RCS file: src/org/eclipse/ecf/internal/irc/ui/actions/WhoisAction.java >diff -N src/org/eclipse/ecf/internal/irc/ui/actions/WhoisAction.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/internal/irc/ui/actions/WhoisAction.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,18 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 Composent, Inc. and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bug 192762 >+ ******************************************************************************/ >+package org.eclipse.ecf.internal.irc.ui.actions; >+ >+public class WhoisAction extends AbstractActionDelegate { >+ >+ protected String getMessage() { >+ return "/whois "+getUsername(); >+ } >+} >Index: src/org/eclipse/ecf/internal/irc/ui/actions/BanAction.java >=================================================================== >RCS file: src/org/eclipse/ecf/internal/irc/ui/actions/BanAction.java >diff -N src/org/eclipse/ecf/internal/irc/ui/actions/BanAction.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/internal/irc/ui/actions/BanAction.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,19 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 Composent, Inc. and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bug 192762 >+ ******************************************************************************/ >+package org.eclipse.ecf.internal.irc.ui.actions; >+ >+ >+public class BanAction extends AbstractActionDelegate { >+ >+ protected String getMessage() { >+ return "/ban "+getUsername(); >+ } >+} >Index: src/org/eclipse/ecf/internal/irc/ui/actions/OpAction.java >=================================================================== >RCS file: src/org/eclipse/ecf/internal/irc/ui/actions/OpAction.java >diff -N src/org/eclipse/ecf/internal/irc/ui/actions/OpAction.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/internal/irc/ui/actions/OpAction.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,18 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 Composent, Inc. and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bug 192762 >+ ******************************************************************************/ >+package org.eclipse.ecf.internal.irc.ui.actions; >+ >+public class OpAction extends AbstractActionDelegate { >+ >+ protected String getMessage() { >+ return "/op "+getUsername(); >+ } >+} >Index: src/org/eclipse/ecf/internal/irc/ui/actions/KickAction.java >=================================================================== >RCS file: src/org/eclipse/ecf/internal/irc/ui/actions/KickAction.java >diff -N src/org/eclipse/ecf/internal/irc/ui/actions/KickAction.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/internal/irc/ui/actions/KickAction.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,18 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 Composent, Inc. and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bug 192762 >+ ******************************************************************************/ >+package org.eclipse.ecf.internal.irc.ui.actions; >+ >+public class KickAction extends AbstractActionDelegate { >+ >+ protected String getMessage() { >+ return "/kick "+getUsername(); >+ } >+} >Index: src/org/eclipse/ecf/internal/irc/ui/actions/AbstractActionDelegate.java >=================================================================== >RCS file: src/org/eclipse/ecf/internal/irc/ui/actions/AbstractActionDelegate.java >diff -N src/org/eclipse/ecf/internal/irc/ui/actions/AbstractActionDelegate.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/internal/irc/ui/actions/AbstractActionDelegate.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,78 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 Composent, Inc. and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bug 192762 >+ ******************************************************************************/ >+package org.eclipse.ecf.internal.irc.ui.actions; >+ >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.ecf.core.user.IUser; >+import org.eclipse.ecf.core.util.ECFException; >+import org.eclipse.ecf.internal.irc.ui.Activator; >+import org.eclipse.ecf.presence.chatroom.IChatRoomContainer; >+import org.eclipse.ecf.presence.ui.chatroom.ChatRoomManagerView; >+import org.eclipse.jface.action.IAction; >+import org.eclipse.jface.viewers.ISelection; >+import org.eclipse.jface.viewers.IStructuredSelection; >+import org.eclipse.ui.IViewActionDelegate; >+import org.eclipse.ui.IViewPart; >+import org.eclipse.ui.statushandlers.StatusManager; >+ >+abstract public class AbstractActionDelegate implements IViewActionDelegate { >+ >+ private IUser user; >+ private String username; >+ private IChatRoomContainer chatRoomContainer; >+ >+ public AbstractActionDelegate() { >+ super(); >+ } >+ >+ protected abstract String getMessage(); >+ >+ protected String getUsername() { >+ if (username != null) { >+ return username; >+ } >+ >+ if (user != null) { >+ username = user.getName(); >+ if (username.startsWith("@")) { >+ username = username.substring(1); >+ } >+ return username; >+ } >+ >+ return null; >+ } >+ >+ public void run(IAction action) { >+ if ((chatRoomContainer == null) || (user == null)) { >+ return; >+ } >+ try { >+ chatRoomContainer.getChatRoomMessageSender().sendMessage(getMessage()); //$NON-NLS-1$ >+ } catch (ECFException e) { >+ StatusManager.getManager().handle(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e)); >+ } >+ } >+ >+ public void selectionChanged(IAction action, ISelection selection) { >+ if (! (selection instanceof IStructuredSelection)) { >+ return; >+ } >+ >+ user = (IUser) ((IStructuredSelection) selection).getFirstElement(); >+ } >+ >+ public void init(IViewPart view) { >+ chatRoomContainer = ((ChatRoomManagerView) view).getActiveChatRoomContainer(); >+ } >+ >+} >Index: src/org/eclipse/ecf/internal/irc/ui/actions/DeopAction.java >=================================================================== >RCS file: src/org/eclipse/ecf/internal/irc/ui/actions/DeopAction.java >diff -N src/org/eclipse/ecf/internal/irc/ui/actions/DeopAction.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ecf/internal/irc/ui/actions/DeopAction.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,18 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 Composent, Inc. and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bug 192762 >+ ******************************************************************************/ >+package org.eclipse.ecf.internal.irc.ui.actions; >+ >+public class DeopAction extends AbstractActionDelegate { >+ >+ protected String getMessage() { >+ return "/dop "+getUsername(); >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 192762
:
74316
|
74340
|
74366
|
74367
|
74372
|
74373
|
74432
|
74474
|
74514
|
74669