Do not look for main method when hide non-runnable apps filter is off
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user