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

Collapse All | Expand All

(-)META-INF/MANIFEST.MF (-1 / +3 lines)
Lines 15-20 Link Here
15
 org.eclipse.mylyn.tasks.ui,
15
 org.eclipse.mylyn.tasks.ui,
16
 org.eclipse.ecf.presence.ui,
16
 org.eclipse.ecf.presence.ui,
17
 org.eclipse.mylyn.context.core,
17
 org.eclipse.mylyn.context.core,
18
 org.eclipse.ui.forms
18
 org.eclipse.ui.forms,
19
 org.eclipse.ui.workbench.texteditor,
20
 org.eclipse.jface.text
19
Bundle-RequiredExecutionEnvironment: J2SE-1.4
21
Bundle-RequiredExecutionEnvironment: J2SE-1.4
20
Eclipse-LazyStart: true
22
Eclipse-LazyStart: true
(-)plugin.properties (+2 lines)
Lines 11-13 Link Here
11
11
12
plugin.name = ECF Mylyn Integration
12
plugin.name = ECF Mylyn Integration
13
provider.name = Eclipse.org
13
provider.name = Eclipse.org
14
15
BugHyperlinkDetector = Bug
(-)plugin.xml (+10 lines)
Lines 40-43 Link Here
40
           </dynamic>
40
           </dynamic>
41
     </menuContribution>
41
     </menuContribution>
42
  </extension>
42
  </extension>
43
     <extension
44
           point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
45
        <hyperlinkDetector
46
              activate="true"
47
              class="org.eclipse.ecf.internal.mylyn.ui.hyperlink.BugHyperlinkDetector"
48
              id="org.eclipse.ecf.internal.provider.irc.container"
49
              name="%BugHyperlinkDetector"
50
              targetId="org.eclipse.ecf.presence">
51
        </hyperlinkDetector>
52
     </extension>
43
</plugin>
53
</plugin>
(-)src/org/eclipse/ecf/internal/mylyn/ui/Activator.java (-1 / +1 lines)
Lines 34-40 Link Here
34
34
35
public class Activator extends AbstractUIPlugin implements IChannelListener, ServiceListener {
35
public class Activator extends AbstractUIPlugin implements IChannelListener, ServiceListener {
36
36
37
	static final String PLUGIN_ID = "org.eclipse.ecf.mylyn.ui"; //$NON-NLS-1$
37
	public static final String PLUGIN_ID = "org.eclipse.ecf.mylyn.ui"; //$NON-NLS-1$
38
38
39
	private static Activator plugin;
39
	private static Activator plugin;
40
40
(-)src/org/eclipse/ecf/internal/mylyn/ui/hyperlink/BugHyperlinkDetector.java (+97 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
 *    Composent, Inc. - initial API and implementation
10
 *    Abner Ballardo <modlost@modlost.net> - bug 197991
11
 *****************************************************************************/
12
package org.eclipse.ecf.internal.mylyn.ui.hyperlink;
13
14
import java.util.*;
15
import org.eclipse.jface.text.*;
16
import org.eclipse.jface.text.hyperlink.IHyperlink;
17
import org.eclipse.mylyn.tasks.core.TaskRepository;
18
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
19
20
public class BugHyperlinkDetector extends org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector {
21
	private static final String BUGZILLA_CONNECTOR_KIND = "bugzilla"; //$NON-NLS-1$
22
	public static final String DEFAULT_PREFIX = "bug #"; //$NON-NLS-1$
23
	public static final String DEFAULT_ENDDELIMITERS = " \t\n\r\f<>"; //$NON-NLS-1$
24
25
	/*
26
	 * (non-Javadoc)
27
	 * 
28
	 * @see org.eclipse.jface.text.hyperlink.IHyperlinkDetector#detectHyperlinks(org.eclipse.jface.text.ITextViewer,
29
	 *      org.eclipse.jface.text.IRegion, boolean)
30
	 */
31
	public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
32
		if (region == null || textViewer == null)
33
			return null;
34
35
		IDocument document = textViewer.getDocument();
36
		if (document == null)
37
			return null;
38
39
		int offset = region.getOffset();
40
41
		IRegion lineInfo;
42
		String line;
43
		try {
44
			lineInfo = document.getLineInformationOfOffset(offset);
45
			line = document.get(lineInfo.getOffset(), lineInfo.getLength());
46
		} catch (BadLocationException ex) {
47
			return null;
48
		}
49
50
		Region detectedRegion = detectRegion(lineInfo, line, offset - lineInfo.getOffset());
51
52
		if (detectedRegion == null)
53
			return null;
54
55
		int detectedOffset = detectedRegion.getOffset() - lineInfo.getOffset();
56
57
		return createHyperLinksForBug(line.substring(detectedOffset, detectedOffset + detectedRegion.getLength()), detectedRegion);
58
59
	}
60
61
	private Region detectRegion(IRegion lineInfo, String fromLine, int offsetInLine) {
62
		int resultLength = 0;
63
64
		int separatorOffset = fromLine.indexOf(DEFAULT_PREFIX);
65
		while (separatorOffset >= 0) {
66
			StringTokenizer tokenizer = new StringTokenizer(fromLine.substring(separatorOffset + DEFAULT_PREFIX.length()), DEFAULT_ENDDELIMITERS, false);
67
			if (!tokenizer.hasMoreTokens())
68
				return null;
69
70
			resultLength = tokenizer.nextToken().length() + DEFAULT_PREFIX.length();
71
			if (offsetInLine >= separatorOffset && offsetInLine <= separatorOffset + resultLength)
72
				break;
73
74
			separatorOffset = fromLine.indexOf(DEFAULT_PREFIX, separatorOffset + 1);
75
		}
76
77
		if (separatorOffset < 0)
78
			return null;
79
80
		return new Region(lineInfo.getOffset() + separatorOffset, resultLength);
81
	}
82
83
	private IHyperlink[] createHyperLinksForBug(String bug, Region region) {
84
		List allRepositories = TasksUiPlugin.getRepositoryManager().getAllRepositories();
85
		Vector urls = new Vector();
86
87
		for (Iterator ite = allRepositories.iterator(); ite.hasNext();) {
88
			TaskRepository repository = (TaskRepository) ite.next();
89
90
			if (repository.getConnectorKind().equals(BUGZILLA_CONNECTOR_KIND)) {
91
				urls.add(new BugzillaBugHyperlink(repository, bug, region));
92
			}
93
		}
94
95
		return (IHyperlink[]) urls.toArray(new IHyperlink[0]);
96
	}
97
}
(-)src/org/eclipse/ecf/internal/mylyn/ui/hyperlink/BugzillaBugHyperlink.java (+70 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
 *    Composent, Inc. - initial API and implementation
10
 *    Abner Ballardo <modlost@modlost.net> - bug 197991
11
 *****************************************************************************/
12
package org.eclipse.ecf.internal.mylyn.ui.hyperlink;
13
14
import java.net.URL;
15
import org.eclipse.core.runtime.IStatus;
16
import org.eclipse.core.runtime.Status;
17
import org.eclipse.ecf.internal.mylyn.ui.Activator;
18
import org.eclipse.ecf.internal.mylyn.ui.Messages;
19
import org.eclipse.jface.text.IRegion;
20
import org.eclipse.jface.text.hyperlink.IHyperlink;
21
import org.eclipse.mylyn.tasks.core.TaskRepository;
22
import org.eclipse.osgi.util.NLS;
23
import org.eclipse.ui.PlatformUI;
24
import org.eclipse.ui.browser.IWebBrowser;
25
import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
26
27
public class BugzillaBugHyperlink implements IHyperlink {
28
	private static final String CGI_QUERY = "/show_bug.cgi?id="; //$NON-NLS-1$
29
30
	private IRegion region;
31
32
	private String bug;
33
34
	private TaskRepository repository;
35
36
	public BugzillaBugHyperlink(TaskRepository repository, String bug, IRegion region) {
37
		this.repository = repository;
38
		this.region = region;
39
		this.bug = bug;
40
	}
41
42
	public IRegion getHyperlinkRegion() {
43
		return this.region;
44
	}
45
46
	public String getHyperlinkText() {
47
		return NLS.bind(Messages.BugHyperlink_HYPERLINK_LABEL, repository.getRepositoryLabel(), bug);
48
	}
49
50
	public String getTypeLabel() {
51
		return NLS.bind(Messages.BugHyperlink_HYPERLINK_LABEL, repository.getRepositoryLabel());
52
	}
53
54
	public void open() {
55
		IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport();
56
57
		IWebBrowser browser;
58
		try {
59
			StringBuffer sb = new StringBuffer(repository.getUrl());
60
			sb.append(CGI_QUERY);
61
			sb.append(bug.substring(BugHyperlinkDetector.DEFAULT_PREFIX.length()));
62
63
			URL webUrl = new URL(sb.toString());
64
			browser = browserSupport.createBrowser(IWorkbenchBrowserSupport.AS_EDITOR | IWorkbenchBrowserSupport.LOCATION_BAR | IWorkbenchBrowserSupport.NAVIGATION_BAR, repository.getConnectorKind(), bug, bug);
65
			browser.openURL(webUrl);
66
		} catch (Exception e) {
67
			Activator.getDefault().getLog().log(new Status(IStatus.WARNING, Activator.PLUGIN_ID, Messages.BugHyperlink_CANNOT_OPEN_BROWSER, e));
68
		}
69
	}
70
}
(-)src/org/eclipse/ecf/internal/mylyn/ui/messages.properties (+18 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
#    Composent, Inc. - initial API and implementation
10
#    Abner Ballardo <modlost@modlost.net> - bug 197991
11
################################################################################
12
13
##########################
14
# Messages for EN locale #
15
##########################
16
17
BugHyperlink_HYPERLINK_LABEL=Open {0} {1}
18
BugHyperlink_CANNOT_OPEN_BROWSER=Cannot open browser
(-)src/org/eclipse/ecf/internal/mylyn/ui/Messages.java (+29 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
 *    Composent, Inc. - initial API and implementation
10
 *    Abner Ballardo <modlost@modlost.net> - bug 197991
11
 *****************************************************************************/
12
package org.eclipse.ecf.internal.mylyn.ui;
13
14
import org.eclipse.osgi.util.NLS;
15
16
public class Messages {
17
	private static final String BUNDLE_NAME = "org.eclipse.ecf.internal.mylyn.ui.messages"; //$NON-NLS-1$
18
19
	public static String BugHyperlink_CANNOT_OPEN_BROWSER;
20
21
	public static String BugHyperlink_HYPERLINK_LABEL;
22
23
	public static String ChangePasswordDialog_CHANGE_PASSWORD;
24
25
	static {
26
		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
27
	}
28
29
}
(-)src/org/eclipse/ecf/internal/irc/ui/hyperlink/IRCChannelHyperlink.java (-6 / +4 lines)
Lines 10-30 Link Here
10
 ******************************************************************************/
10
 ******************************************************************************/
11
package org.eclipse.ecf.internal.irc.ui.hyperlink;
11
package org.eclipse.ecf.internal.irc.ui.hyperlink;
12
12
13
import org.eclipse.ecf.internal.irc.ui.Messages;
13
import org.eclipse.ecf.presence.chatroom.IChatRoomManager;
14
import org.eclipse.ecf.presence.chatroom.IChatRoomManager;
14
import org.eclipse.ecf.presence.ui.chatroom.ChatRoomManagerView;
15
import org.eclipse.ecf.presence.ui.chatroom.ChatRoomManagerView;
15
import org.eclipse.jface.text.IRegion;
16
import org.eclipse.jface.text.IRegion;
16
import org.eclipse.jface.text.Region;
17
import org.eclipse.jface.text.Region;
17
import org.eclipse.jface.text.hyperlink.IHyperlink;
18
import org.eclipse.jface.text.hyperlink.IHyperlink;
19
import org.eclipse.osgi.util.NLS;
18
20
19
public class IRCChannelHyperlink implements IHyperlink {
21
public class IRCChannelHyperlink implements IHyperlink {
20
	private final Region region;
22
	private final Region region;
21
23
22
	private final String channel;
24
	private final String channel;
23
25
24
	private String typeLabel;
25
26
	private String hyperlinkText;
27
28
	private final ChatRoomManagerView view;
26
	private final ChatRoomManagerView view;
29
27
30
	public IRCChannelHyperlink(ChatRoomManagerView view, String channel, Region region) {
28
	public IRCChannelHyperlink(ChatRoomManagerView view, String channel, Region region) {
Lines 38-48 Link Here
38
	}
36
	}
39
37
40
	public String getHyperlinkText() {
38
	public String getHyperlinkText() {
41
		return this.hyperlinkText;
39
		return NLS.bind(Messages.IRCChannelHyperlink_HYPERLINK_LABEL, channel);
42
	}
40
	}
43
41
44
	public String getTypeLabel() {
42
	public String getTypeLabel() {
45
		return this.typeLabel;
43
		return NLS.bind(Messages.IRCChannelHyperlink_HYPERLINK_LABEL, channel);
46
	}
44
	}
47
45
48
	public void open() {
46
	public void open() {
(-)src/org/eclipse/ecf/internal/irc/ui/messages.properties (+2 lines)
Lines 30-32 Link Here
30
IRCConnectWizardPage_CONNECTID_DEFAULT=ecfuser{0}@irc.freenode.net/#eclipse
30
IRCConnectWizardPage_CONNECTID_DEFAULT=ecfuser{0}@irc.freenode.net/#eclipse
31
31
32
IRCConnectWizard_WIZARD_TITLE=New IRC Connection
32
IRCConnectWizard_WIZARD_TITLE=New IRC Connection
33
34
IRCChannelHyperlink_HYPERLINK_LABEL=Open {0} channel 
(-)src/org/eclipse/ecf/internal/irc/ui/Messages.java (+1 lines)
Lines 35-40 Link Here
35
	public static String IRCUI_JOIN_COMMAND;
35
	public static String IRCUI_JOIN_COMMAND;
36
	public static String IRCUI_PART_COMMAND;
36
	public static String IRCUI_PART_COMMAND;
37
	public static String IRCUI_QUIT_COMMAND;
37
	public static String IRCUI_QUIT_COMMAND;
38
	public static String IRCChannelHyperlink_HYPERLINK_LABEL;
38
39
39
	public static String IRCConnectWizard_WIZARD_TITLE;
40
	public static String IRCConnectWizard_WIZARD_TITLE;
40
41
(-)plugin.properties (-1 / +1 lines)
Lines 44-47 Link Here
44
colorDefinition.sentMessagesColor.description = Color of messages sent by local user.
44
colorDefinition.sentMessagesColor.description = Color of messages sent by local user.
45
45
46
Chats=Chats
46
Chats=Chats
47
47
PresenceEditorsTarget=ECF Presence Editors
(-)plugin.xml (+7 lines)
Lines 298-301 Link Here
298
      </colorDefinition>
298
      </colorDefinition>
299
      
299
      
300
   </extension>
300
   </extension>
301
   <extension
302
         point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTargets">
303
      <target
304
            id="org.eclipse.ecf.presence"
305
            name="%PresenceEditorsTarget">
306
      </target>
307
   </extension>
301
</plugin>
308
</plugin>
(-)META-INF/MANIFEST.MF (-1 / +3 lines)
Lines 11-17 Link Here
11
 org.eclipse.ecf.presence,
11
 org.eclipse.ecf.presence,
12
 org.eclipse.ecf.ui,
12
 org.eclipse.ecf.ui,
13
 org.eclipse.ui,
13
 org.eclipse.ui,
14
 org.eclipse.ui.forms
14
 org.eclipse.ui.forms,
15
 org.eclipse.jface.text,
16
 org.eclipse.ui.workbench.texteditor
15
Eclipse-LazyStart: true
17
Eclipse-LazyStart: true
16
Export-Package: org.eclipse.ecf.internal.presence.ui;x-internal:=true,
18
Export-Package: org.eclipse.ecf.internal.presence.ui;x-internal:=true,
17
 org.eclipse.ecf.internal.presence.ui.dialogs;x-internal:=true,
19
 org.eclipse.ecf.internal.presence.ui.dialogs;x-internal:=true,
(-)src/org/eclipse/ecf/internal/presence/ui/messages.properties (-1 / +2 lines)
Lines 145-148 Link Here
145
MessageRenderer_DEFAULT_DATETIME_FORMAT=({0})
145
MessageRenderer_DEFAULT_DATETIME_FORMAT=({0})
146
146
147
ChatRoomPreferencePage_CHATROOM_SHOW_USER_PRESENCE_TEXT=&Show user entry messages
147
ChatRoomPreferencePage_CHATROOM_SHOW_USER_PRESENCE_TEXT=&Show user entry messages
148
 
148
 
149
ChatRoomViewerConfiguration_WARNING_MULTIHYPERLINK_NOT_AVAILABLE=Multihyperlink not available.  Multihyperlinking will be disabled.
(-)src/org/eclipse/ecf/internal/presence/ui/Messages.java (-14 / +16 lines)
Lines 17-23 Link Here
17
public class Messages extends NLS {
17
public class Messages extends NLS {
18
18
19
	private static final String BUNDLE_NAME = "org.eclipse.ecf.internal.presence.ui.messages"; //$NON-NLS-1$
19
	private static final String BUNDLE_NAME = "org.eclipse.ecf.internal.presence.ui.messages"; //$NON-NLS-1$
20
	
20
21
	public static String ChangePasswordDialog_1;
21
	public static String ChangePasswordDialog_1;
22
22
23
	public static String ChangePasswordDialog_CHANGE_PASSWORD;
23
	public static String ChangePasswordDialog_CHANGE_PASSWORD;
Lines 38-50 Link Here
38
	public static String ChatRoomManagerView_CLEAR_TEXT;
38
	public static String ChatRoomManagerView_CLEAR_TEXT;
39
39
40
	public static String ChatRoomManagerView_CLEAR_TOOLTIP;
40
	public static String ChatRoomManagerView_CLEAR_TOOLTIP;
41
	
41
42
	public static String ChatRoomManagerView_PASTE_TEXT;
42
	public static String ChatRoomManagerView_PASTE_TEXT;
43
	
43
44
	public static String ChatRoomManagerView_PASTE_TOOLTIP;
44
	public static String ChatRoomManagerView_PASTE_TOOLTIP;
45
	
45
46
	public static String ChatRoomManagerView_CLEAR_CONFIRM_TITLE;
46
	public static String ChatRoomManagerView_CLEAR_CONFIRM_TITLE;
47
	
47
48
	public static String ChatRoomManagerView_CLEAR_CONFIRM_MESSAGE;
48
	public static String ChatRoomManagerView_CLEAR_CONFIRM_MESSAGE;
49
49
50
	public static String ChatRoomManagerView_CLOSE_CHAT_ROOM_MESSAGE;
50
	public static String ChatRoomManagerView_CLOSE_CHAT_ROOM_MESSAGE;
Lines 68-78 Link Here
68
	public static String ChatRoomManagerView_DEFAULT_USER;
68
	public static String ChatRoomManagerView_DEFAULT_USER;
69
69
70
	public static String ChatRoomManagerView_ENTERED_MESSAGE;
70
	public static String ChatRoomManagerView_ENTERED_MESSAGE;
71
	
71
72
	public static String ChatRoomManagerView_LEFT_MESSAGE;
72
	public static String ChatRoomManagerView_LEFT_MESSAGE;
73
73
74
	public static String ChatRoomManagerView_JOIN_COMMAND;
74
	public static String ChatRoomManagerView_JOIN_COMMAND;
75
	
75
76
	public static String ChatRoomManagerView_MESSAGE;
76
	public static String ChatRoomManagerView_MESSAGE;
77
77
78
	public static String ChatRoomManagerView_NOT_CONNECTED_MESSAGE;
78
	public static String ChatRoomManagerView_NOT_CONNECTED_MESSAGE;
Lines 80-86 Link Here
80
	public static String ChatRoomManagerView_NOT_CONNECTED_TITLE;
80
	public static String ChatRoomManagerView_NOT_CONNECTED_TITLE;
81
81
82
	public static String ChatRoomManagerView_QUIT_COMMAND;
82
	public static String ChatRoomManagerView_QUIT_COMMAND;
83
	
83
84
	public static String ChatRoomManagerView_PART_COMMAND;
84
	public static String ChatRoomManagerView_PART_COMMAND;
85
85
86
	public static String ChatRoomManagerView_SELECT_ALL_TEXT;
86
	public static String ChatRoomManagerView_SELECT_ALL_TEXT;
Lines 97-102 Link Here
97
97
98
	public static String ChatRoomManagerView_USERS_IN_CHAT_ROOM;
98
	public static String ChatRoomManagerView_USERS_IN_CHAT_ROOM;
99
99
100
	public static String ChatRoomViewerConfiguration_WARNING_MULTIHYPERLINK_NOT_AVAILABLE;
101
100
	public static String ChatRoomSelectionDialog_ACCOUNT_COLUMN;
102
	public static String ChatRoomSelectionDialog_ACCOUNT_COLUMN;
101
103
102
	public static String ChatRoomSelectionDialog_DESCRIPTION_COLUMN;
104
	public static String ChatRoomSelectionDialog_DESCRIPTION_COLUMN;
Lines 201-207 Link Here
201
	public static String MessagesView_TypingNotification;
203
	public static String MessagesView_TypingNotification;
202
	public static String MessagesView_Copy;
204
	public static String MessagesView_Copy;
203
	public static String MessagesView_SelectAll;
205
	public static String MessagesView_SelectAll;
204
	
206
205
	public static String AddContactDialog_DialogTitle;
207
	public static String AddContactDialog_DialogTitle;
206
	public static String AddContactDialog_UserID;
208
	public static String AddContactDialog_UserID;
207
	public static String AddContactDialog_Alias;
209
	public static String AddContactDialog_Alias;
Lines 220-244 Link Here
220
	public static String ReceiveAuthorizeRequestDialog_TO_BUDDY_LIST;
222
	public static String ReceiveAuthorizeRequestDialog_TO_BUDDY_LIST;
221
223
222
	public static String ReceiveAuthorizeRequestDialog_WOULD_LIKE_TO_ADD;
224
	public static String ReceiveAuthorizeRequestDialog_WOULD_LIKE_TO_ADD;
223
	
225
224
	public static String RosterWorkbenchAdapterFactory_Mode;
226
	public static String RosterWorkbenchAdapterFactory_Mode;
225
	public static String RosterWorkbenchAdapterFactory_Type;
227
	public static String RosterWorkbenchAdapterFactory_Type;
226
	public static String RosterWorkbenchAdapterFactory_Account;
228
	public static String RosterWorkbenchAdapterFactory_Account;
227
	public static String RosterWorkbenchAdapterFactory_Disconnected;
229
	public static String RosterWorkbenchAdapterFactory_Disconnected;
228
	public static String RosterWorkbenchAdapterFactory_GroupLabel;
230
	public static String RosterWorkbenchAdapterFactory_GroupLabel;
229
	
231
230
	public static String BrowseDialog_title;
232
	public static String BrowseDialog_title;
231
	public static String BrowseDialog_scanning;
233
	public static String BrowseDialog_scanning;
232
	public static String BrowseDialog_message;
234
	public static String BrowseDialog_message;
233
	
235
234
	public static String ToggleOnlineOnlyAction_title;
236
	public static String ToggleOnlineOnlyAction_title;
235
237
236
	public static String MessageRenderer_DEFAULT_DATE_FORMAT;
238
	public static String MessageRenderer_DEFAULT_DATE_FORMAT;
237
	public static String MessageRenderer_DEFAULT_DATETIME_FORMAT;
239
	public static String MessageRenderer_DEFAULT_DATETIME_FORMAT;
238
	public static String MessageRenderer_DEFAULT_TIME_FORMAT;
240
	public static String MessageRenderer_DEFAULT_TIME_FORMAT;
239
	
241
240
	public static String ChatRoomPreferencePage_CHATROOM_SHOW_USER_PRESENCE_TEXT;
242
	public static String ChatRoomPreferencePage_CHATROOM_SHOW_USER_PRESENCE_TEXT;
241
	
243
242
	static {
244
	static {
243
		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
245
		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
244
	}
246
	}
(-)src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomViewerConfiguration.java (+21 lines)
Lines 1-27 Link Here
1
package org.eclipse.ecf.presence.ui.chatroom;
1
package org.eclipse.ecf.presence.ui.chatroom;
2
2
3
import java.util.Map;
3
import java.util.Map;
4
import org.eclipse.core.runtime.IStatus;
5
import org.eclipse.core.runtime.Status;
6
import org.eclipse.ecf.internal.presence.ui.Activator;
7
import org.eclipse.ecf.internal.presence.ui.Messages;
4
import org.eclipse.ecf.presence.chatroom.IChatRoomContainer;
8
import org.eclipse.ecf.presence.chatroom.IChatRoomContainer;
5
import org.eclipse.jface.preference.IPreferenceStore;
9
import org.eclipse.jface.preference.IPreferenceStore;
10
import org.eclipse.jface.text.hyperlink.IHyperlinkPresenter;
11
import org.eclipse.jface.text.hyperlink.MultipleHyperlinkPresenter;
6
import org.eclipse.jface.text.source.ISourceViewer;
12
import org.eclipse.jface.text.source.ISourceViewer;
7
import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
13
import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
8
14
9
public class ChatRoomViewerConfiguration extends TextSourceViewerConfiguration {
15
public class ChatRoomViewerConfiguration extends TextSourceViewerConfiguration {
10
16
17
	private static final String DEFAULT_PRESENCE_TARGET = "org.eclipse.ecf.presence"; //$NON-NLS-1$
18
11
	private IChatRoomContainer container;
19
	private IChatRoomContainer container;
12
20
13
	private ChatRoomManagerView view;
21
	private ChatRoomManagerView view;
14
22
23
	private IPreferenceStore preferenceStore;
24
15
	public ChatRoomViewerConfiguration(IPreferenceStore preferenceStore, IChatRoomContainer container, ChatRoomManagerView view) {
25
	public ChatRoomViewerConfiguration(IPreferenceStore preferenceStore, IChatRoomContainer container, ChatRoomManagerView view) {
16
		super(preferenceStore);
26
		super(preferenceStore);
27
		this.preferenceStore = preferenceStore;
17
		this.container = container;
28
		this.container = container;
18
		this.view = view;
29
		this.view = view;
19
	}
30
	}
20
31
21
	protected Map getHyperlinkDetectorTargets(ISourceViewer sourceViewer) {
32
	protected Map getHyperlinkDetectorTargets(ISourceViewer sourceViewer) {
22
		Map hyperlinkDetectorTargets = super.getHyperlinkDetectorTargets(sourceViewer);
33
		Map hyperlinkDetectorTargets = super.getHyperlinkDetectorTargets(sourceViewer);
34
		hyperlinkDetectorTargets.put(DEFAULT_PRESENCE_TARGET, null);
23
		hyperlinkDetectorTargets.put(container.getClass().getPackage().getName(), view);
35
		hyperlinkDetectorTargets.put(container.getClass().getPackage().getName(), view);
24
36
25
		return hyperlinkDetectorTargets;
37
		return hyperlinkDetectorTargets;
26
	}
38
	}
39
40
	public IHyperlinkPresenter getHyperlinkPresenter(ISourceViewer sourceViewer) {
41
		try {
42
			return new MultipleHyperlinkPresenter(preferenceStore);
43
		} catch (NoClassDefFoundError e) {
44
			Activator.getDefault().getLog().log(new Status(IStatus.WARNING, Activator.PLUGIN_ID, Messages.ChatRoomViewerConfiguration_WARNING_MULTIHYPERLINK_NOT_AVAILABLE, e));
45
		}
46
		return super.getHyperlinkPresenter(sourceViewer);
47
	}
27
}
48
}

Return to bug 197991