Netbeans antlr

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Netbeans antlr

Peter Cheung
Hi All
    Is it a good design for my netbeans antlr plugin?

   I need to save a string/file that belong to editor, every editor store it own value (different values for different editor. And retrieve the values in other topcomponent. What is the best way to do that? Should I just create a static hashmap to store all these values?

Thanks
from Peter

Reply | Threaded
Open this post in threaded view
|

Re: Netbeans antlr

Dmitry Avtonomov
Iterate through all open TopComponents, checking their actual type, then getting the value needed should work and be the simples maybe?

Set<TopComponent> tops = TopComponent.Registry.getOpened();
for (TopComponent top : tops) {
  if (top instanceof YourTopComponent) {
    YourTopComponent ytc = (YourTopComponent)top;
    String value = ytc.callFancyMethod();
  }
}


Best,
Dmitry

On Sat, Sep 16, 2017 at 1:59 PM, Peter Cheung <[hidden email]> wrote:
Hi All
    Is it a good design for my netbeans antlr plugin?

   I need to save a string/file that belong to editor, every editor store it own value (different values for different editor. And retrieve the values in other topcomponent. What is the best way to do that? Should I just create a static hashmap to store all these values?

Thanks
from Peter


Reply | Threaded
Open this post in threaded view
|

Re: Netbeans antlr

Peter Cheung
Thanks Dmitry

From: Dmitry Avtonomov <[hidden email]>
Sent: Sunday, September 17, 2017 10:21 AM
To: [hidden email]
Subject: [platform-dev] Re: Netbeans antlr
 
Iterate through all open TopComponents, checking their actual type, then getting the value needed should work and be the simples maybe?

Set<TopComponent> tops = TopComponent.Registry.getOpened();
for (TopComponent top : tops) {
  if (top instanceof YourTopComponent) {
    YourTopComponent ytc = (YourTopComponent)top;
    String value = ytc.callFancyMethod();
  }
}


Best,
Dmitry

On Sat, Sep 16, 2017 at 1:59 PM, Peter Cheung <[hidden email]> wrote:
Hi All
    Is it a good design for my netbeans antlr plugin?

   I need to save a string/file that belong to editor, every editor store it own value (different values for different editor. And retrieve the values in other topcomponent. What is the best way to do that? Should I just create a static hashmap to store all these values?

Thanks
from Peter


Reply | Threaded
Open this post in threaded view
|

Re: Netbeans antlr

Volodymyr Babin
In reply to this post by Peter Cheung
Hi Peter, it looks awesome, how to download it? 

--- Оригінальне повідомлення ---
Від кого: "Peter Cheung" <[hidden email]>
Дата: 16 вересня 2017, 21:01:34

Hi All
    Is it a good design for my netbeans antlr plugin?

   I need to save a string/file that belong to editor, every editor store it own value (different values for different editor. And retrieve the values in other topcomponent. What is the best way to do that? Should I just create a static hashmap to store all these values?

Thanks
from Peter

Reply | Threaded
Open this post in threaded view
|

Re: Netbeans antlr

Peter Cheung

Hi Volodymyr

   I am finishing the last piece, then upload to netbeans plugin central, probably end of next week. Will inform you, thanks

Peter.




From: Volodymyr <[hidden email]>
Sent: Thursday, September 28, 2017 3:21 PM
To: [hidden email]
Subject: [platform-dev] Re: Netbeans antlr
 
Hi Peter, it looks awesome, how to download it? 

--- Оригінальне повідомлення ---
Від кого: "Peter Cheung" <[hidden email]>
Дата: 16 вересня 2017, 21:01:34

Hi All
    Is it a good design for my netbeans antlr plugin?

   I need to save a string/file that belong to editor, every editor store it own value (different values for different editor. And retrieve the values in other topcomponent. What is the best way to do that? Should I just create a static hashmap to store all these values?

Thanks
from Peter