mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
disable rerun action if at lest one usage target is invalid
This commit is contained in:
@@ -371,6 +371,12 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
refreshUsages();
|
||||
}
|
||||
|
||||
public void update(AnActionEvent e) {
|
||||
super.update(e);
|
||||
final Presentation presentation = e.getPresentation();
|
||||
presentation.setEnabled(allTargetsAreValid());
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshUsages() {
|
||||
@@ -602,18 +608,18 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra
|
||||
|
||||
}
|
||||
|
||||
private boolean allTargetsAreValid() {
|
||||
for (int i = 0; i < myTargets.length; i++) {
|
||||
UsageTarget target = myTargets[i];
|
||||
if (!target.isValid()) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}, shortDescription, mnemonic);
|
||||
}
|
||||
|
||||
private boolean allTargetsAreValid() {
|
||||
for (int i = 0; i < myTargets.length; i++) {
|
||||
UsageTarget target = myTargets[i];
|
||||
if (!target.isValid()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public UsageViewPresentation getPresentation() {
|
||||
|
||||
Reference in New Issue
Block a user