Hook model state change to has main method live expression
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2015, 2020 Pivotal, Inc.
|
||||
* Copyright (c) 2015, 2021 Pivotal, Inc.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
@@ -100,7 +100,7 @@ public class BootProjectDashElement extends AbstractLaunchConfigurationsDashElem
|
||||
this.childFactory = childFactory;
|
||||
|
||||
hasMainMethod.refresh();
|
||||
addElementState(hasMainMethod);
|
||||
addModelState(hasMainMethod);
|
||||
addDisposableChild(hasMainMethod);
|
||||
// if (DEBUG) {
|
||||
// onDispose((e) -> {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2015, 2017 Pivotal, Inc.
|
||||
* Copyright (c) 2015, 2021 Pivotal, Inc.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
@@ -251,6 +251,15 @@ public abstract class WrappingBootDashElement<T> extends AbstractDisposable impl
|
||||
state.addListener(elementStateNotifier);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that model state notifications are fired when a given liveExp's value changes.
|
||||
*/
|
||||
protected void addModelState(LiveExpression<?> state) {
|
||||
state.onChange((e,v) -> {
|
||||
getBootDashModel().notifyModelStateChanged();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUrl() {
|
||||
return Utils.createUrl(getLiveHost(), getLivePort(), getDefaultRequestMappingPath());
|
||||
|
||||
Reference in New Issue
Block a user