本文整理汇总了Java中org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil.isMainType方法的典型用法代码示例。如果您正苦于以下问题:Java JavaElementUtil.isMainType方法的具体用法?Java JavaElementUtil.isMainType怎么用?Java JavaElementUtil.isMainType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil
的用法示例。
在下文中一共展示了JavaElementUtil.isMainType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMainTypes
import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; //导入方法依赖的package包/类
public static IType[] getMainTypes(IJavaElement[] javaElements) throws JavaModelException {
List<IJavaElement> result = new ArrayList<IJavaElement>();
for (int i = 0; i < javaElements.length; i++) {
IJavaElement element = javaElements[i];
if (element instanceof IType && JavaElementUtil.isMainType((IType) element))
result.add(element);
}
return result.toArray(new IType[result.size()]);
}
示例2: initialize
import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; //导入方法依赖的package包/类
private void initialize() throws JavaModelException {
fQualifiedTypeName= JavaModelUtil.concatenateName(fType.getPackageFragment().getElementName(), fType.getElementName());
fEnclosingInstanceFieldName= getInitialNameForEnclosingInstanceField();
fSourceRewrite= new CompilationUnitRewrite(fType.getCompilationUnit());
fIsInstanceFieldCreationPossible= !(JdtFlags.isStatic(fType) || fType.isAnnotation() || fType.isEnum() || (fType.getDeclaringType() == null && !JavaElementUtil.isMainType(fType)));
fIsInstanceFieldCreationMandatory= fIsInstanceFieldCreationPossible && isInstanceFieldCreationMandatory();
fCreateInstanceField= fIsInstanceFieldCreationMandatory;
}
示例3: getMainTypes
import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; //导入方法依赖的package包/类
public static IType[] getMainTypes(IJavaElement[] javaElements) throws JavaModelException {
List<IJavaElement> result= new ArrayList<IJavaElement>();
for (int i= 0; i < javaElements.length; i++) {
IJavaElement element= javaElements[i];
if (element instanceof IType && JavaElementUtil.isMainType((IType)element))
result.add(element);
}
return result.toArray(new IType[result.size()]);
}
示例4: isMoveInnerAvailable
import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; //导入方法依赖的package包/类
public static boolean isMoveInnerAvailable(final IType type) throws JavaModelException {
return Checks.isAvailable(type)
&& !Checks.isAnonymous(type)
&& !JavaElementUtil.isMainType(type)
&& !Checks.isInsideLocalType(type);
}
示例5: isMoveInnerAvailable
import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; //导入方法依赖的package包/类
public static boolean isMoveInnerAvailable(final IType type) throws JavaModelException {
return Checks.isAvailable(type) && !Checks.isAnonymous(type) && !JavaElementUtil.isMainType(type) && !Checks.isInsideLocalType(type);
}