PTP
Release 7.0

org.eclipse.ptp.pldt.common.util
Class Utility

java.lang.Object
  extended by org.eclipse.ptp.pldt.common.util.Utility

public class Utility
extends java.lang.Object

Various function/methods of use, Originally in OpenMP analysis but used more generally now


Nested Class Summary
static class Utility.Location
           
 
Constructor Summary
Utility()
           
 
Method Summary
static org.eclipse.jface.text.IDocument getDocument(org.eclipse.core.resources.IFile file)
          getDocument - get document using IFile - now no longer depends on text buffer; can return IDocument even for a file that is not open in editor (and thus not in textbuffer)
static org.eclipse.jface.text.IDocument getDocument(java.lang.String fullPathName)
          get document using full path name
static java.lang.String getInputFile(org.eclipse.ui.texteditor.ITextEditor editor)
          From an editor, determine the file (absolute path name) open in the editor.
static Utility.Location getLocation(org.eclipse.cdt.core.dom.ast.IASTNode node)
          compute the location relative to file, ignoring includes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utility

public Utility()
Method Detail

getLocation

public static Utility.Location getLocation(org.eclipse.cdt.core.dom.ast.IASTNode node)
compute the location relative to file, ignoring includes

Parameters:
node - - IASTNode
Returns:
Location

getDocument

public static org.eclipse.jface.text.IDocument getDocument(java.lang.String fullPathName)
get document using full path name

Parameters:
fullPathName - - String
Returns:
IDocument

getDocument

public static org.eclipse.jface.text.IDocument getDocument(org.eclipse.core.resources.IFile file)
getDocument - get document using IFile - now no longer depends on text buffer; can return IDocument even for a file that is not open in editor (and thus not in textbuffer)

Parameters:
file - - IFile
Returns:
IDocument

getInputFile

public static java.lang.String getInputFile(org.eclipse.ui.texteditor.ITextEditor editor)
From an editor, determine the file (absolute path name) open in the editor.

Parameters:
editor -
Returns:
null if none, but the string of the absolute file system location if available

PTP
Release 7.0

Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.