mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
hide gear when no actions available (e.g. File size exceed configured limit)
This commit is contained in:
+14
-13
@@ -80,26 +80,27 @@ public class FileLevelIntentionComponent extends EditorNotificationPanel {
|
||||
if (gutterMark != null) {
|
||||
myLabel.setIcon(gutterMark.getIcon());
|
||||
}
|
||||
myGearLabel.setIcon(AllIcons.General.Gear);
|
||||
|
||||
new ClickListener() {
|
||||
@Override
|
||||
public boolean onClick(@NotNull MouseEvent e, int clickCount) {
|
||||
IntentionListStep step = new IntentionListStep(null, editor, psiFile, project);
|
||||
if (intentions != null && !intentions.isEmpty()) {
|
||||
if (intentions != null && !intentions.isEmpty()) {
|
||||
myGearLabel.setIcon(AllIcons.General.Gear);
|
||||
|
||||
new ClickListener() {
|
||||
@Override
|
||||
public boolean onClick(@NotNull MouseEvent e, int clickCount) {
|
||||
IntentionListStep step = new IntentionListStep(null, editor, psiFile, project);
|
||||
HighlightInfo.IntentionActionDescriptor descriptor = intentions.get(0).getFirst();
|
||||
IntentionActionWithTextCaching actionWithTextCaching = step.wrapAction(descriptor, psiFile, psiFile, editor);
|
||||
if (step.hasSubstep(actionWithTextCaching)) {
|
||||
step = step.getSubStep(actionWithTextCaching, null);
|
||||
}
|
||||
ListPopup popup = JBPopupFactory.getInstance().createListPopup(step);
|
||||
Dimension dimension = popup.getContent().getPreferredSize();
|
||||
Point at = new Point(-dimension.width + myGearLabel.getWidth(), FileLevelIntentionComponent.this.getHeight());
|
||||
popup.show(new RelativePoint(e.getComponent(), at));
|
||||
return true;
|
||||
}
|
||||
ListPopup popup = JBPopupFactory.getInstance().createListPopup(step);
|
||||
Dimension dimension = popup.getContent().getPreferredSize();
|
||||
Point at = new Point(-dimension.width + myGearLabel.getWidth(), FileLevelIntentionComponent.this.getHeight());
|
||||
popup.show(new RelativePoint(e.getComponent(), at));
|
||||
return true;
|
||||
}
|
||||
}.installOn(myGearLabel);
|
||||
}.installOn(myGearLabel);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user