Package de.loskutov.anyedit.jdt
Class JdtUtils
- java.lang.Object
-
- de.loskutov.anyedit.jdt.JdtUtils
-
public final class JdtUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description privateJdtUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static org.eclipse.jdt.core.IJavaProjectgetJavaProject(org.eclipse.core.resources.IProject project)private static intgetJavaProjectTabWidth(int tabWidth, org.eclipse.core.resources.IProject project)static org.eclipse.core.resources.IProjectgetProject(org.eclipse.debug.core.ILaunchConfiguration config)static org.eclipse.core.resources.IProjectgetProjectForClass(org.eclipse.ui.IEditorInput currentInput)static intgetTabWidth(org.eclipse.core.resources.IFile file)private static org.eclipse.jdt.core.IType[]getTypeForName(java.lang.String simpleTypeName, org.eclipse.jdt.core.search.IJavaSearchScope searchScope, org.eclipse.core.runtime.IProgressMonitor monitor)Finds a type by the simple name.private static booleanhasJavaNature(org.eclipse.core.resources.IProject project)Returns true if the given project is accessible and it has a java nature, otherwise false.static intsearchAndOpenType(java.lang.String typeName)
-
-
-
Method Detail
-
searchAndOpenType
public static int searchAndOpenType(java.lang.String typeName) throws org.eclipse.core.runtime.OperationCanceledException- Parameters:
typeName-- Throws:
org.eclipse.core.runtime.OperationCanceledException- if user doesnt select founded types
-
getTypeForName
private static org.eclipse.jdt.core.IType[] getTypeForName(java.lang.String simpleTypeName, org.eclipse.jdt.core.search.IJavaSearchScope searchScope, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.jdt.core.JavaModelExceptionFinds a type by the simple name. see org.eclipse.jdt.internal.corext.codemanipulation.AddImportsOperation- Returns:
- null, if no types was found, empty array if more then one type was found, or only one element, if single match exists
- Throws:
org.eclipse.jdt.core.JavaModelException
-
hasJavaNature
private static boolean hasJavaNature(org.eclipse.core.resources.IProject project)
Returns true if the given project is accessible and it has a java nature, otherwise false.- Parameters:
project- IProject- Returns:
- boolean
-
getJavaProject
private static org.eclipse.jdt.core.IJavaProject getJavaProject(org.eclipse.core.resources.IProject project)
-
getTabWidth
public static int getTabWidth(org.eclipse.core.resources.IFile file)
-
getJavaProjectTabWidth
private static int getJavaProjectTabWidth(int tabWidth, org.eclipse.core.resources.IProject project)
-
getProjectForClass
public static org.eclipse.core.resources.IProject getProjectForClass(org.eclipse.ui.IEditorInput currentInput)
- Parameters:
currentInput- class file input- Returns:
- may return null
-
getProject
public static org.eclipse.core.resources.IProject getProject(org.eclipse.debug.core.ILaunchConfiguration config)
-
-