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


Java JavaElementLabels.getElementLabel方法代码示例

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


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

示例1: checkNewElementName

import org.eclipse.jdt.ui.JavaElementLabels; //导入方法依赖的package包/类
public RefactoringStatus checkNewElementName(String newName) throws JavaModelException {
  RefactoringStatus result = Checks.checkFieldName(newName, fCu);
  if (!Checks.startsWithLowerCase(newName))
    if (fIsComposite) {
      final String nameOfParent =
          JavaElementLabels.getElementLabel(
              fLocalVariable.getParent(), JavaElementLabels.ALL_DEFAULT);
      final String nameOfType =
          JavaElementLabels.getElementLabel(
              fLocalVariable.getAncestor(IJavaElement.TYPE), JavaElementLabels.ALL_DEFAULT);
      result.addWarning(
          Messages.format(
              RefactoringCoreMessages.RenameTempRefactoring_lowercase2,
              new String[] {
                BasicElementLabels.getJavaElementName(newName), nameOfParent, nameOfType
              }));
    } else {
      result.addWarning(RefactoringCoreMessages.RenameTempRefactoring_lowercase);
    }
  return result;
}
 
开发者ID:eclipse,项目名称:che,代码行数:22,代码来源:RenameLocalVariableProcessor.java

示例2: getDecription

import org.eclipse.jdt.ui.JavaElementLabels; //导入方法依赖的package包/类
public String getDecription(Object obj, long flags) {
    if (obj instanceof TreeElement<?, ?>) {
        TreeElement<?, ?> element = (TreeElement<?, ?>) obj;
        Object data = element.getData();
        if (data instanceof IJavaElement) {
            return JavaElementLabels.getElementLabel((IJavaElement) data, flags);
        }
        if (data instanceof IResource) {
            IJavaElement javaElt = JavaCore.create((IResource) data);
            if (javaElt != null) {
                return JavaElementLabels.getElementLabel(javaElt, flags);
            }
        }
    }
    return getText(obj);
}
 
开发者ID:iloveeclipse,项目名称:datahierarchy,代码行数:17,代码来源:ViewLabelProvider.java

示例3: checkInitialConditions

import org.eclipse.jdt.ui.JavaElementLabels; //导入方法依赖的package包/类
@Override
public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException {
  IType primary = (IType) fType.getPrimaryElement();
  if (primary == null || !primary.exists()) {
    String qualifiedTypeName =
        JavaElementLabels.getElementLabel(fType, JavaElementLabels.F_FULLY_QUALIFIED);
    String message =
        Messages.format(
            RefactoringCoreMessages.RenameTypeRefactoring_does_not_exist,
            new String[] {
              BasicElementLabels.getJavaElementName(qualifiedTypeName),
              BasicElementLabels.getFileName(fType.getCompilationUnit())
            });
    return RefactoringStatus.createFatalErrorStatus(message);
  }
  fType = primary;
  return Checks.checkIfCuBroken(fType);
}
 
开发者ID:eclipse,项目名称:che,代码行数:19,代码来源:RenameTypeProcessor.java

示例4: checkPackageName

import org.eclipse.jdt.ui.JavaElementLabels; //导入方法依赖的package包/类
private RefactoringStatus checkPackageName(String newName) throws CoreException {
  RefactoringStatus status = new RefactoringStatus();
  IPackageFragmentRoot[] roots = fPackage.getJavaProject().getPackageFragmentRoots();
  Set<String> topLevelTypeNames = getTopLevelTypeNames();
  for (int i = 0; i < roots.length; i++) {
    IPackageFragmentRoot root = roots[i];
    if (!isPackageNameOkInRoot(newName, root)) {
      String rootLabel = JavaElementLabels.getElementLabel(root, JavaElementLabels.ALL_DEFAULT);
      String newPackageName = BasicElementLabels.getJavaElementName(getNewElementName());
      String message =
          Messages.format(
              RefactoringCoreMessages.RenamePackageRefactoring_aleady_exists,
              new Object[] {newPackageName, rootLabel});
      status.merge(RefactoringStatus.createWarningStatus(message));
      status.merge(checkTypeNameConflicts(root, newName, topLevelTypeNames));
    }
  }
  return status;
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:RenamePackageProcessor.java

示例5: resolve

import org.eclipse.jdt.ui.JavaElementLabels; //导入方法依赖的package包/类
@Override
protected String resolve(TemplateContext context) {
  IJavaElement element = ((CompilationUnitContext) context).findEnclosingElement(fElementType);
  if (element instanceof IType)
    return JavaElementLabels.getElementLabel(element, JavaElementLabels.T_CONTAINER_QUALIFIED);
  return (element == null) ? null : element.getElementName();
}
 
开发者ID:eclipse,项目名称:che,代码行数:8,代码来源:CompilationUnitContextType.java

示例6: createWarningAboutCall

import org.eclipse.jdt.ui.JavaElementLabels; //导入方法依赖的package包/类
private RefactoringStatus createWarningAboutCall(
    IMember enclosing, ASTNode concreteNode, String message) {
  String name = JavaElementLabels.getElementLabel(enclosing, JavaElementLabels.ALL_DEFAULT);
  String container =
      JavaElementLabels.getElementLabel(
          enclosing.getDeclaringType(), JavaElementLabels.ALL_FULLY_QUALIFIED);
  return RefactoringStatus.createWarningStatus(
      Messages.format(message, new String[] {name, container}),
      JavaStatusContext.create(enclosing.getCompilationUnit(), concreteNode));
}
 
开发者ID:eclipse,项目名称:che,代码行数:11,代码来源:IntroduceIndirectionRefactoring.java

示例7: getName

import org.eclipse.jdt.ui.JavaElementLabels; //导入方法依赖的package包/类
@Override
public String getName() {
  String rootName = JavaElementLabels.getElementLabel(getRoot(), JavaElementLabels.ALL_DEFAULT);
  String destinationName = BasicElementLabels.getResourceName(getDestination());
  return Messages.format(
      RefactoringCoreMessages.MovePackageFragmentRootChange_move,
      new String[] {rootName, destinationName});
}
 
开发者ID:eclipse,项目名称:che,代码行数:9,代码来源:MovePackageFragmentRootChange.java

示例8: getName

import org.eclipse.jdt.ui.JavaElementLabels; //导入方法依赖的package包/类
@Override
public String getName() {
  String packageName =
      JavaElementLabels.getElementLabel(getPackage(), JavaElementLabels.ALL_DEFAULT);
  String destinationName =
      JavaElementLabels.getElementLabel(getDestination(), JavaElementLabels.ALL_DEFAULT);
  return Messages.format(
      RefactoringCoreMessages.CopyPackageChange_copy,
      new String[] {packageName, destinationName});
}
 
开发者ID:eclipse,项目名称:che,代码行数:11,代码来源:CopyPackageChange.java

示例9: getName

import org.eclipse.jdt.ui.JavaElementLabels; //导入方法依赖的package包/类
@Override
public String getName() {
  String rootName = JavaElementLabels.getElementLabel(getRoot(), JavaElementLabels.ALL_DEFAULT);
  String destinationName = BasicElementLabels.getResourceName(getDestination());
  return Messages.format(
      RefactoringCoreMessages.CopyPackageFragmentRootChange_copy,
      new String[] {rootName, destinationName});
}
 
开发者ID:eclipse,项目名称:che,代码行数:9,代码来源:CopyPackageFragmentRootChange.java

示例10: getName

import org.eclipse.jdt.ui.JavaElementLabels; //导入方法依赖的package包/类
@Override
public String getName() {
  String packageName =
      JavaElementLabels.getElementLabel(getPackage(), JavaElementLabels.ALL_DEFAULT);
  String destinationName =
      JavaElementLabels.getElementLabel(getDestination(), JavaElementLabels.ALL_DEFAULT);
  return Messages.format(
      RefactoringCoreMessages.MovePackageChange_move,
      new String[] {packageName, destinationName});
}
 
开发者ID:eclipse,项目名称:che,代码行数:11,代码来源:MovePackageChange.java

示例11: getSearchPatternDescription

import org.eclipse.jdt.ui.JavaElementLabels; //导入方法依赖的package包/类
private String getSearchPatternDescription() {
  if (fPatternData instanceof ElementQuerySpecification) {
    IJavaElement element = ((ElementQuerySpecification) fPatternData).getElement();
    return JavaElementLabels.getElementLabel(
        element,
        JavaElementLabels.ALL_DEFAULT
            | JavaElementLabels.ALL_FULLY_QUALIFIED
            | JavaElementLabels.USE_RESOLVED
            | JavaElementLabels.P_COMPRESSED);
  }
  return BasicElementLabels.getFilePattern(
      ((PatternQuerySpecification) fPatternData).getPattern());
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:JavaSearchQuery.java

示例12: getText

import org.eclipse.jdt.ui.JavaElementLabels; //导入方法依赖的package包/类
@Override
public String getText() {
  return JavaElementLabels.getElementLabel(fJavaElement, JavaElementLabels.ALL_DEFAULT);
}
 
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:CompilationUnitChangeNode.java

示例13: getDeclaringTypeLabel

import org.eclipse.jdt.ui.JavaElementLabels; //导入方法依赖的package包/类
private String getDeclaringTypeLabel() {
  return JavaElementLabels.getElementLabel(
      fMethod.getDeclaringType(), JavaElementLabels.ALL_DEFAULT);
}
 
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:RenameMethodProcessor.java

示例14: getElementLabel

import org.eclipse.jdt.ui.JavaElementLabels; //导入方法依赖的package包/类
private static String getElementLabel(IJavaElement javaElement) {
  return JavaElementLabels.getElementLabel(javaElement, JavaElementLabels.ALL_DEFAULT);
}
 
开发者ID:eclipse,项目名称:che,代码行数:4,代码来源:RenamePackageProcessor.java

示例15: getJavaElementName

import org.eclipse.jdt.ui.JavaElementLabels; //导入方法依赖的package包/类
private static String getJavaElementName(IJavaElement element) {
  return JavaElementLabels.getElementLabel(element, JavaElementLabels.ALL_DEFAULT);
}
 
开发者ID:eclipse,项目名称:che,代码行数:4,代码来源:Checks.java


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