Skip to content

Commit 36e1ce6

Browse files
committed
BndEditor: fix incorrect Effective Source View
Now Effective Table View (which was correct) and Effective Source View (which was wrong) now display the same value, respecting the provenance. Signed-off-by: Christoph Rueger <[email protected]>
1 parent 9ed91bd commit 36e1ce6

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

bndtools.core/src/bndtools/editor/BndSourceEffectivePage.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import java.util.List;
66
import java.util.Map;
77
import java.util.ResourceBundle;
8-
import java.util.Set;
98
import java.util.function.Function;
109

1110
import org.eclipse.core.commands.AbstractHandler;
@@ -333,20 +332,22 @@ public void setActive(boolean active) {
333332
} else {}
334333
}
335334

336-
private static String print(BndEditModel model) throws Exception {
337-
if (model == null) {
335+
private String print() throws Exception {
336+
if (editModel == null) {
338337
return "...";
339338
}
340339

341340
try {
342341
StringBuilder sb = new StringBuilder();
343342

344-
Processor p = new BndEditModel(model, true).getProperties();
345-
Set<String> propertyKeys = p.getPropertyKeys(true);
346-
for (String k : propertyKeys) {
343+
Processor properties = getProperties();
344+
List<PropertyKey> propertyKeys = properties.getPropertyKeys(k -> true);
345+
List<PropertyKey> visible = PropertyKey.findVisible(propertyKeys);
346+
347+
for (PropertyKey k : visible) {
347348

348-
String value = p.getProperty(k);
349-
sb.append(k)
349+
String value = k.getRawValue();
350+
sb.append(k.key())
350351
.append(": ")
351352
.append(value)
352353
.append("\n");
@@ -365,7 +366,7 @@ private void update() {
365366
}
366367
loading = true;
367368
try {
368-
String text = print(editModel);
369+
String text = print();
369370
sourceViewer.setDocument(new Document(text));
370371
styledText.setFocus();
371372
tableViewer.setInput(getTableData());

0 commit comments

Comments
 (0)