Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » SWT: no more handles error
SWT: no more handles error [message #230266] Thu, 08 February 2007 05:10 Go to next message
Eclipse User
Originally posted by: neerajkarandikar.gmail.com

Hello everyone,

I am using GEF to create a sequence diagram editor. I have Graphicle Viewer
and Tree Viewer with flyoout palette, Overview Pane and Outline Page in my
editor. The problem i am facing is i get SWT.no more handles exception when
i repeatedly(three times) open a file having large no. of icons in it
(approximately 60). I have tried various options to dispose the images
during deactivate() call of all corresponding editParts. as follows:

Approach 1:
public void deactivate() {
if (isActive()) {
super.deactivate();
((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
unregisterVisuals();
//REMOVE THE FIGURE OF THE MODEL
}
}

Approach 2:
public void deactivate() {
if (isActive()) {
super.deactivate();
((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
getModel().getIcon().dispose();
// DISPOSE THE ICON USED BY THE MODEL
}
}

Still i get the same exception. Can anyone please help me solve this
problem.
Thanks,
-Neeraj
Re: SWT: no more handles error [message #230348 is a reply to message #230266] Fri, 09 February 2007 08:45 Go to previous messageGo to next message
Manuel Selva is currently offline Manuel Selva
Messages: 189
Registered: July 2009
Location: Grenoble, France
Senior Member
Hi,

The exception you are facing just indicates that the OS underneath your
applications doesn't allow more icons to be allocated. There is no
solutions to solve this, it is a limitation of the system.
A workaround could be to create at a single time only visible icons, and
when new icons are needed dispose the previous ones becoming unneeded.

Manuel Selva


Re: SWT: no more handles error [message #230384 is a reply to message #230266] Fri, 09 February 2007 19:27 Go to previous messageGo to next message
Eclipse User
Originally posted by: irbull.cs.uvic.ca

Can you add some debug code to ensure that the icons are actually being
disposed?

cheers,
ian

neeraj wrote:
> Hello everyone,
>
> I am using GEF to create a sequence diagram editor. I have Graphicle Viewer
> and Tree Viewer with flyoout palette, Overview Pane and Outline Page in my
> editor. The problem i am facing is i get SWT.no more handles exception when
> i repeatedly(three times) open a file having large no. of icons in it
> (approximately 60). I have tried various options to dispose the images
> during deactivate() call of all corresponding editParts. as follows:
>
> Approach 1:
> public void deactivate() {
> if (isActive()) {
> super.deactivate();
> ((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
> unregisterVisuals();
> //REMOVE THE FIGURE OF THE MODEL
> }
> }
>
> Approach 2:
> public void deactivate() {
> if (isActive()) {
> super.deactivate();
> ((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
> getModel().getIcon().dispose();
> // DISPOSE THE ICON USED BY THE MODEL
> }
> }
>
> Still i get the same exception. Can anyone please help me solve this
> problem.
> Thanks,
> -Neeraj
>
>
Re: no more handles error [message #230405 is a reply to message #230266] Mon, 12 February 2007 06:44 Go to previous messageGo to next message
Eclipse User
Originally posted by: neerajkarandikar.gmail.com

Thanks Manuel and Ian for the reply. I have found a place in my code where i
create figures multiple times for similer icons. I'll try to remove that
part from code.

"neeraj" <neerajkarandikar@gmail.com> wrote in message
news:eqebd4$mt5$1@utils.eclipse.org...
> Hello everyone,
>
> I am using GEF to create a sequence diagram editor. I have Graphicle
> Viewer and Tree Viewer with flyoout palette, Overview Pane and Outline
> Page in my editor. The problem i am facing is i get SWT.no more handles
> exception when i repeatedly(three times) open a file having large no. of
> icons in it (approximately 60). I have tried various options to dispose
> the images during deactivate() call of all corresponding editParts. as
> follows:
>
> Approach 1:
> public void deactivate() {
> if (isActive()) {
> super.deactivate();
> ((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
> unregisterVisuals(); //REMOVE THE FIGURE OF THE MODEL
> }
> }
>
> Approach 2:
> public void deactivate() {
> if (isActive()) {
> super.deactivate();
> ((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
> getModel().getIcon().dispose(); // DISPOSE THE ICON USED BY THE MODEL
> }
> }
>
> Still i get the same exception. Can anyone please help me solve this
> problem.
> Thanks,
> -Neeraj
>
Re: no more handles error [message #230506 is a reply to message #230266] Tue, 13 February 2007 00:23 Go to previous messageGo to next message
Eclipse User
Originally posted by: none.unknown.com

Does each of your model objects hold on to an image handle? You shouldn't
have it that way.

> getModel().getIcon().dispose();

"neeraj" <neerajkarandikar@gmail.com> wrote in message
news:eqebd4$mt5$1@utils.eclipse.org...
> Hello everyone,
>
> I am using GEF to create a sequence diagram editor. I have Graphicle
> Viewer and Tree Viewer with flyoout palette, Overview Pane and Outline
> Page in my editor. The problem i am facing is i get SWT.no more handles
> exception when i repeatedly(three times) open a file having large no. of
> icons in it (approximately 60). I have tried various options to dispose
> the images during deactivate() call of all corresponding editParts. as
> follows:
>
> Approach 1:
> public void deactivate() {
> if (isActive()) {
> super.deactivate();
> ((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
> unregisterVisuals(); //REMOVE THE FIGURE OF THE MODEL
> }
> }
>
> Approach 2:
> public void deactivate() {
> if (isActive()) {
> super.deactivate();
> ((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
> getModel().getIcon().dispose(); // DISPOSE THE ICON USED BY THE MODEL
> }
> }
>
> Still i get the same exception. Can anyone please help me solve this
> problem.
> Thanks,
> -Neeraj
>
Re: no more handles error [message #230560 is a reply to message #230506] Tue, 13 February 2007 09:32 Go to previous message
Eclipse User
Originally posted by: neerajkarandikar.gmail.com

Thanks Pratik,
I was infact making big mistake of not using imageregistry. I have it now.
And it works like a dream.
-Neeraj

"Pratik Shah" <none@unknown.com> wrote in message
news:eqr0d5$dtk$1@utils.eclipse.org...
> Does each of your model objects hold on to an image handle? You shouldn't
> have it that way.
>
>> getModel().getIcon().dispose();
>
> "neeraj" <neerajkarandikar@gmail.com> wrote in message
> news:eqebd4$mt5$1@utils.eclipse.org...
>> Hello everyone,
>>
>> I am using GEF to create a sequence diagram editor. I have Graphicle
>> Viewer and Tree Viewer with flyoout palette, Overview Pane and Outline
>> Page in my editor. The problem i am facing is i get SWT.no more handles
>> exception when i repeatedly(three times) open a file having large no. of
>> icons in it (approximately 60). I have tried various options to dispose
>> the images during deactivate() call of all corresponding editParts. as
>> follows:
>>
>> Approach 1:
>> public void deactivate() {
>> if (isActive()) {
>> super.deactivate();
>> ((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
>> unregisterVisuals(); //REMOVE THE FIGURE OF THE MODEL
>> }
>> }
>>
>> Approach 2:
>> public void deactivate() {
>> if (isActive()) {
>> super.deactivate();
>> ((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
>> getModel().getIcon().dispose(); // DISPOSE THE ICON USED BY THE MODEL
>> }
>> }
>>
>> Still i get the same exception. Can anyone please help me solve this
>> problem.
>> Thanks,
>> -Neeraj
>>
>
>
Previous Topic:1 diagram only
Next Topic:Palette Name as shape label
Goto Forum:
  


Current Time: Fri Oct 24 11:15:58 GMT 2014

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

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