本文整理汇总了Java中org.eclipse.cdt.core.model.ICProject类的典型用法代码示例。如果您正苦于以下问题:Java ICProject类的具体用法?Java ICProject怎么用?Java ICProject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICProject类属于org.eclipse.cdt.core.model包,在下文中一共展示了ICProject类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: parse
import org.eclipse.cdt.core.model.ICProject; //导入依赖的package包/类
public boolean parse() {
Activator.log(IStatus.INFO, "Copying source files in local project");
ICProject cproject = createEclipseProject(DEFAULT_PROJECT_NAME, userProjectDir);
if (cproject == null) {
// could not create the project :-(
return false;
}
projectPrefix = cproject.getLocationURI().getPath() + File.separator + (windows ? SOURCE_ROOT_DIR.toLowerCase() : SOURCE_ROOT_DIR) + File.separator;
configIndexer(cproject);
computeIndex(cproject);
try {
runAllVisitors(dico, cproject);
} catch (CoreException e) {
e.printStackTrace();
return false;
}
return true;
}
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:23,代码来源:VerveineCParser.java
示例2: visit
import org.eclipse.cdt.core.model.ICProject; //导入依赖的package包/类
@Override
public boolean visit(ICElement elt) {
switch (elt.getElementType()) {
case ICElement.C_PROJECT:
visit( (ICProject) elt);
break;
case ICElement.C_CCONTAINER:
visit( (ICContainer) elt);
break;
case ICElement.C_UNIT:
visit( (ITranslationUnit) elt);
break;
case ICElement.C_INCLUDE:
visit( (IInclude) elt);
break;
default:
// I believe this should never happen
}
return false;
}
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:22,代码来源:AbstractDispatcherVisitor.java
示例3: getBinaryFiles
import org.eclipse.cdt.core.model.ICProject; //导入依赖的package包/类
/**
* Iterate through and suck up all of the executable files that we can find.
*
* This code was taken from org.eclipse.cdt.launch.ui.CMainTab.java
*/
protected IBinary[] getBinaryFiles(final ICProject cproject) {
final Display display;
if (cproject == null || !cproject.exists()) {
return null;
}
if (getShell() == null) {
display = LaunchUIPlugin.getShell().getDisplay();
} else {
display = getShell().getDisplay();
}
final Object[] ret = new Object[1];
BusyIndicator.showWhile(display, new Runnable() {
public void run() {
try {
ret[0] = cproject.getBinaryContainer().getBinaries();
} catch (CModelException e) {
LaunchUIPlugin.errorDialog("Launch UI internal error", e); //$NON-NLS-1$
}
}
});
return (IBinary[])ret[0];
}
开发者ID:MaratMingazov,项目名称:CMemvit,代码行数:30,代码来源:MemvitConfigurationTab.java
示例4: getFromCDT
import org.eclipse.cdt.core.model.ICProject; //导入依赖的package包/类
public IExplorable getFromCDT(ICElement cele) {
String path = null;
// project
if (cele instanceof ICProject) {
path = ((ICProject) cele).getProject().getLocation().toOSString();
return new Explorer(path, null);
}
else if (cele instanceof IIncludeFileEntry) {
path = ((IIncludeFileEntry) cele).getFullIncludeFilePath()
.toOSString();
return new Explorer(null, path);
}
else if (cele instanceof IInclude) {
path = ((IInclude) cele).getParent().getPath().toOSString();
return new Explorer(null, path);
}
// other
else {
IResource res = cele.getResource();
if (res != null) {
return ExplorerPlugin.getFromResource(res);
}
}
return null;
}
开发者ID:Jamling,项目名称:eclipse-explorer,代码行数:26,代码来源:CdtAdapterFactory.java
示例5: computeIndex
import org.eclipse.cdt.core.model.ICProject; //导入依赖的package包/类
private void computeIndex(ICProject cproject) {
Activator.log(IStatus.INFO, "Indexing source files");
IIndexManager imanager = CCorePlugin.getIndexManager();
imanager.setIndexerId(cproject, "org.eclipse.cdt.core.fastIndexer");
imanager.reindex(cproject);
imanager.joinIndexer(IIndexManager.FOREVER, Constants.NULL_PROGRESS_MONITOR );
try {
this.index = imanager.getIndex(cproject);
} catch (CoreException e) {
e.printStackTrace();
}
}
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:14,代码来源:VerveineCParser.java
示例6: visit
import org.eclipse.cdt.core.model.ICProject; //导入依赖的package包/类
public void visit(ICProject project) {
projPath = project.getLocationURI().getRawPath();
int i = projPath.lastIndexOf(File.separator);
if (i > 0) {
projPath=projPath.substring(0, i);
}
super.visit(project);
}
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:9,代码来源:IncludeVisitor.java
示例7: doSetupProject
import org.eclipse.cdt.core.model.ICProject; //导入依赖的package包/类
private void doSetupProject(IProject project, IProgressMonitor monitor) throws CoreException, IOException {
CommandBuilder builder = new CommandBuilder();
appendEclipseProjectSetup(builder);
appendArchitectureVariables(builder, ProjectSettingsAccessor.retrieveToolchain(project));
appendBuildTypeVariables(builder, ProjectSettingsAccessor.retrieveBuildType(project));
builder.append(Activator.getCmakeArgs());
builder.execute(project);
project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
// now relink symbolic links
copyProjectFiles(project);
ICProject cproject = CoreModel.getDefault().create(project);
CCorePlugin.getIndexManager().reindex(cproject);
}
开发者ID:USESystemEngineeringBV,项目名称:cmake-eclipse-helper,代码行数:15,代码来源:CMakeLauncher.java
示例8: doChangeArchitecture
import org.eclipse.cdt.core.model.ICProject; //导入依赖的package包/类
private void doChangeArchitecture(IProject project, String architecture, IProgressMonitor monitor) throws CoreException, IOException {
CommandBuilder builder = new CommandBuilder();
appendEclipseProjectSetup(builder);
appendArchitectureVariables(builder, architecture);
appendBuildTypeVariables(builder, ProjectSettingsAccessor.retrieveBuildType(project));
builder.execute(project);
project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
copyProjectFiles(project, architecture);
ProjectSettingsAccessor.removeAbsoluteProjectPath(project);
ICProject cproject = CoreModel.getDefault().create(project);
CCorePlugin.getIndexManager().reindex(cproject);
}
开发者ID:USESystemEngineeringBV,项目名称:cmake-eclipse-helper,代码行数:14,代码来源:CMakeLauncher.java
示例9: selectionChanged
import org.eclipse.cdt.core.model.ICProject; //导入依赖的package包/类
/**
* @see IActionDelegate#selectionChanged(IAction, ISelection)
*/
public void selectionChanged(IAction action, ISelection selection) {
fContainer = new ArrayList<IContainer>();
boolean enabled = false;
if (selection instanceof IStructuredSelection)
{
IStructuredSelection sel = (IStructuredSelection) selection;
for (Iterator<Object> iterator = sel.iterator(); iterator.hasNext();)
{
Object obj = iterator.next();
if (obj instanceof ICElement) {
if ( obj instanceof ICContainer || obj instanceof ICProject) {
fContainer.add((IContainer) ((ICElement) obj).getUnderlyingResource());
} else {
obj = ((ICElement)obj).getResource();
if ( obj != null) {
fContainer.add(((IResource)obj).getParent());
}
}
} else if (obj instanceof IResource) {
if (obj instanceof IContainer) {
fContainer.add((IContainer) obj);
} else {
fContainer.add(((IResource)obj).getParent());
}
} else {
}
}
if (!fContainer.isEmpty()) {
enabled = true;
}
}
action.setEnabled(enabled);
}
开发者ID:rungemar,项目名称:cmake4cdt,代码行数:37,代码来源:RunCMakeAction.java
示例10: createIndexBasedAST
import org.eclipse.cdt.core.model.ICProject; //导入依赖的package包/类
public static IASTTranslationUnit createIndexBasedAST(IIndex index, ICProject project, IFile file) throws CModelException, CoreException {
ICElement elem = project.findElement(file.getFullPath());
if (elem instanceof ITranslationUnit) {
ITranslationUnit tu = (ITranslationUnit) elem;
return tu.getAST(index, ITranslationUnit.AST_SKIP_INDEXED_HEADERS);
}
Assert.fail("Could not create AST for " + file.getFullPath());
return null;
}
开发者ID:magicsky,项目名称:sya,代码行数:10,代码来源:TestSourceReader.java
示例11: runAllVisitors
import org.eclipse.cdt.core.model.ICProject; //导入依赖的package包/类
private void runAllVisitors(CDictionary dico, ICProject cproject) throws CoreException {
/*Having very specialized visitors helps because each one is simpler
* so it is worth the impact on execution time
* Note that the order is important, the visitors are not independent */
IncludeVisitor incVisitor;
incVisitor = new IncludeVisitor(dico, index, projectPrefix);
cproject.accept(incVisitor);
int nbUI = 0;
for (@SuppressWarnings("unused") String ui : incVisitor.getUnresolvedIncludes()) {
nbUI++;
}
modelComment(nbUI + " unresolved includes:", incVisitor.getUnresolvedIncludes());
incVisitor.reportUnresolvedIncludes();
cproject.accept(new PackageDefVisitor(dico));
if (!cModel) {
cproject.accept(new NamespaceDefVisitor(dico, index, projectPrefix));
}
cproject.accept(new TypeDefVisitor(dico, index, projectPrefix));
BehaviouralDefVisitor behavVisitor = new BehaviouralDefVisitor(dico, index, projectPrefix); // must be after class definitions
behavVisitor.setHeaderFiles(true);
cproject.accept(behavVisitor);
behavVisitor.setHeaderFiles(false);
cproject.accept(behavVisitor);
if (!cModel) {
cproject.accept(new TemplateParameterDefVisitor(dico, index, projectPrefix)); // must be after method definitions (possible template)
}
cproject.accept(new AttributeGlobalVarDefVisitor(dico, index, projectPrefix)); // must be after class/struct/enum definitions
if (!cModel) {
cproject.accept(new InheritanceRefVisitor(dico, index, projectPrefix));
}
cproject.accept(new DeclaredTypeRefVisitor(dico, index, projectPrefix));
cproject.accept(new InvocationAccessRefVisitor(dico, index, projectPrefix));
cproject.accept(new ReferenceRefVisitor(dico, index, projectPrefix));
cproject.accept(new CommentDefVisitor(dico, index, projectPrefix));
cproject.accept(new PreprocessorStmtDefVisitor(dico, index, projectPrefix));
}
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:43,代码来源:VerveineCParser.java
注:本文中的org.eclipse.cdt.core.model.ICProject类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论