當前位置: 首頁>>代碼示例>>Java>>正文


Java IPath.toOSString方法代碼示例

本文整理匯總了Java中org.eclipse.core.runtime.IPath.toOSString方法的典型用法代碼示例。如果您正苦於以下問題:Java IPath.toOSString方法的具體用法?Java IPath.toOSString怎麽用?Java IPath.toOSString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.core.runtime.IPath的用法示例。


在下文中一共展示了IPath.toOSString方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getFinalAssemblyDefinition

import org.eclipse.core.runtime.IPath; //導入方法依賴的package包/類
public CompositeNode getFinalAssemblyDefinition(String name, String containerName) {
	CompositeNode ret = null;
	if (containerName != null) {
		String[] names = StringUtils.split(containerName, "/");
		IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
		IResource resource = wsRoot.findMember(new Path("/" + names[0]));
		IPath loc = resource.getLocation();
		File file = new File(loc.toOSString() + File.separator + name + ".fassmbl");
		try {
			ret = ParseUtil.getFinalAssemblyNodeFromText(FileUtils.readFileToString(file));
		} catch (IOException e) {
			EclipseUtil.writeStactTraceToConsole(e);
		}
	}
	return ret;
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:17,代碼來源:PluginUtil.java

示例2: getLogicalSystemDefinition

import org.eclipse.core.runtime.IPath; //導入方法依賴的package包/類
public LogicalSystemNode getLogicalSystemDefinition(String name, String containerName) {
	LogicalSystemNode ret = null;
	if (containerName != null) {
		String[] names = StringUtils.split(containerName, "/");
		IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
		IResource resource = wsRoot.findMember(new Path("/" + names[0]));
		IPath loc = resource.getLocation();
		File file = new File(loc.toOSString() + File.separator + name + ".lsys");
		try {
			ret = ParseUtil.getLogicalSystemNodeFromText(FileUtils.readFileToString(file));
		} catch (IOException e) {
			EclipseUtil.writeStactTraceToConsole(e);
		}
	}
	return ret;
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:17,代碼來源:PluginUtil.java

示例3: getComponentImplementationDefinition

import org.eclipse.core.runtime.IPath; //導入方法依賴的package包/類
public ComponentImplementationNode getComponentImplementationDefinition(String name, String containerName) {
	ComponentImplementationNode ret = null;
	if (containerName != null) {
		String[] names = StringUtils.split(containerName, "/");
		IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
		IResource resource = wsRoot.findMember(new Path("/" + names[0]));
		IPath loc = resource.getLocation();
		File file = new File(loc.toOSString() + File.separator + name + ".cimpl");
		try {
			ret = ParseUtil.getComponentImplementationNodeFromText(FileUtils.readFileToString(file));
		} catch (IOException e) {
			EclipseUtil.writeStactTraceToConsole(e);
		}
	}
	return ret;
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:17,代碼來源:PluginUtil.java

示例4: addBreakpointToMap

import org.eclipse.core.runtime.IPath; //導入方法依賴的package包/類
private void addBreakpointToMap(IBreakpoint breakpoint) throws CoreException {
	Assert.isTrue(supportsBreakpoint(breakpoint) && breakpoint instanceof ILineBreakpoint);
	if (breakpoint instanceof ILineBreakpoint) {
		ILineBreakpoint lineBreakpoint = (ILineBreakpoint) breakpoint;
		IResource resource = lineBreakpoint.getMarker().getResource();
		IPath location = resource.getLocation();
		String path = location.toOSString();
		String name = location.lastSegment();
		int lineNumber = lineBreakpoint.getLineNumber();

		Source source = new Source().setName(name).setPath(path);

		List<SourceBreakpoint> sourceBreakpoints = targetBreakpoints.computeIfAbsent(source,
				s -> new ArrayList<>());
		sourceBreakpoints.add(new SourceBreakpoint().setLine(lineNumber));
	}
}
 
開發者ID:tracymiranda,項目名稱:dsp4e,代碼行數:18,代碼來源:DSPDebugTarget.java

示例5: deleteBreakpointFromMap

import org.eclipse.core.runtime.IPath; //導入方法依賴的package包/類
private void deleteBreakpointFromMap(IBreakpoint breakpoint) throws CoreException {
	Assert.isTrue(supportsBreakpoint(breakpoint) && breakpoint instanceof ILineBreakpoint);
	if (breakpoint instanceof ILineBreakpoint) {
		ILineBreakpoint lineBreakpoint = (ILineBreakpoint) breakpoint;
		IResource resource = lineBreakpoint.getMarker().getResource();
		IPath location = resource.getLocation();
		String path = location.toOSString();
		String name = location.lastSegment();
		int lineNumber = lineBreakpoint.getLineNumber();
		for (Entry<Source, List<SourceBreakpoint>> entry : targetBreakpoints.entrySet()) {
			Source source = entry.getKey();
			if (Objects.equals(name, source.name) && Objects.equals(path, source.path)) {
				List<SourceBreakpoint> bps = entry.getValue();
				for (Iterator<SourceBreakpoint> iterator = bps.iterator(); iterator.hasNext();) {
					SourceBreakpoint sourceBreakpoint = (SourceBreakpoint) iterator.next();
					if (Objects.equals(lineNumber, sourceBreakpoint.line)) {
						iterator.remove();
					}
				}
			}
		}
	}
}
 
開發者ID:tracymiranda,項目名稱:dsp4e,代碼行數:24,代碼來源:DSPDebugTarget.java

示例6: getSchemaFile

import org.eclipse.core.runtime.IPath; //導入方法依賴的package包/類
private java.io.File getSchemaFile(String externalSchemaPath) {
	java.io.File schemaFile = null;
	IPath location = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(externalSchemaPath)).getLocation();
	if (location != null) {
		if (!(location.toOSString().endsWith(SCHEMA_FILE_EXTENSION))
				&& !(location.toOSString().endsWith(XML_FILE_EXTENSION))) {
			schemaFile = new java.io.File(location.toOSString().concat(SCHEMA_FILE_EXTENSION));
		} else {
			schemaFile = new java.io.File(location.toOSString());
		}
	}
	return schemaFile;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:14,代碼來源:ExternalSchemaUpdaterHandler.java

示例7: visit

import org.eclipse.core.runtime.IPath; //導入方法依賴的package包/類
/**
 * Answers whether children should be visited.
 * <p>
 * If the associated resource is a class file which has been changed, record it.
 * </p>
 */
@Override
public boolean visit(IResourceDelta delta) {
    if (delta == null || 0 == (delta.getKind() & IResourceDelta.CHANGED)) {
        return false;
    }
    IResource resource = delta.getResource();
    if (resource != null) {
        switch (resource.getType()) {
            case IResource.FILE:
                if (0 == (delta.getFlags() & IResourceDelta.CONTENT)) {
                    return false;
                }
                if (CLASS_FILE_EXTENSION.equals(resource.getFullPath().getFileExtension())) {
                    IPath localLocation = resource.getLocation();
                    if (localLocation != null) {
                        String path = localLocation.toOSString();
                        IClassFileReader reader = ToolFactory.createDefaultClassFileReader(path,
                                IClassFileReader.CLASSFILE_ATTRIBUTES);
                        if (reader != null) {
                            // this name is slash-delimited
                            String qualifiedName = new String(reader.getClassName());
                            boolean hasBlockingErrors = false;
                            try {
                                // If the user doesn't want to replace
                                // classfiles containing
                                // compilation errors, get the source
                                // file associated with
                                // the class file and query it for
                                // compilation errors
                                IJavaProject pro = JavaCore.create(resource.getProject());
                                ISourceAttribute sourceAttribute = reader.getSourceFileAttribute();
                                String sourceName = null;
                                if (sourceAttribute != null) {
                                    sourceName = new String(sourceAttribute.getSourceFileName());
                                }
                                IResource sourceFile = getSourceFile(pro, qualifiedName, sourceName);
                                if (sourceFile != null) {
                                    IMarker[] problemMarkers = null;
                                    problemMarkers = sourceFile.findMarkers(
                                            IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true,
                                            IResource.DEPTH_INFINITE);
                                    for (IMarker problemMarker : problemMarkers) {
                                        if (problemMarker.getAttribute(IMarker.SEVERITY,
                                                -1) == IMarker.SEVERITY_ERROR) {
                                            hasBlockingErrors = true;
                                            break;
                                        }
                                    }
                                }
                            } catch (CoreException e) {
                                logger.log(Level.SEVERE, "Failed to visit classes: " + e.getMessage(), e);
                            }
                            if (!hasBlockingErrors) {
                                changedFiles.add(resource);
                                // dot-delimit the name
                                fullyQualifiedNames.add(qualifiedName.replace('/', '.'));
                            }
                        }
                    }
                }
                return false;

            default:
                return true;
        }
    }
    return true;
}
 
開發者ID:Microsoft,項目名稱:java-debug,代碼行數:75,代碼來源:JavaHotCodeReplaceProvider.java


注:本文中的org.eclipse.core.runtime.IPath.toOSString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。