Lines 11-16
Link Here
|
11 |
package org.eclipse.cdt.core.model; |
11 |
package org.eclipse.cdt.core.model; |
12 |
|
12 |
|
13 |
|
13 |
|
|
|
14 |
import java.util.ArrayList; |
15 |
|
14 |
import org.eclipse.cdt.core.CCProjectNature; |
16 |
import org.eclipse.cdt.core.CCProjectNature; |
15 |
import org.eclipse.cdt.core.CCorePlugin; |
17 |
import org.eclipse.cdt.core.CCorePlugin; |
16 |
import org.eclipse.cdt.core.CProjectNature; |
18 |
import org.eclipse.cdt.core.CProjectNature; |
Lines 41-46
Link Here
|
41 |
import org.eclipse.core.runtime.CoreException; |
43 |
import org.eclipse.core.runtime.CoreException; |
42 |
import org.eclipse.core.runtime.IPath; |
44 |
import org.eclipse.core.runtime.IPath; |
43 |
import org.eclipse.core.runtime.IProgressMonitor; |
45 |
import org.eclipse.core.runtime.IProgressMonitor; |
|
|
46 |
import org.eclipse.core.runtime.Plugin; |
44 |
import org.eclipse.core.runtime.content.IContentType; |
47 |
import org.eclipse.core.runtime.content.IContentType; |
45 |
import org.eclipse.core.runtime.jobs.ISchedulingRule; |
48 |
import org.eclipse.core.runtime.jobs.ISchedulingRule; |
46 |
|
49 |
|
Lines 185-197
Link Here
|
185 |
* @return String[] ids |
188 |
* @return String[] ids |
186 |
*/ |
189 |
*/ |
187 |
public static String[] getRegistedContentTypeIds() { |
190 |
public static String[] getRegistedContentTypeIds() { |
188 |
return new String[] { |
191 |
ArrayList a = LanguageManager.getInstance().getAllContentTypes(); |
189 |
CCorePlugin.CONTENT_TYPE_ASMSOURCE, |
192 |
String[] result = new String[a.size()]; |
190 |
CCorePlugin.CONTENT_TYPE_CHEADER, |
193 |
a.toArray(result); |
191 |
CCorePlugin.CONTENT_TYPE_CSOURCE, |
194 |
return result; |
192 |
CCorePlugin.CONTENT_TYPE_CXXHEADER, |
|
|
193 |
CCorePlugin.CONTENT_TYPE_CXXSOURCE |
194 |
}; |
195 |
} |
195 |
} |
196 |
|
196 |
|
197 |
/** |
197 |
/** |
Lines 201-217
Link Here
|
201 |
IContentType contentType = CCorePlugin.getContentType(project, name); |
201 |
IContentType contentType = CCorePlugin.getContentType(project, name); |
202 |
if (contentType != null) { |
202 |
if (contentType != null) { |
203 |
String id = contentType.getId(); |
203 |
String id = contentType.getId(); |
204 |
if (CCorePlugin.CONTENT_TYPE_CHEADER.equals(id)) { |
204 |
return CCorePlugin.CONTENT_TYPE_CHEADER.equals(id) |
205 |
return true; |
205 |
|| CCorePlugin.CONTENT_TYPE_CXXHEADER.equals(id) |
206 |
} else if (CCorePlugin.CONTENT_TYPE_CXXHEADER.equals(id)) { |
206 |
|| CCorePlugin.CONTENT_TYPE_CSOURCE.equals(id) |
207 |
return true; |
207 |
|| CCorePlugin.CONTENT_TYPE_CXXSOURCE.equals(id) |
208 |
} else if (CCorePlugin.CONTENT_TYPE_CSOURCE.equals(id)) { |
208 |
|| CCorePlugin.CONTENT_TYPE_ASMSOURCE.equals(id) |
209 |
return true; |
209 |
|| LanguageManager.getInstance().isContributedContentType(id); |
210 |
} else if (CCorePlugin.CONTENT_TYPE_CXXSOURCE.equals(id)) { |
|
|
211 |
return true; |
212 |
} else if (CCorePlugin.CONTENT_TYPE_ASMSOURCE.equals(id)) { |
213 |
return true; |
214 |
} |
215 |
} |
210 |
} |
216 |
return false; |
211 |
return false; |
217 |
} |
212 |
} |
Lines 239-251
Link Here
|
239 |
IContentType contentType = CCorePlugin.getContentType(project, name); |
234 |
IContentType contentType = CCorePlugin.getContentType(project, name); |
240 |
if (contentType != null) { |
235 |
if (contentType != null) { |
241 |
String id = contentType.getId(); |
236 |
String id = contentType.getId(); |
242 |
if (CCorePlugin.CONTENT_TYPE_CSOURCE.equals(id)) { |
237 |
return CCorePlugin.CONTENT_TYPE_CSOURCE.equals(id) |
243 |
return true; |
238 |
|| CCorePlugin.CONTENT_TYPE_CXXSOURCE.equals(id) |
244 |
} else if (CCorePlugin.CONTENT_TYPE_CXXSOURCE.equals(id)) { |
239 |
|| CCorePlugin.CONTENT_TYPE_ASMSOURCE.equals(id) |
245 |
return true; |
240 |
|| LanguageManager.getInstance().isContributedContentType(id); |
246 |
} else if (CCorePlugin.CONTENT_TYPE_ASMSOURCE.equals(id)) { |
|
|
247 |
return true; |
248 |
} |
249 |
} |
241 |
} |
250 |
return false; |
242 |
return false; |
251 |
} |
243 |
} |