Giter Club home page Giter Club logo

Comments (9)

markiewb avatar markiewb commented on June 1, 2024

Perhaps use a different logic to determine the current editor

http://wiki.netbeans.org/DevFaqGetOpenEditorWindows

from show-path-in-title-netbeans-module.

Shredder121 avatar Shredder121 commented on June 1, 2024

I made a change, would you be interested to merge it back?
I can make a PR.
However it's quite a big patch, so I am not sure if I can reliably compare the performance of the two.
(So no fancy profiler data I think)

It's always instant though, and I use useEditorAsReference where I noticed that in the files tree, the node changes are processed, even when using useEditorAsReference.
This change makes it so you either have the one code path, or the other.

Let me know what you think.

from show-path-in-title-netbeans-module.

markiewb avatar markiewb commented on June 1, 2024

@Shredder121: Oh, I missed the github notification mail about this. I will have a look at your PR this weekend!

from show-path-in-title-netbeans-module.

Shredder121 avatar Shredder121 commented on June 1, 2024

Well, actually it is not yet a PR, but I was wondering if it's something you'd want to include.
I'll open up one if you like it. 😄

from show-path-in-title-netbeans-module.

Shredder121 avatar Shredder121 commented on June 1, 2024

The thing I need feedback on the most is the handling of the useNodeAsReference.
Did it also 'count' the selected editor as reference?
Is the current handling in line with what it used to do?

from show-path-in-title-netbeans-module.

Shredder121 avatar Shredder121 commented on June 1, 2024

Also, what is your opinion on making getPath behave more like updatePath?
If we make it a void method, and pass in the window to set the title of, we can return early, instead of returning null and having the 'default' title.

Anyway, I appreciate your support!

p.s. this new handling (only updating on the right propertyChange) can also be applied to show-branch-in-statusbar I believe

from show-path-in-title-netbeans-module.

markiewb avatar markiewb commented on June 1, 2024

@Shredder121: Try https://github.com/markiewb/show-path-in-title-netbeans-module/releases/tag/v2.2.0

If you give me an OK, i will put it on the plugin center! Thanks for your contributions!

I integrated your changes and refactored the code again.

  • I do not why the display should be faster than before, but at least this bug is fixed. The update has already been asynchronous.
  • Did it also 'count' the selected editor as reference? -> It did not count. Now a different text is shown #3
  • I updated the handling for useNodeAsReference. As a fallback I use the node instead of the current editor. The original idea of that is to see the label of the selected node. You can check that behaviour in the Services-window.
  • What is your opinion on making getPath behave more like updatePath? -> I took a different direction. I introduced a TitleBuilder (not a real builder), but this way it is easier to implement #6. getPath is only a collector and the TitleBuilder is the renderer (... I should rename it this way)

Offtopic

  • ... can also be applied to show-branch-in-statusbar I believe -> file an issue and a pull-request. I guess you are one of the few users. I got seldom feedback on that plugin.
  • Your avatar image shows CPH, correct?! I was there this summer and remember the statue and the opera in the back 😀

from show-path-in-title-netbeans-module.

Shredder121 avatar Shredder121 commented on June 1, 2024

image

If you give me an OK, i will put it on the plugin center! Thanks for your contributions!

No problem, and thank you for the plugin!

TLDR: I think it's good to go boss.

  • I do not why the display should be faster than before, but at least this bug is fixed. The update has already been asynchronous.

Well, maybe 'faster' was a poor choice of words.
What I meant was, that now the title is only updated once per switch of editors AND only when it needs to be updated (so useEditorAsReference ignores the tree views, which makes the IDE respond faster).
For reference I opened a profiler, I admit it's a very bad profiling session, since the logic in two modules can't really be compared, but bear with me.
In the image, every time 'something' changes in the TopComponent.Registry the propertyChange is called (see 1).
Now in showbranch all the events are handled, which means that actually the label is updated a few times too much. For showpathintitle the amount of calls to updateTitle is a great deal less that the amount of events. (see 2 and 3)

I hope the picture made at least some sense.
I at least see considerable improvements in the performance, well done! 👍

  • Did it also 'count' the selected editor as reference? -> It did not count. Now a different text is shown #3

I actually meant, did it take the current editor in account when updating the title?
I ran the useNodeAsReference for a while, and side by side with the old logic in my development IDE, and I think it's the same behavior.
Is that true? I don't use it personally.

  • I updated the handling for useNodeAsReference. As a fallback I use the node instead of the current editor. The original idea of that is to see the label of the selected node. You can check that behaviour in the Services-window.

Ah so I guess that is my answer to my question ^there.
Good that it's now better.

  • What is your opinion on making getPath behave more like updatePath? -> I took a different direction. I introduced a TitleBuilder (not a real builder), but this way it is easier to implement #6. getPath is only a collector and the TitleBuilder is the renderer (... I should rename it this way)

Sounds fair. although I meant the suggestion mostly for this flow:

  • make new document tab group
  • open the project view
  • the project view is not an editor, so it looks up the current editor (which looks up the default editor TopComponent)
  • now the title changes to the editor in the original document tab group

Off topic

  • ... can also be applied to show-branch-in-statusbar I believe -> file an issue and a pull-request. I guess you are one of the few users. I got seldom feedback on that plugin.

That's a shame, I really like your plugins though! And that one helps me remember when I forgot to switch branches, or when I am on a particular branch.

  • Your avatar image shows CPH, correct?! I was there this summer and remember the statue and the opera in the back 😀

HAHA! Yes correct! 💯 points for you!
I was there last year with a few friends.

P.S. sorry for this wall of text

from show-path-in-title-netbeans-module.

markiewb avatar markiewb commented on June 1, 2024

@Shredder121: Thanks for the kudos!

from show-path-in-title-netbeans-module.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.