[platform-dev] Re: TopComponent.Registry

  • From: Javier Ortiz < >
  • To: " " < >
  • Subject: [platform-dev] Re: TopComponent.Registry
  • Date: Wed, 29 Feb 2012 20:17:22 +0000
  • Accept-language: en-US

Maybe create a template class that extends TopComponent and implements the new interface will do. That’s how I do that kind of thing. Just as an option.

 

 

Senior Software Quality Engineer

ArthroCare Corporation

7000 William Cannon Drive

Austin, TX 78735

Phone: 512-358-5996

email: ">

 

From: Chuck Davis [mailto: ]
Sent: Wednesday, February 29, 2012 2:16 PM
To:
Subject: [platform-dev] Re: TopComponent.Registry

 

Javier, thanks.  That might have lots of merit!  I'll check it out with some tests.  I hate to make all my TopComponents implement a security interface but if that's what it takes, thats what it takes!

On Wed, Feb 29, 2012 at 7:11 AM, Javier Ortiz < "> > wrote:

You just need to do the following to add stuff to the global Lookup:

·         Define an interface for the Security classes, let’s say Security

·         On each of the components that will implement this interface which you want registered add this annotation on top of the class declaration: @ServiceProvider(service = Security.class)

·         Retrieve them from the Lookup: Lookup.getDefault().lookupAll(Security.class) and do whatever you need to do.

I don’t see why there are issues with this. Maybe I need more details.

 

Error! Filename not specified.

 

Senior Software Quality Engineer

ArthroCare Corporation

7000 William Cannon Drive

Austin, TX 78735

Phone: 512-358-5996

email: " target="_blank">

 

From: Chuck Davis [mailto: " target="_blank"> ]
Sent: Wednesday, February 29, 2012 9:08 AM

 

Thanks Ernie.  I agree with Wade that it is strange a RCP does not already have such a common requirement built in.  As I'm studying the Platform I sometimes think the Platform is great for editors (which is, afterall, the central feature of an IDE) but for those of us whose users will never work with a file because our data is in databases, and is business data in nature, it is missing some necessary features.



Until I can find a good solution to Component-by-Component security I cannot progress with converting my Swing application to the Platform.

The new Definitive Guide uses JAAS but so far I can't visualize how it could meet my requirements.

I WILL find a way.  I want to use the Platform going forward!

On Tue, Feb 28, 2012 at 7:33 PM, Ernie Rael < " target="_blank"> > wrote:

You could either create your own central lookup or your TCs could add something to the default lookup.



On 2/28/2012 5:53 PM, Chuck Davis wrote:

Thanks, Javier, for the pointer.  I've not had much success with adding things to Lookups.  NB seems to add a lookup to TopComponents that can't be replaced or items added (unless that has changed).  When I tried to work with it by associating a new Lookup I got a nastygram that the TopComponent already had a Lookup and it could not be replaced.  Furthermore, the Lookup that was added was an undocumented class about which I could learn nothing.  I think that was with a daily build several weeks before the 7.1 release though and I probably should revisit the issue for my own learning.

Nevertheless, perhaps I could create something like my own TopComponent registry object.  I'll think on that!

Why not having those special modules register themselves in the Lookup?

 

Error! Filename not specified.

 

Senior Software Quality Engineer

ArthroCare Corporation

7000 William Cannon Drive

Austin, TX 78735

Phone: 512-358-5996

email: " target="_blank">

 

From: Emilian Bold [mailto: " target="_blank"> ]
Sent: Tuesday, February 28, 2012 3:48 PM
To: " target="_blank">
Subject: [platform-dev] Re: TopComponent.Registry

 

http://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/TopComponent.Registry.html#getOpened() ?

 

--emi

On Tue, Feb 28, 2012 at 11:38 PM, Chuck Davis < " target="_blank"> > wrote:

Would it be reasonable to add an iterator (or getter of an ArrayList,
etc)  to the registry so that we could examine all the top components
in the system?  Right now I want to walk all my top components and
look for Components with particular naming patterns for security
implementation but I have been unable to find a way to do that.  An
iterator over the registry seems to be a logical solution ????

If there already is a facility to accomplish this feat I should be
happy for a link to the javadoc, tutorial or something.

What I need:

for(TopComponent c : TopComponent.Registry.iterator) {
List listofcomponents = c.getComponents();
for(Component cc : listofcomponents) {
do.some.stuff()
}}

Thanks for any assistance.



 

--
http://www.josekibold.ro : Honesty & well-done software.

**********

The information contained in this e-mail message, together with any
attachments thereto, is intended only for the personal and confidential
use of the addressee named above. The message and the attachments
are or may be privileged or protected communication. If you are not the
intended recipient of this message, or authorized to receive it for the
intended recipient, you have received this message in error, and you
are not to review, use, disseminate, distribute or copy this message,
any attachments thereto, or their contents. If you have received this
message in error, please immediately notify us by return e-mail
message, and delete the original message.

Pursuant to Circular 230 issued by the United States Treasury
Department and relating to practice before the Internal Revenue
Services, any comment or opinion in this communication relating to a
federal tax issue is not intended to be used, and cannot be used, by a
taxpayer for the purpose of avoiding tax-related penalties that may be
imposed on the taxpayer.

 

 

**********

The information contained in this e-mail message, together with any
attachments thereto, is intended only for the personal and confidential
use of the addressee named above. The message and the attachments
are or may be privileged or protected communication. If you are not the
intended recipient of this message, or authorized to receive it for the
intended recipient, you have received this message in error, and you
are not to review, use, disseminate, distribute or copy this message,
any attachments thereto, or their contents. If you have received this
message in error, please immediately notify us by return e-mail
message, and delete the original message.

Pursuant to Circular 230 issued by the United States Treasury
Department and relating to practice before the Internal Revenue
Services, any comment or opinion in this communication relating to a
federal tax issue is not intended to be used, and cannot be used, by a
taxpayer for the purpose of avoiding tax-related penalties that may be
imposed on the taxpayer.

 

**********

The information contained in this e-mail message, together with any
attachments thereto, is intended only for the personal and confidential
use of the addressee named above. The message and the attachments
are or may be privileged or protected communication. If you are not the
intended recipient of this message, or authorized to receive it for the
intended recipient, you have received this message in error, and you
are not to review, use, disseminate, distribute or copy this message,
any attachments thereto, or their contents. If you have received this
message in error, please immediately notify us by return e-mail
message, and delete the original message.

Pursuant to Circular 230 issued by the United States Treasury
Department and relating to practice before the Internal Revenue
Services, any comment or opinion in this communication relating to a
federal tax issue is not intended to be used, and cannot be used, by a
taxpayer for the purpose of avoiding tax-related penalties that may be
imposed on the taxpayer.


[platform-dev] Re: TopComponent.Registry

Chuck Davis 02/28/2012

[platform-dev] Re: TopComponent.Registry

Emilian Bold 02/28/2012

[platform-dev] Re: TopComponent.Registry

Javier Ortiz 02/28/2012

[platform-dev] Re: TopComponent.Registry

Chuck Davis 02/29/2012

[platform-dev] Re: TopComponent.Registry

Ernie Rael 02/29/2012

[platform-dev] Re: TopComponent.Registry

Chuck Davis 02/29/2012

[platform-dev] Re: TopComponent.Registry

Javier Ortiz 02/29/2012

[platform-dev] Re: TopComponent.Registry

Chuck Davis 02/29/2012

[platform-dev] Re: TopComponent.Registry

Javier Ortiz 02/29/2012

[platform-dev] Re: TopComponent.Registry

Chuck Davis 02/29/2012

Project Features

Project Links

About this Project

Platform was started in November 2009, is owned by Antonin Nebuzelsky, and has 138 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close