View | Details | Raw Unified | Return to bug 192762 | Differences between
and this patch

Collapse All | Expand All

(-)plugin.xml (+19 lines)
Lines 20-24 Link Here
20
            targetId="org.eclipse.ui.DefaultTextEditor">
20
            targetId="org.eclipse.ui.DefaultTextEditor">
21
      </hyperlinkDetector>
21
      </hyperlinkDetector>
22
   </extension>
22
   </extension>
23
   <extension
24
         point="org.eclipse.ui.popupMenus">
25
      <viewerContribution
26
            id="org.eclipse.ecf.provider.irc.ui.viewerContribution"
27
            targetID="org.eclipse.ecf.presence.ui.chatroom.participantsView">
28
         <action
29
               class="org.eclipse.ecf.internal.irc.ui.actions.Kick"
30
               id="org.eclipse.ecf.provider.irc.ui.action2"
31
               label="Kick"
32
               menubarPath="additions">
33
         </action>
34
         <visibility>
35
            <systemProperty
36
                  name="org.eclipse.ecf.provider.irc.ui.systemProperty"
37
                  value="true">
38
            </systemProperty>
39
         </visibility>
40
      </viewerContribution>
41
   </extension>
23
42
24
</plugin>
43
</plugin>
(-)src/org/eclipse/ecf/internal/irc/ui/actions/Kick.java (+48 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007 Composent, Inc. and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *    Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bug 192762
10
 ******************************************************************************/
11
12
package org.eclipse.ecf.internal.irc.ui.actions;
13
14
import org.eclipse.ecf.core.user.IUser;
15
import org.eclipse.ecf.presence.ui.chatroom.ChatRoomManagerView;
16
import org.eclipse.jface.action.IAction;
17
import org.eclipse.jface.viewers.ISelection;
18
import org.eclipse.jface.viewers.IStructuredSelection;
19
import org.eclipse.ui.IViewActionDelegate;
20
import org.eclipse.ui.IViewPart;
21
22
public class Kick implements IViewActionDelegate {
23
24
	IUser user;
25
	ChatRoomManagerView view;
26
	
27
	public void run(IAction action) {
28
		if ((view == null) || (user == null)) {
29
			return;
30
		}
31
		
32
		view.sendMessageLine("/kick "+user.getName());
33
		
34
	}
35
36
	public void selectionChanged(IAction action, ISelection selection) {
37
		if (! (selection instanceof IStructuredSelection)) {
38
			return;
39
		}
40
		
41
		user = (IUser) ((IStructuredSelection) selection).getFirstElement();
42
	}
43
44
	public void init(IViewPart view) {
45
		this.view = (ChatRoomManagerView) view;
46
	}
47
48
}
(-)src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java (-1 / +17 lines)
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *    Composent, Inc. - initial API and implementation
9
 *    Composent, Inc. - initial API and implementation
10
 *    Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bug 192762
10
 ******************************************************************************/
11
 ******************************************************************************/
11
package org.eclipse.ecf.presence.ui.chatroom;
12
package org.eclipse.ecf.presence.ui.chatroom;
12
13
Lines 84-89 Link Here
84
import org.eclipse.swt.layout.GridData;
85
import org.eclipse.swt.layout.GridData;
85
import org.eclipse.swt.widgets.Composite;
86
import org.eclipse.swt.widgets.Composite;
86
import org.eclipse.swt.widgets.Display;
87
import org.eclipse.swt.widgets.Display;
88
import org.eclipse.swt.widgets.List;
87
import org.eclipse.swt.widgets.Menu;
89
import org.eclipse.swt.widgets.Menu;
88
import org.eclipse.swt.widgets.ScrollBar;
90
import org.eclipse.swt.widgets.ScrollBar;
89
import org.eclipse.swt.widgets.Text;
91
import org.eclipse.swt.widgets.Text;
Lines 106-111 Link Here
106
108
107
	public static final String VIEW_ID = "org.eclipse.ecf.presence.ui.chatroom.ChatRoomManagerView"; //$NON-NLS-1$
109
	public static final String VIEW_ID = "org.eclipse.ecf.presence.ui.chatroom.ChatRoomManagerView"; //$NON-NLS-1$
108
110
111
	public static final String PARTICIPANTS_MENU_ID = "org.eclipse.ecf.presence.ui.chatroom.participantsView"; //$NON-NLS-1$ 
112
	
109
	private static final int RATIO_WRITE_PANE = 1;
113
	private static final int RATIO_WRITE_PANE = 1;
110
114
111
	private static final int RATIO_READ_PANE = 9;
115
	private static final int RATIO_READ_PANE = 9;
Lines 236-241 Link Here
236
240
237
			makeActions();
241
			makeActions();
238
			hookContextMenu();
242
			hookContextMenu();
243
			if (withParticipants) {
244
				hookParticipantsContextMenu();
245
			}
239
		}
246
		}
240
247
241
		private StyledText createStyledTextWidget(Composite parent) {
248
		private StyledText createStyledTextWidget(Composite parent) {
Lines 331-337 Link Here
331
			};
338
			};
332
			getSite().registerContextMenu(menuMgr, selectionProvider);
339
			getSite().registerContextMenu(menuMgr, selectionProvider);
333
		}
340
		}
334
341
		
342
		private void hookParticipantsContextMenu() {
343
			MenuManager menuMgr = new MenuManager(); 
344
			menuMgr.setRemoveAllWhenShown(true);
345
			List list = (List) listViewer.getControl();
346
			Menu menu = menuMgr.createContextMenu(list);
347
			list.setMenu(menu);
348
			getSite().registerContextMenu(PARTICIPANTS_MENU_ID, menuMgr, listViewer);
349
		}
350
		
335
		private void makeActions() {
351
		private void makeActions() {
336
			tabSelectAll = new Action() {
352
			tabSelectAll = new Action() {
337
				public void run() {
353
				public void run() {

Return to bug 192762