Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Singleton EditPart
Singleton EditPart [message #209156] Sun, 12 February 2006 08:35 Go to next message
Eclipse UserFriend
Originally posted by: evaldas.taroza.stud-inf.unibz.it

Hi,
I want to implement Singleton design patern for one of my edit parts. So
I make a private final static reference to the edit part, private
constructor and public static getInstance(). The edit part factory calls
getInstance().

The problem is that even when I close the editor and open it again I get
the same singleton instance, although I would expect that every time I
open it, GEF creates a new singleton for me. In other words I want a new
singleton instance in every editing session, and every graphical editor.

What am I doing wrong?

Thanks.
Zeppe
Re: Singleton EditPart [message #209218 is a reply to message #209156] Mon, 13 February 2006 09:41 Go to previous message
Eclipse UserFriend
Originally posted by: ingo.koch[nospam].sap.com

Well, as the name says, a singleton is a singleton (the same static
instance) as long as you do not restart the JRE.

Regards, Ingo


"Zeppe" <evaldas.taroza@stud-inf.unibz.it> wrote in message
news:dsms1b$roc$1@utils.eclipse.org...
> Hi,
> I want to implement Singleton design patern for one of my edit parts. So
> I make a private final static reference to the edit part, private
> constructor and public static getInstance(). The edit part factory calls
> getInstance().
>
> The problem is that even when I close the editor and open it again I get
> the same singleton instance, although I would expect that every time I
> open it, GEF creates a new singleton for me. In other words I want a new
> singleton instance in every editing session, and every graphical editor.
>
> What am I doing wrong?
>
> Thanks.
> Zeppe
Previous Topic:Layout of diagram without connections
Next Topic:Coordinates Problem
Goto Forum:
  


Current Time: Fri Apr 26 03:28:42 GMT 2024

Powered by FUDForum. Page generated in 0.02956 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top