platform: make utility methods used in Java plugin public (IDEA-200277)

This commit is contained in:
nik
2018-10-11 10:29:40 +03:00
parent 195e6faa2e
commit 0ad16c9513
10 changed files with 22 additions and 22 deletions
@@ -32,15 +32,15 @@ public abstract class HTMLComposerImpl extends HTMLComposer {
private final Map<Key, HTMLComposerExtension> myExtensions = new HashMap<>();
private final Map<Language, HTMLComposerExtension> myLanguageExtensions = new HashMap<>();
@NonNls protected static final String BR = "<br>";
@NonNls protected static final String NBSP = "&nbsp;";
@NonNls protected static final String CODE_CLOSING = "</code>";
@NonNls protected static final String CODE_OPENING = "<code>";
@NonNls protected static final String B_OPENING = "<b>";
@NonNls protected static final String B_CLOSING = "</b>";
@NonNls public static final String NBSP = "&nbsp;";
@NonNls public static final String CODE_CLOSING = "</code>";
@NonNls public static final String CODE_OPENING = "<code>";
@NonNls public static final String B_OPENING = "<b>";
@NonNls public static final String B_CLOSING = "</b>";
@NonNls protected static final String CLOSE_TAG = "\">";
@NonNls protected static final String A_HREF_OPENING = "<a HREF=\"";
@NonNls protected static final String A_CLOSING = "</a>";
@NonNls public static final String A_HREF_OPENING = "<a HREF=\"";
@NonNls public static final String A_CLOSING = "</a>";
protected HTMLComposerImpl() {
myListStack = new int[5];
@@ -109,7 +109,7 @@ public abstract class HTMLComposerImpl extends HTMLComposer {
}
}
protected void appendQualifiedName(StringBuffer buf, RefEntity refEntity) {
public void appendQualifiedName(StringBuffer buf, RefEntity refEntity) {
if (refEntity == null) return;
String qName = "";
@@ -30,11 +30,11 @@ import org.jetbrains.annotations.NotNull;
import java.util.Collection;
class FindUsagesHelper {
static boolean processUsagesInText(@NotNull final PsiElement element,
@NotNull Collection<String> stringToSearch,
@NotNull GlobalSearchScope searchScope,
@NotNull Processor<? super UsageInfo> processor) {
public class FindUsagesHelper {
public static boolean processUsagesInText(@NotNull final PsiElement element,
@NotNull Collection<String> stringToSearch,
@NotNull GlobalSearchScope searchScope,
@NotNull Processor<? super UsageInfo> processor) {
final TextRange elementTextRange = ReadAction.compute(() -> !element.isValid() || element instanceof PsiCompiledElement ? null : element.getTextRange());
UsageInfoFactory factory = (usage, startOffset, endOffset) -> {
if (!element.isValid()) return new UsageInfo(usage, startOffset, endOffset, true);
@@ -211,7 +211,7 @@ public class PsiSearchHelperImpl implements PsiSearchHelper {
return progress;
}
static boolean shouldProcessInjectedPsi(@NotNull SearchScope scope) {
public static boolean shouldProcessInjectedPsi(@NotNull SearchScope scope) {
return !(scope instanceof LocalSearchScope) || !((LocalSearchScope)scope).isIgnoreInjectedPsi();
}
@@ -141,7 +141,7 @@ public class CompletionUtil {
}
static InsertionContext emulateInsertion(InsertionContext oldContext, int newStart, final LookupElement item) {
public static InsertionContext emulateInsertion(InsertionContext oldContext, int newStart, final LookupElement item) {
final InsertionContext newContext = newContext(oldContext, item);
emulateInsertion(item, newStart, newContext);
return newContext;
@@ -583,7 +583,7 @@ public class TypedHandler extends TypedActionHandlerBase {
indentBrace(project, editor, '}');
}
static void indentOpenedBrace(@NotNull Project project, @NotNull Editor editor){
public static void indentOpenedBrace(@NotNull Project project, @NotNull Editor editor){
indentBrace(project, editor, '{');
}
@@ -36,12 +36,12 @@ public class ProgramParametersUtil {
new ProgramParametersConfigurator().checkWorkingDirectoryExist(configuration, project, module);
}
protected static String expandPath(String path, Module module, Project project) {
public static String expandPath(String path, Module module, Project project) {
return new ProgramParametersConfigurator().expandPath(path, module, project);
}
@Nullable
protected static Module getModule(CommonProgramRunConfigurationParameters configuration) {
public static Module getModule(CommonProgramRunConfigurationParameters configuration) {
return new ProgramParametersConfigurator().getModule(configuration);
}
}
@@ -357,7 +357,7 @@ public class CopyFilesOrDirectoriesHandler extends CopyHandlerDelegateBase {
}
@Nullable
protected static PsiDirectory resolveDirectory(@NotNull PsiDirectory defaultTargetDirectory) {
public static PsiDirectory resolveDirectory(@NotNull PsiDirectory defaultTargetDirectory) {
final Project project = defaultTargetDirectory.getProject();
final Boolean showDirsChooser = defaultTargetDirectory.getCopyableUserData(CopyPasteDelegator.SHOW_CHOOSER_KEY);
if (showDirsChooser != null && showDirsChooser.booleanValue()) {
@@ -70,7 +70,7 @@ public class CopyHandler {
}
}
static void updateSelectionInActiveProjectView(@NotNull PsiElement newElement, Project project, boolean selectInActivePanel) {
public static void updateSelectionInActiveProjectView(@NotNull PsiElement newElement, Project project, boolean selectInActivePanel) {
String id = ToolWindowManager.getInstance(project).getActiveToolWindowId();
if (id != null) {
ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow(id);
@@ -58,7 +58,7 @@ public class FileGroupingRule extends SingleParentUsageGroupingRule implements D
return null;
}
protected static class FileUsageGroup implements UsageGroup, TypeSafeDataProvider, NamedPresentably {
public static class FileUsageGroup implements UsageGroup, TypeSafeDataProvider, NamedPresentably {
private final Project myProject;
private final VirtualFile myFile;
private String myPresentableName;
@@ -33,7 +33,7 @@ public class ProjectCheckoutListener implements CheckoutListener {
@Override
public void processOpenedProject(Project lastOpenedProject) { }
static String getProductNameWithArticle() {
public static String getProductNameWithArticle() {
// examples: "to create an IntelliJ IDEA project" (full product name is ok), "to create a PyCharm project"
String productName = ApplicationNamesInfo.getInstance().getFullProductName();
String article = StringUtil.isVowel(Character.toLowerCase(productName.charAt(0))) ? "an " : "a ";