Skip to content

Conversation

@chrisrueger
Copy link
Contributor

adds a first draft of an readonly "Effective Source view" of a Bnd Editor based on comment #6401 (comment)

It shows you all the effective properties with inheritance and includes.

  • supports find text via CMD+F
  • add Syntax highlighting (same as Source view)

image

This is a nice additional debugging tool, because it makes things visible to the human eye, which were previously hidden.

Comment about code: I reused some code of the JarEditor (JarPrintPage.java) and added search-dialog and syntax highlighting. Sorry if this is not state-of-the-art Eclipse JFace code.

@chrisrueger chrisrueger force-pushed the bndeditmodel-effective-ui branch from 426c073 to 9c48429 Compare December 15, 2024 16:26
@chrisrueger chrisrueger changed the title first draft of Bnd Effective Source tab first draft of Effective tab for BndEditor Dec 15, 2024
@chrisrueger chrisrueger force-pushed the bndeditmodel-effective-ui branch from 18e94ee to 52ea878 Compare December 20, 2024 05:28
@chrisrueger
Copy link
Contributor Author

chrisrueger commented Dec 20, 2024

@pkriens this is the current status of the "Effective" tab in the BndEditor

image
  • shows readOnly source
  • and a TableViewer
  • side by side (we can remove this in the future. I found it just handy at the moment during development, for easy finding and copypasting of stuff)
  • both can be resized with drag handle in the middle (SashForm)
  • TableViewer supports doubleClick which opens BndEditor for the property. e.g. if you are viewing /myproject/build.bnd when you dclick on a row of a property which was inherited from /cnf/build.bnd then BndEditor of cnf/build.bnd

Further TODOs could be:

  • filter and Copy-To-Clipboard for the TableViewer

Let me know when you want to take over for more magic :)

@pkriens
Copy link
Member

pkriens commented Dec 20, 2024

I might take a stab in the next 2 weeks when I am not allowed to sit in my office :-)

@chrisrueger chrisrueger force-pushed the bndeditmodel-effective-ui branch from ce00b37 to a3623f7 Compare December 22, 2024 22:26
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>

add find text via CMD+F

Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>

add Syntax highlighting via SourceViewer

remove unnecessary code

remove some code which came in from JarPrintPage.java

Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>

fix resource bundle

found in org.eclipse.ui.texteditor.EditorMessages.BUNDLE_FOR_CONSTRUCTED_KEYS which is unfortunatelly not accessible (private)

Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>

add line numbers

Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>

rename tab just "Effective"

Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>

remove file
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
use resizable SashForm
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
and finally fix the scrolling issues by borrowing StackLayout from JARPrintPage.java

Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
this gives more flexibility when working with the values since we just don't have strings only

Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
@chrisrueger chrisrueger force-pushed the bndeditmodel-effective-ui branch from 42e19c5 to 6286697 Compare December 23, 2024 09:30
@chrisrueger
Copy link
Contributor Author

I might take a stab in the next 2 weeks when I am not allowed to sit in my office :-)

Thanks. I have pushed some improvements. Hope that might be a good place to takeover.

  • there is a button at the top to toggle between table and source view (button position can be improved, I was just too lazy to mess around with positioning at the moment)
  • double clicking on a row opens the editor of the .bnd / bnd.run file if it is not in the current file)
  • path is only filled if it is from a property file. So if path is empty, the property is coming from somewhere else

image

github-actions added 4 commits January 6, 2025 16:04
---
 Signed-off-by: github-actions <github-actions@bndtools.org>

Signed-off-by: github-actions <github-actions@bndtools.org>
All the different places where we set properties now mark their provenance.
In the case of the original we mark the original propertiesFile,

in case of includes we track the included file. For defaults we use the
provenance as a comment

---
 Signed-off-by: github-actions <github-actions@bndtools.org>

Signed-off-by: github-actions <github-actions@bndtools.org>
We now maintain a list of merge property keys in Constants. The BndEdit Model
now try to see if a property is part of a merge header and
use the proper converter/formatter.

---
 Signed-off-by: github-actions <github-actions@bndtools.org>

Signed-off-by: github-actions <github-actions@bndtools.org>
---
 Signed-off-by: github-actions <github-actions@bndtools.org>

Signed-off-by: github-actions <github-actions@bndtools.org>
@chrisrueger
Copy link
Contributor Author

@pkriens thanks for your additions. Did a few simple tests. Looks good.
Feel free to merge

@pkriens pkriens merged commit c61e476 into bndtools:master Jan 14, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants