/** * Returns the type name of the intermediary type, or the empty string if none has been set yet. * @return the intermediary type name or the empty string */ public String getIntermediaryTypeName() { return fIntermediaryType != null ? fIntermediaryType.getFullyQualifiedName('.') : ""; //$NON-NLS-1$ }
public TypeOccurrenceCollector(IType type, ReferencesInBinaryContext binaryRefs) { super(binaryRefs); fOldName= type.getElementName(); fOldQualifiedName= type.getFullyQualifiedName('.'); }
public void widgetSelected(SelectionEvent e) { IType intermediaryType= chooseIntermediaryClass(); if (intermediaryType == null) return; fIntermediaryTypeName.setText(intermediaryType.getFullyQualifiedName()); } });
@Override protected String getPlainPrettySignature() { return getJavaElementType().getFullyQualifiedName('.'); } }
@Override protected String transform(IPersistentType next) { return next.findJdtType().getFullyQualifiedName(); } }
public TypeOccurrenceCollector(IType type, ReferencesInBinaryContext binaryRefs) { super(binaryRefs); fOldName= type.getElementName(); fOldQualifiedName= type.getFullyQualifiedName('.'); }
protected String getPlainPrettySignature() { StringBuffer result= new StringBuffer(getJavaElementType().getFullyQualifiedName('.')); result.append("<"); //$NON-NLS-1$ result.append(fTypeArguments[0].getPlainPrettySignature()); for (int i= 1; i < fTypeArguments.length; i++) { result.append(", "); //$NON-NLS-1$ result.append(fTypeArguments[i].getPlainPrettySignature()); } result.append(">"); //$NON-NLS-1$ return result.toString(); } }
private void rememberInternal(IType lhs, String rhsQualifiedName) throws JavaModelException { String lhsQualifiedName= lhs.getFullyQualifiedName(); if (isCacheableLHS(lhs, lhsQualifiedName)) getCache(lhsQualifiedName).add(rhsQualifiedName); }
/** * Gets the name of the manifest's main class * * @param jarPackage the Jar package data * @return a string with the name */ static String getMainClassName(JarPackageData jarPackage) { if (jarPackage.getManifestMainClass() == null) return ""; //$NON-NLS-1$ else return jarPackage.getManifestMainClass().getFullyQualifiedName(); }
/** * Gets the name of the manifest's main class * * @return a string with the name */ static String getMainClassName(JarPackageData jarPackage) { if (jarPackage.getManifestMainClass() == null) return ""; //$NON-NLS-1$ else return jarPackage.getManifestMainClass().getFullyQualifiedName(); }
private void removeImportsToDestinationPackageTypes(ICompilationUnit movedUnit) throws CoreException{ ImportRewrite importEdit= getImportRewrite(movedUnit); IType[] destinationTypes= getDestinationPackageTypes(); for (int i= 0; i < destinationTypes.length; i++) { importEdit.removeImport(destinationTypes[i].getFullyQualifiedName('.')); } }
public static boolean isFiltered(IType type) { TypeFilter typeFilter = getDefault(); if (typeFilter.hasFilters()) { return typeFilter.filter(type.getFullyQualifiedName('.')); } return false; }
private static void addElementFor(IClassFile classFile, IApiComponent apiComponent, ApiScope scope) { try { IApiTypeRoot typeRoot = apiComponent.findTypeRoot(classFile.getType().getFullyQualifiedName()); if (typeRoot != null) { scope.addElement(typeRoot); } } catch (CoreException e) { ApiPlugin.log(e); } }
private List<Location> findImplementations(IType type, int offset, IProgressMonitor monitor) throws CoreException { //java.lang.Object is a special case. We need to minimize heavy cost of I/O, // by avoiding opening all files from the Object hierarchy boolean useDefaultLocation = "java.lang.Object".equals(type.getFullyQualifiedName()); ImplementationToLocationMapper mapper = new ImplementationToLocationMapper(preferenceManager.isClientSupportsClassFileContent(), useDefaultLocation); ImplementationCollector<Location> searcher = new ImplementationCollector<>(new Region(offset, 0), type, mapper); return searcher.findImplementations(monitor); }
@Override protected RefactoringStatus checkDeclaringType(final IProgressMonitor monitor) throws JavaModelException { final RefactoringStatus status= super.checkDeclaringType(monitor); if (getDeclaringType().getFullyQualifiedName('.').equals("java.lang.Object")) //$NON-NLS-1$ status.merge(RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.PullUpRefactoring_no_java_lang_Object)); status.merge(checkDeclaringSuperTypes(monitor)); return status; }
private String createImportForAccessor(MultiTextEdit parent, String accessorClassName, IPackageFragment accessorPackage, ICompilationUnit cu) throws CoreException { IType type= accessorPackage.getCompilationUnit(accessorClassName + JavaModelUtil.DEFAULT_CU_SUFFIX).getType(accessorClassName); String fullyQualifiedName= type.getFullyQualifiedName(); ImportRewrite importRewrite= StubUtility.createImportRewrite(cu, true); String nameToUse= importRewrite.addImport(fullyQualifiedName); TextEdit edit= importRewrite.rewriteImports(null); parent.addChild(edit); return nameToUse; }
private boolean updateNameReference(ITypeBinding[] parameters, Name name, CompilationUnitRewrite targetRewrite, TextEditGroup group) { if (ASTNodes.asString(name).equals(fType.getFullyQualifiedName('.'))) { targetRewrite.getASTRewrite().replace(name, getNewQualifiedNameNode(parameters, name), group); targetRewrite.getImportRemover().registerRemovedNode(name); return true; } targetRewrite.getASTRewrite().replace(name, getNewUnqualifiedTypeNode(parameters, name), group); targetRewrite.getImportRemover().registerRemovedNode(name); return true; }
private boolean updateNameReference(ITypeBinding[] parameters, Name name, CompilationUnitRewrite targetRewrite, TextEditGroup group) { if (ASTNodes.asString(name).equals(fType.getFullyQualifiedName('.'))) { targetRewrite.getASTRewrite().replace(name, getNewQualifiedNameNode(parameters, name), group); targetRewrite.getImportRemover().registerRemovedNode(name); return true; } targetRewrite.getASTRewrite().replace(name, getNewUnqualifiedTypeNode(parameters, name), group); targetRewrite.getImportRemover().registerRemovedNode(name); return true; }
private RefactoringStatus checkTypesInCompilationUnit() { RefactoringStatus result= new RefactoringStatus(); if (! Checks.isTopLevel(fType)){ //the other case checked in checkTypesInPackage IType siblingType= fType.getDeclaringType().getType(getNewElementName()); if (siblingType.exists()){ String msg= Messages.format(RefactoringCoreMessages.RenameTypeRefactoring_member_type_exists, new String[] { getNewElementLabel(), BasicElementLabels.getJavaElementName(fType.getDeclaringType().getFullyQualifiedName('.'))}); result.addError(msg, JavaStatusContext.create(siblingType)); } } return result; }
protected IType createPermission(IProgressMonitor monitor, IWorkingCopyManager workingCopyManager) { IJavaEnvironment env = getEnvProvider().get(getSharedSourceFolder().getJavaProject()); PermissionSourceBuilder psb = new PermissionSourceBuilder(getPermissionName(), getPackage(), env); psb.setup(); psb.getMainType().setSuperTypeSignature(Signature.createTypeSignature(getSuperType().getFullyQualifiedName())); return S2eUtils.writeType(getSharedSourceFolder(), psb, env, monitor, workingCopyManager); }