Skip to content

Commit ca5b787

Browse files
author
jan
committed
Setting page did not update values when changing configuration
1 parent 6900b22 commit ca5b787

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

io.sloeber.autoBuild.ui/src/io/sloeber/autoBuild/ui/tabs/ToolListContentProvider.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ public void dispose() {
4646
//Nothing to do here
4747
}
4848

49+
public void SetAutoBuildConfigurationDescription (IAutoBuildConfigurationDescription autoBuildConf) {
50+
myAutoBuildConf=autoBuildConf;
51+
}
52+
4953
public ToolListContentProvider(IResource resource, IAutoBuildConfigurationDescription myAutoConfDesc) {
5054
myResource = resource;
5155
myAutoBuildConf = myAutoConfDesc;
@@ -82,7 +86,7 @@ public Object[] getElements(Object inputElement) {
8286
enabledTools.add(curTool);
8387
}
8488
}
85-
//Sort the tools alphabetically
89+
//Sort the tools alphabetically
8690
enabledTools.sort(new Comparator<ITool>() {
8791
@Override
8892
public int compare(ITool o1, ITool o2) {

io.sloeber.autoBuild.ui/src/io/sloeber/autoBuild/ui/tabs/ToolSettingsTab.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
import org.eclipse.swt.widgets.Text;
7575
import org.eclipse.ui.PlatformUI;
7676

77+
import io.sloeber.autoBuild.api.IAutoBuildConfigurationDescription;
7778
import io.sloeber.autoBuild.api.ICustomBuildOptionEditor;
7879
import io.sloeber.autoBuild.core.AutoBuildCommon;
7980
import io.sloeber.autoBuild.integrations.ToolListLabelProvider;
@@ -656,6 +657,7 @@ public void setVisible(boolean visible) {
656657
super.setVisible(visible);
657658
}
658659

660+
private IAutoBuildConfigurationDescription myLastUsedAutoConfDesc = null;
659661
protected void setValues() {
660662
if (myAutoConfDesc == null) {
661663
return;
@@ -670,16 +672,22 @@ protected void setValues() {
670672
* - When the user changes the configuration selection
671673
* - When the user changes the "exclude" setting for a resource
672674
*/
673-
675+
if(myLastUsedAutoConfDesc==myAutoConfDesc) {
676+
return;
677+
}
678+
myLastUsedAutoConfDesc=myAutoConfDesc;
674679
// Create the Tree Viewer content provider if first time
675680
if (listprovider == null) {
676681
listprovider = new ToolListContentProvider(mySelectedResource, myAutoConfDesc);
677682
optionList.setContentProvider(listprovider);
683+
}else {
684+
listprovider.SetAutoBuildConfigurationDescription(myAutoConfDesc);
678685
}
679686

680687
optionList.setInput(myAutoConfDesc);
681688
// newElements = (ToolListElement[]) listprovider.getElements(fInfo);
682689
optionList.expandAll();
690+
handleOptionSelection(false);
683691

684692
}
685693

0 commit comments

Comments
 (0)