Do not look for main method when hide non-runnable apps filter is off

This commit is contained in:
BoykoAlex
2021-07-20 11:58:43 -04:00
parent c2e369e7fe
commit a8aa3d7c5e
3 changed files with 14 additions and 4 deletions

View File

@@ -99,7 +99,6 @@ public class BootProjectDashElement extends AbstractLaunchConfigurationsDashElem
this.projectProperties = projectProperties;
this.childFactory = childFactory;
hasMainMethod.refresh();
addModelState(hasMainMethod);
addDisposableChild(hasMainMethod);
// if (DEBUG) {
@@ -265,6 +264,8 @@ public class BootProjectDashElement extends AbstractLaunchConfigurationsDashElem
}
public void refreshHasMainMethod() {
hasMainMethod.refresh();
if (getBootDashModel().getViewModel().getToggleFilters().getSelectedFilters().getValue().contains(ToggleFiltersModel.FILTER_CHOICE_HIDE_NOT_RUNNABLE_APPS)) {
hasMainMethod.refresh();
}
}
}

View File

@@ -119,12 +119,21 @@ public class LocalBootDashModel extends AbstractBootDashModel implements Deletio
this.consoleManager = new LocalElementConsoleManager();
this.projectExclusion = context.getBootProjectExclusion();
RunTargetType type = getRunTarget().getType();
RunTargetType<?> type = getRunTarget().getType();
IPropertyStore typeStore = PropertyStores.createForScope(type, context.getRunTargetProperties());
this.modelStore = PropertyStores.createSubStore(getRunTarget().getId(), typeStore);
// Listen to M2E JDT plugin active event to refresh local boot project dash elements.
addMavenInitializationIssueEventHandling();
addDisposableChild(parent.getToggleFilters().getSelectedFilters().onChange((e, v) -> {
if (e.getValue().contains(ToggleFiltersModel.FILTER_CHOICE_HIDE_NOT_RUNNABLE_APPS)) {
for (BootProjectDashElement a : applications.getValue()) {
a.refreshHasMainMethod();
}
}
}));
}
/**
* Refresh boot project dash elements once m2e JDT plugin is fully

View File

@@ -117,7 +117,7 @@ public class ToggleFiltersModel {
"Hide local non-runnable apps",
"Spring Boot projects that cannot be laucnhed such as Spring Boot library projects not having a main method will not be shown",
HIDE_LOCAL_NOT_RUNNABLE_APPS,
true);
false);
private static final String STORE_ID = "toggle-filters";
private static final FilterChoice[] FILTERS = {