Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Composite consructor throws IllegalArgumentException on a non-null argument
icon9.gif  Composite consructor throws IllegalArgumentException on a non-null argument [message #534115] Tue, 18 May 2010 07:03 Go to next message
Alexey Romanov is currently offline Alexey RomanovFriend
Messages: 263
Registered: May 2010
Senior Member

This piece of code (in Scala)

val contents = {
  assert(mainWindow.detailsPane != null)
  new Composite(mainWindow.detailsPane, SWT.NONE)
}


throws an exception:

Exception occurred
java.lang.IllegalArgumentException: Argument not valid
    at org.eclipse.swt.SWT.error(Unknown Source)
    at org.eclipse.swt.SWT.error(Unknown Source)
    at org.eclipse.swt.SWT.error(Unknown Source)
    at org.eclipse.swt.widgets.Widget.error(Unknown Source)
    at org.eclipse.swt.widgets.Widget.checkParent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.<init>(Unknown Source)
    at org.eclipse.swt.widgets.Control.<init>(Unknown Source)
    at org.eclipse.swt.widgets.Scrollable.<init>(Unknown Source)
    at org.eclipse.swt.widgets.Composite.<init>(Unknown Source)
    at main.scala.NodeViewPresenter$NodeViewImpl.<init>(NodeViewPresenter.scala:41)


According to the documentation, IllegalArgumentException should only be thrown when the parent is null, but I am checking for that. detailsPane is a CTabFolder. (As I understand from examples, the controls I want to set as contents of CTabItem should be children of the CTabFolder.) Can anybody say why this could happen?

[Updated on: Tue, 18 May 2010 07:09]

Report message to a moderator

Re: Composite consructor throws IllegalArgumentException on a non-null argument [message #534130 is a reply to message #534115] Tue, 18 May 2010 08:11 Go to previous messageGo to next message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
May be u r CTabFolder is disposed...

check by putting a break point and add watch argument
mainWindow.detailsPane.isDisposed()


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Re: Composite consructor throws IllegalArgumentException on a non-null argument [message #534134 is a reply to message #534130] Tue, 18 May 2010 08:16 Go to previous message
Alexey Romanov is currently offline Alexey RomanovFriend
Messages: 263
Registered: May 2010
Senior Member
Thank you! This was correct.
Previous Topic:Combo: how to get rid of the 3d bar
Next Topic:CCombo: dropdown seems to be a little too "autonomous"
Goto Forum:
  


Current Time: Fri Aug 23 22:40:15 GMT 2019

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

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

Back to the top