Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: d4ad3e5f54d5ae11d206ff9cb9ab803347c81b41 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*******************************************************************************
 * Copyright (c) 2011, 2012 IBM Corporation 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:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.ptp.rdt.ui.serviceproviders;

import org.eclipse.ptp.internal.rdt.core.serviceproviders.AbstractLocalCIndexServiceProvider;
import org.eclipse.ptp.internal.rdt.ui.contentassist.IContentAssistService;
import org.eclipse.ptp.internal.rdt.ui.contentassist.LocalContentAssistService;
import org.eclipse.ptp.internal.rdt.ui.editor.IRemoteCCodeFoldingService;
import org.eclipse.ptp.internal.rdt.ui.editor.IRemoteSemanticHighlightingService;
import org.eclipse.ptp.internal.rdt.ui.editor.RemoteCCodeFoldingService;
import org.eclipse.ptp.internal.rdt.ui.editor.RemoteSemanticHighlightingService;
import org.eclipse.ptp.internal.rdt.ui.navigation.INavigationService;
import org.eclipse.ptp.internal.rdt.ui.navigation.LocalNavigationService;
import org.eclipse.ptp.internal.rdt.ui.search.ISearchService;
import org.eclipse.ptp.internal.rdt.ui.search.LocalSearchService;

/**
 * @author mikek
 * @since 4.0
 *
 */
public class LocalCIndexServiceProvider extends AbstractLocalCIndexServiceProvider implements IIndexServiceProvider2 {
	public static final String ID = "org.eclipse.ptp.rdt.ui.LocalCIndexServiceProvider"; //$NON-NLS-1$

	private ISearchService fSearchService;
	private IContentAssistService fContentAssistService;
	private INavigationService fNavigationService;
	private IRemoteSemanticHighlightingService fRemoteSemanticHighlightingService;
	private IRemoteCCodeFoldingService fRemoteCCodeFoldingService;
	
	public boolean isRemote() {
		return false;
	}
	
	public synchronized INavigationService getNavigationService() {
		if(fNavigationService == null)
			fNavigationService = new LocalNavigationService();
		return fNavigationService;
	}
	
	public synchronized ISearchService getSearchService() {
		if(fSearchService == null)
			fSearchService = new LocalSearchService();
		return fSearchService;
	}

	public synchronized IContentAssistService getContentAssistService() {
		if(fContentAssistService == null)
			fContentAssistService = new LocalContentAssistService();
		return fContentAssistService;
	}

	/**
	 * @since 4.1
	 */
	public IRemoteSemanticHighlightingService getRemoteSemanticHighlightingService() {
		if(!isConfigured())
			return null;

		if(fRemoteSemanticHighlightingService== null)
			fRemoteSemanticHighlightingService = new RemoteSemanticHighlightingService(fConnectorService);

		return fRemoteSemanticHighlightingService;
	}

	/**
	 * @since 4.1
	 */
	public IRemoteCCodeFoldingService getRemoteCodeFoldingService() {
		if(!isConfigured())
			return null;

		if(fRemoteCCodeFoldingService== null)
			fRemoteCCodeFoldingService = new RemoteCCodeFoldingService(fConnectorService);

		return fRemoteCCodeFoldingService;
	}
}

Back to the top