/** * Removes the common number of indents from all lines. If a line * only consists out of white space it is ignored. * @param lines the lines * @param project the java project from which to get the formatter * preferences, or <code>null</code> for global preferences * @since 3.1 */ public static void trimIndentation(String[] lines, IJavaProject project) { trimIndentation(lines, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project), true); } /**
private static int getVisibility(IMember member) throws JavaModelException { if (JdtFlags.isPrivate(member)) { return 0; } if (JdtFlags.isPackageVisible(member)) { return 1; } if (JdtFlags.isProtected(member)) { return 2; } return 4; }
public static boolean isFiltered(IType type) { TypeFilter typeFilter = getDefault(); if (typeFilter.hasFilters()) { return typeFilter.filter(JavaModelUtil.getFullyQualifiedName(type)); } return false; }
public static boolean isFiltered(char[] packageName, char[] typeName) { return getDefault().filter(JavaModelUtil.concatenateName(packageName, typeName)); }
private static boolean isInstanceField(IField field) throws CoreException{ if (JavaModelUtil.isInterfaceOrAnnotation(field.getDeclaringType())) { return false; } else { return ! JdtFlags.isStatic(field); } }
public boolean matchesCachedResult(TypeNameMatch type) { if (!(matchesPackage(type) && matchesFilterExtension(type))) return false; return matchesName(type); }
private int getCamelCaseCategory(TypeNameMatch type) { if (fFilter == null) return 0; if (!fFilter.isCamelCasePattern()) return 0; return fFilter.matchesRawNamePattern(type) ? 0 : 1; } private int getElementTypeCategory(TypeNameMatch type) {
/** * The preference setting for the visual tabulator display. * * @return the number of spaces displayed for a tabulator in the editor */ private int getVisualTabLengthPreference() { return CodeFormatterUtil.getTabWidth(fProject); }
@Override public void getName(AccessibleEvent e) { e.result= Strings.removeMnemonicIndicator(message); } });
public static synchronized void shutdown() { if (fgInstance == null) return; fgInstance.doShutdown(); }
public static synchronized OpenTypeHistory getInstance() { if (fgInstance == null) fgInstance= new OpenTypeHistory(); return fgInstance; }
public String getErasure(String typeVariable) { String[] subst= getSubstArray(typeVariable); if (subst != null) { return subst[1]; } return null; } }
/** * Returns the unsorted list of received proposals. * * @return the unsorted list of received proposals */ public final IJavaCompletionProposal[] getJavaCompletionProposals() { return CollectionsUtil.toArray(fJavaProposals, IJavaCompletionProposal.class); }
boolean isRelevantPackage(IPackageFragment fragment, boolean is9OrHigher) throws JavaModelException { if (is9OrHigher && !JavaModelUtil.containsOrdinaryCompilationUnit(fragment)) { // at 9, a default package containing only module-info should be hidden: return false; } return true; }
/** * Removes the common number of indents from all lines. If a line * only consists out of white space it is ignored. * @param project the java project from which to get the formatter * preferences, or <code>null</code> for global preferences * @since 3.1 */ public static void trimIndentation(String[] lines, IJavaProject project) { trimIndentation(lines, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project), true); } /**
private static int getVisibility(IMember member) throws JavaModelException { if (JdtFlags.isPrivate(member)) return 0; if (JdtFlags.isPackageVisible(member)) return 1; if (JdtFlags.isProtected(member)) return 2; return 4; }
public static synchronized void shutdown() { if (fgInstance == null) return; fgInstance.doShutdown(); }
/** * Returns the unsorted list of received keyword proposals. * * @return the unsorted list of received keyword proposals */ public final IJavaCompletionProposal[] getKeywordCompletionProposals() { return CollectionsUtil.toArray(fKeywords, IJavaCompletionProposal.class); }
/** * Removes the common number of indents from all lines. If a line * only consists out of white space it is ignored. If <code> * considerFirstLine</code> is false the first line will be ignored. * * @param project the java project from which to get the formatter * preferences, or <code>null</code> for global preferences * @since 3.1 */ public static void trimIndentation(String[] lines, IJavaProject project, boolean considerFirstLine) { trimIndentation(lines, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project), considerFirstLine); }
public static String trimIndentation(String source, IJavaProject project, boolean considerFirstLine) { return trimIndentation(source, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project), considerFirstLine); }