当前位置: 首页>>代码示例>>Java>>正文


Java JavaElementUtil.isDefaultPackage方法代码示例

本文整理汇总了Java中org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil.isDefaultPackage方法的典型用法代码示例。如果您正苦于以下问题:Java JavaElementUtil.isDefaultPackage方法的具体用法?Java JavaElementUtil.isDefaultPackage怎么用?Java JavaElementUtil.isDefaultPackage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil的用法示例。


在下文中一共展示了JavaElementUtil.isDefaultPackage方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cannotUpdateReferencesForDestination

import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; //导入方法依赖的package包/类
/**
 * @return <code>true</code> if the user could expect that we update references, but we don't
 * @since 3.5
 */
private boolean cannotUpdateReferencesForDestination() {
	if (getCus().length == 0)
		return false;
	IPackageFragment pack= getDestinationAsPackageFragment();
	if (pack == null || pack.isDefaultPackage())
		return true;

	IJavaElement destination= getJavaElementDestination();
	if (destination instanceof IPackageFragmentRoot && getCus().length > 0) {
		return false;
	}

	Object commonParent= getCommonParent();
	return JavaElementUtil.isDefaultPackage(commonParent);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:ReorgPolicyFactory.java

示例2: createNamePattern

import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; //导入方法依赖的package包/类
private static String createNamePattern(IJavaElement element) throws JavaModelException {
  switch (element.getElementType()) {
    case IJavaElement.CLASS_FILE:
      return RefactoringCoreMessages.ReorgUtils_3;
    case IJavaElement.COMPILATION_UNIT:
      return RefactoringCoreMessages.ReorgUtils_4;
    case IJavaElement.FIELD:
      return RefactoringCoreMessages.ReorgUtils_5;
    case IJavaElement.IMPORT_CONTAINER:
      return RefactoringCoreMessages.ReorgUtils_6;
    case IJavaElement.IMPORT_DECLARATION:
      return RefactoringCoreMessages.ReorgUtils_7;
    case IJavaElement.INITIALIZER:
      return RefactoringCoreMessages.ReorgUtils_8;
    case IJavaElement.JAVA_PROJECT:
      return RefactoringCoreMessages.ReorgUtils_9;
    case IJavaElement.METHOD:
      if (((IMethod) element).isConstructor()) return RefactoringCoreMessages.ReorgUtils_10;
      else return RefactoringCoreMessages.ReorgUtils_11;
    case IJavaElement.PACKAGE_DECLARATION:
      return RefactoringCoreMessages.ReorgUtils_12;
    case IJavaElement.PACKAGE_FRAGMENT:
      if (JavaElementUtil.isDefaultPackage(element)) return RefactoringCoreMessages.ReorgUtils_13;
      else return RefactoringCoreMessages.ReorgUtils_14;
    case IJavaElement.PACKAGE_FRAGMENT_ROOT:
      if (((IPackageFragmentRoot) element).isArchive())
        return RefactoringCoreMessages.ReorgUtils_21;
      if (isSourceFolder(element)) return RefactoringCoreMessages.ReorgUtils_15;
      if (isClassFolder(element)) return RefactoringCoreMessages.ReorgUtils_16;
      return RefactoringCoreMessages.ReorgUtils_17;
    case IJavaElement.TYPE:
      IType type = (IType) element;
      if (type.isAnonymous()) return RefactoringCoreMessages.ReorgUtils_20;
      return RefactoringCoreMessages.ReorgUtils_18;
    default:
      Assert.isTrue(false);
      return null;
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:40,代码来源:ReorgUtils.java

示例3: cannotUpdateReferencesForDestination

import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; //导入方法依赖的package包/类
/**
 * @return <code>true</code> if the user could expect that we update references, but we don't
 * @since 3.5
 */
private boolean cannotUpdateReferencesForDestination() {
  if (getCus().length == 0) return false;
  IPackageFragment pack = getDestinationAsPackageFragment();
  if (pack == null || pack.isDefaultPackage()) return true;

  IJavaElement destination = getJavaElementDestination();
  if (destination instanceof IPackageFragmentRoot && getCus().length > 0) {
    return false;
  }

  Object commonParent = getCommonParent();
  return JavaElementUtil.isDefaultPackage(commonParent);
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:ReorgPolicyFactory.java

示例4: canEnable

import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; //导入方法依赖的package包/类
@Override
public boolean canEnable() throws JavaModelException {
  if (fPackageFragments.length == 0) return false;
  for (int i = 0; i < fPackageFragments.length; i++) {
    if (JavaElementUtil.isDefaultPackage(fPackageFragments[i])
        || fPackageFragments[i].isReadOnly()) return false;
  }
  if (ReorgUtils.containsLinkedResources(fPackageFragments)) return false;
  return true;
}
 
开发者ID:eclipse,项目名称:che,代码行数:11,代码来源:ReorgPolicyFactory.java

示例5: canEnable

import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; //导入方法依赖的package包/类
@Override
public boolean canEnable() throws JavaModelException {
	if (fPackageFragments.length == 0)
		return false;
	for (int i= 0; i < fPackageFragments.length; i++) {
		if (JavaElementUtil.isDefaultPackage(fPackageFragments[i]) || fPackageFragments[i].isReadOnly())
			return false;
	}
	if (ReorgUtils.containsLinkedResources(fPackageFragments))
		return false;
	return true;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:ReorgPolicyFactory.java

示例6: canCopyToClipboard

import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; //导入方法依赖的package包/类
private static boolean canCopyToClipboard(IJavaElement element) {
	if (element == null || ! element.exists())
		return false;

	if (JavaElementUtil.isDefaultPackage(element))
		return false;

	return true;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:CopyToClipboardAction.java

示例7: isDefaultPackageWithLinkedFiles

import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; //导入方法依赖的package包/类
private static boolean isDefaultPackageWithLinkedFiles(Object firstElement) throws JavaModelException {
	if (!JavaElementUtil.isDefaultPackage(firstElement))
		return false;
	IPackageFragment defaultPackage= (IPackageFragment)firstElement;
	ICompilationUnit[] cus= defaultPackage.getCompilationUnits();
	for (int i= 0; i < cus.length; i++) {
		if (isLinkedResource(cus[i]))
			return true;
	}
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:12,代码来源:DeleteWizard.java

示例8: canEnableQualifiedNameUpdating

import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; //导入方法依赖的package包/类
public boolean canEnableQualifiedNameUpdating() {
  return getCus().length > 0 && !JavaElementUtil.isDefaultPackage(getCommonParent());
}
 
开发者ID:eclipse,项目名称:che,代码行数:4,代码来源:ReorgPolicyFactory.java

示例9: createNamePattern

import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; //导入方法依赖的package包/类
private static String createNamePattern(IJavaElement element) throws JavaModelException {
	switch(element.getElementType()){
		case IJavaElement.CLASS_FILE:
			return RefactoringCoreMessages.ReorgUtils_3;
		case IJavaElement.COMPILATION_UNIT:
			return RefactoringCoreMessages.ReorgUtils_4;
		case IJavaElement.FIELD:
			return RefactoringCoreMessages.ReorgUtils_5;
		case IJavaElement.IMPORT_CONTAINER:
			return RefactoringCoreMessages.ReorgUtils_6;
		case IJavaElement.IMPORT_DECLARATION:
			return RefactoringCoreMessages.ReorgUtils_7;
		case IJavaElement.INITIALIZER:
			return RefactoringCoreMessages.ReorgUtils_8;
		case IJavaElement.JAVA_PROJECT:
			return RefactoringCoreMessages.ReorgUtils_9;
		case IJavaElement.METHOD:
			if (((IMethod)element).isConstructor())
				return RefactoringCoreMessages.ReorgUtils_10;
			else
				return RefactoringCoreMessages.ReorgUtils_11;
		case IJavaElement.PACKAGE_DECLARATION:
			return RefactoringCoreMessages.ReorgUtils_12;
		case IJavaElement.PACKAGE_FRAGMENT:
			if (JavaElementUtil.isDefaultPackage(element))
				return RefactoringCoreMessages.ReorgUtils_13;
			else
				return RefactoringCoreMessages.ReorgUtils_14;
		case IJavaElement.PACKAGE_FRAGMENT_ROOT:
			if (((IPackageFragmentRoot) element).isArchive())
				return RefactoringCoreMessages.ReorgUtils_21;
			if (isSourceFolder(element))
				return RefactoringCoreMessages.ReorgUtils_15;
			if (isClassFolder(element))
				return RefactoringCoreMessages.ReorgUtils_16;
			return RefactoringCoreMessages.ReorgUtils_17;
		case IJavaElement.TYPE:
			IType type= (IType)element;
			if (type.isAnonymous())
				return RefactoringCoreMessages.ReorgUtils_20;
			return RefactoringCoreMessages.ReorgUtils_18;
		default:
			Assert.isTrue(false);
			return null;
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:47,代码来源:ReorgUtils.java

示例10: canEnableQualifiedNameUpdating

import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; //导入方法依赖的package包/类
public boolean canEnableQualifiedNameUpdating() {
	return getCus().length > 0 && !JavaElementUtil.isDefaultPackage(getCommonParent());
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:4,代码来源:ReorgPolicyFactory.java

示例11: createNamePattern

import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; //导入方法依赖的package包/类
private static String createNamePattern(IJavaElement element) throws JavaModelException {
	switch(element.getElementType()){
		case IJavaElement.CLASS_FILE:
			return RefactoringCoreMessages.ReorgUtils_3;
		case IJavaElement.COMPILATION_UNIT:
			return RefactoringCoreMessages.ReorgUtils_4;
		case IJavaElement.FIELD:
			return RefactoringCoreMessages.ReorgUtils_5;
		case IJavaElement.IMPORT_CONTAINER:
			return RefactoringCoreMessages.ReorgUtils_6;
		case IJavaElement.IMPORT_DECLARATION:
			return RefactoringCoreMessages.ReorgUtils_7;
		case IJavaElement.INITIALIZER:
			return RefactoringCoreMessages.ReorgUtils_8;
		case IJavaElement.JAVA_PROJECT:
			return RefactoringCoreMessages.ReorgUtils_9;
		case IJavaElement.METHOD:
			if (((IMethod)element).isConstructor())
				return RefactoringCoreMessages.ReorgUtils_10;
			else
				return RefactoringCoreMessages.ReorgUtils_11;
		case IJavaElement.PACKAGE_DECLARATION:
			return RefactoringCoreMessages.ReorgUtils_12;
		case IJavaElement.PACKAGE_FRAGMENT:
			if (JavaElementUtil.isDefaultPackage(element))
				return RefactoringCoreMessages.ReorgUtils_13;
			else
				return RefactoringCoreMessages.ReorgUtils_14;
		case IJavaElement.PACKAGE_FRAGMENT_ROOT:
			if (((IPackageFragmentRoot) element).isArchive())
				return RefactoringCoreMessages.ReorgUtils_21;
			if (isSourceFolder(element))
				return RefactoringCoreMessages.ReorgUtils_15;
			if (isClassFolder(element))
				return RefactoringCoreMessages.ReorgUtils_16;
			return RefactoringCoreMessages.ReorgUtils_17;
		case IJavaElement.TYPE:
			IType type= (IType)element;
			if (type.getElementName().length() == 0 && type.isAnonymous())
				return RefactoringCoreMessages.ReorgUtils_20;
			return RefactoringCoreMessages.ReorgUtils_18;
		default:
			Assert.isTrue(false);
			return null;
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:47,代码来源:ReorgUtils.java


注:本文中的org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil.isDefaultPackage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。