mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
advertise autopopup shortcuts
This commit is contained in:
+4
-3
@@ -23,6 +23,7 @@ import com.intellij.codeInsight.hint.HintManager;
|
||||
import com.intellij.codeInsight.lookup.*;
|
||||
import com.intellij.codeInsight.lookup.impl.LookupImpl;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.openapi.actionSystem.IdeActions;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.Result;
|
||||
import com.intellij.openapi.command.CommandProcessor;
|
||||
@@ -150,11 +151,11 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
((CompletionPhase.BgCalculation)phase).focusLookupWhenDone = true;
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
myLookup.setAdvertisementText("Press " +
|
||||
myLookup.addAdvertisement("Press " +
|
||||
CompletionContributor.getActionShortcut(IdeActions.ACTION_CHOOSE_LOOKUP_ITEM_REPLACE) +
|
||||
" to choose the first suggestion");
|
||||
*/
|
||||
myLookup.addAdvertisement(CompletionContributor.getActionShortcut(IdeActions.ACTION_LOOKUP_DOWN) + " and " + CompletionContributor.getActionShortcut(IdeActions.ACTION_LOOKUP_UP) +
|
||||
" will move caret down and up");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,6 +84,8 @@ public class Advertiser implements Disposable {
|
||||
|
||||
public synchronized void clearAdvertisements() {
|
||||
myTexts.clear();
|
||||
myCurrentItem = 0;
|
||||
myScrollingOffset = 0;
|
||||
}
|
||||
|
||||
private static Font adFont() {
|
||||
|
||||
@@ -295,7 +295,7 @@ public class LookupImpl extends LightweightHint implements Lookup, Disposable {
|
||||
public void setAdvertisementText(@Nullable String text) {
|
||||
myAdText = text;
|
||||
if (StringUtil.isNotEmpty(text)) {
|
||||
myAdComponent.addAdvertisement(text);
|
||||
addAdvertisement(text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1165,6 +1165,10 @@ public class LookupImpl extends LightweightHint implements Lookup, Disposable {
|
||||
myPreselectedItem = null;
|
||||
}
|
||||
|
||||
public void addAdvertisement(@NotNull String text) {
|
||||
myAdComponent.addAdvertisement(text);
|
||||
}
|
||||
|
||||
public boolean isLookupDisposed() {
|
||||
return myDisposed;
|
||||
}
|
||||
|
||||
@@ -71,6 +71,9 @@ public interface IdeActions {
|
||||
@NonNls String ACTION_CHOOSE_LOOKUP_ITEM_REPLACE = "EditorChooseLookupItemReplace";
|
||||
@NonNls String ACTION_CHOOSE_LOOKUP_ITEM_COMPLETE_STATEMENT = "EditorChooseLookupItemCompleteStatement";
|
||||
|
||||
@NonNls String ACTION_LOOKUP_UP = "EditorLookupUp";
|
||||
@NonNls String ACTION_LOOKUP_DOWN = "EditorLookupDown";
|
||||
|
||||
@NonNls String GROUP_EXTERNAL_TOOLS = "ExternalToolsGroup";
|
||||
|
||||
@NonNls String GROUP_MAIN_MENU = "MainMenu";
|
||||
|
||||
Reference in New Issue
Block a user