Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Combo on GTK crashes eclipse.

Thanks Steve and Grant for your response.

"Steve wrote -- It's probably on 2.0.  You need to
verify that the behavior is consistent"
I tried it with the latest version and I could not
repeat the problem.
Actually one of the plugin's user also reported this
problem on 2.0.1, perhaps my plugin release was
compiled with the old Combo class.

I guess this solves the issue but i will still answer
your mails.

"Steve wrote -- Don't call it with null.  As indicated
by the exception, this isn't valid."
I was not calling it with null, it was occuring when i
was adding an element to an empty combo.

"Grant wrote -- Is Combo being subclassed? There's
definitely more info/context required in order to
determine what's happening."
Yes, I am extending Combo. Basically I was creating a
ComboFieldEditor that will be editable and will store
all its element in the preference store. This field
editor will be used to store user ids/server address
etc with some limited history.

I have a doStore() method in my EditableCombo class
which besides storing in preference does the
following:

//Sequence of items in combo is important i.e. if i
have 1, 2, 3, 4 in combo and user selects 3 and clicks
on apply then i should have 3, 1, 2, 4 in combo. So
that it is stored in preference in same sequenced to
be retrieved next time.

String comboTextValue = fCombo.getText();
		
//update the combo
if (comboTextValue.trim().length() > 0) {
	int indexOfTextInCombo =
fCombo.indexOf(comboTextValue);

	if ( indexOfTextInCombo != -1) {
		//remove from combo if found
		fCombo.remove(indexOfTextInCombo);
	}
					
	fCombo.add(comboTextValue, 0); //add at the start			
}


this add used to bomb, even though it was not null.


"Grant wrote -- Looking at Combo as it currently
exists in HEAD, I don't see how this stack trace is
possible since the error is occurring in
Combo.setItems(), which is invoked by Combo.add(),
which can never pass null as an argument"
The version which I was using also verified the same
but I do not know what was causing this problem.

Although there are two ComboFieldEditor classes in
different HEADS doing the same thing but none are
usefull for me. anyway, i think i will have to compile
and release my plugin with the latest version.

Thanks a lot for your help.

regards,
Amit.

__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/


Back to the top