exception occuring when moving comps to new VerticalPanel

GWT Designer allows you to quickly create the modules, composites, panels, remote services and other elements that comprise Google Web Tookit applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

exception occuring when moving comps to new VerticalPanel

Postby mwaschkowski » Thu Aug 28, 2008 6:29 am

Hi,

Using 5.1.0 downloaded this morning (Aug 28, 2008) in Eclipse 3.4 and Windows XP.

I'm getting an exception when moving element from one container to a new container in design view. I start off with:

Code: Select all
public class ContactPage extends BasePage {

  private FieldTemplateComposite fieldTemplateComposite_1;
  private FieldTemplateComposite fieldTemplateComposite;

  public ContactPage() {
    fieldTemplateComposite = new FieldTemplateComposite();
    fieldTemplateComposite.getFieldNameTextBox().setText("firstName");
    fieldTemplateComposite.getTemplateNameTextBox().setText("Contacts");
    getPagePanel().add(fieldTemplateComposite);

    fieldTemplateComposite_1 = new FieldTemplateComposite();
    fieldTemplateComposite_1.getFieldNameTextBox().setText("lastName");
    fieldTemplateComposite_1.getTemplateNameTextBox().setText("Contacts");
    getPagePanel().add(fieldTemplateComposite_1);
  }

}

and goto the design view and another vertical panel to put the fieldTemplateComposites in and then am going add the new vertical panel to the page panel, instead of adding the fieldTemplateComposites directly to the page panel.

Steps:
1) Open designer
2) Click on vertical panel
3) Add to top of page panel (which is also a VerticalPanel)
4) Attempt to drag one of the two FieldTemplateComposites from the pagePanel to the new vertical panel

and get an error. I will post .log at end of message.

If I then goto source and look at the updated class (after the exception has appeared) I have:

Code: Select all
public class ContactPage extends BasePage {

  private VerticalPanel verticalPanel;
  private FieldTemplateComposite fieldTemplateComposite_1;
  private FieldTemplateComposite fieldTemplateComposite;

  public ContactPage() {
    verticalPanel = new VerticalPanel();
    getPagePanel().add(verticalPanel);

    fieldTemplateComposite = new FieldTemplateComposite();
    fieldTemplateComposite.getFieldNameTextBox().setText("firstName");
    fieldTemplateComposite.getTemplateNameTextBox().setText("Contacts");
    getPagePanel().add(fieldTemplateComposite);

    fieldTemplateComposite_1 = new FieldTemplateComposite();
    fieldTemplateComposite_1.getFieldNameTextBox().setText("lastName");
    fieldTemplateComposite_1.getTemplateNameTextBox().setText("Contacts");
    getPagePanel().add(fieldTemplateComposite_1);
  }

}

If I then move the adding of the panel to the bottom of the constructor (getPagePanel().add(verticalPanel);), like so:

Code: Select all
public class ContactPage extends BasePage {
  private VerticalPanel verticalPanel;
  private FieldTemplateComposite fieldTemplateComposite_1;

  private FieldTemplateComposite fieldTemplateComposite;

  public ContactPage() {
    verticalPanel = new VerticalPanel();

    fieldTemplateComposite = new FieldTemplateComposite();
    fieldTemplateComposite.getFieldNameTextBox().setText("firstName");
    fieldTemplateComposite.getTemplateNameTextBox().setText("Contacts");
    getPagePanel().add(fieldTemplateComposite);

    fieldTemplateComposite_1 = new FieldTemplateComposite();
    fieldTemplateComposite_1.getFieldNameTextBox().setText("lastName");
    fieldTemplateComposite_1.getTemplateNameTextBox().setText("Contacts");
    getPagePanel().add(fieldTemplateComposite_1);
   
    getPagePanel().add(verticalPanel);
  }

}

goto the design view and try to move the FieldTemplateComposites again, the design view works fine and the final result being:

Code: Select all
public class ContactPage extends BasePage {

  private VerticalPanel verticalPanel;
  private FieldTemplateComposite fieldTemplateComposite_1;

  private FieldTemplateComposite fieldTemplateComposite;

  public ContactPage() {
    verticalPanel = new VerticalPanel();
   
    getPagePanel().add(verticalPanel);
   
    fieldTemplateComposite = new FieldTemplateComposite();
    verticalPanel.add(fieldTemplateComposite);
    fieldTemplateComposite.getFieldNameTextBox().setText("firstName");
    fieldTemplateComposite.getTemplateNameTextBox().setText("Contacts");

    fieldTemplateComposite_1 = new FieldTemplateComposite();
    verticalPanel.add(fieldTemplateComposite_1);
    fieldTemplateComposite_1.getFieldNameTextBox().setText("lastName");
    fieldTemplateComposite_1.getTemplateNameTextBox().setText("Contacts");
  }

}

Is this a bug or am I doing something I shouldn't be?

Thanks for your help,

Mark


Code: Select all
Log:
!SESSION 2008-08-28 10:35:36.743 -----------------------------------------------
eclipse.buildId=I20080617-2000
java.version=1.6.0_07
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -Xmx512
Command-line arguments:  -os win32 -ws win32 -arch x86 -Xmx512

!ENTRY com.swtdesigner 1 1 2008-08-28 10:36:28.352
!MESSAGE "{
    verticalPanel = new VerticalPanel();
    getPagePanel().add(verticalPanel);
    fieldTemplateComposite = new FieldTemplateComposite();
    verticalPanel.add(fieldTemplateComposite);
    fieldTemplateComposite.getFieldNameTextBox().setText("firstName");
    fieldTemplateComposite.getTemplateNameTextBox().setText("Contacts");

    fieldTemplateComposite_1 = new FieldTemplateComposite();
    fieldTemplateComposite_1.getFieldNameTextBox().setText("lastName");
    fieldTemplateComposite_1.getTemplateNameTextBox().setText("Contacts");
    getPagePanel().add(fieldTemplateComposite_1);
   
   
  }" != "{verticalPanel=new VerticalPanel();fieldTemplateComposite=new FieldTemplateComposite();verticalPanel.add(fieldTemplateComposite);fieldTemplateComposite.getFieldNameTextBox().setText("firstName");fieldTemplateComposite.getTemplateNameTextBox().setText("Contacts");getPagePanel().add(verticalPanel);fieldTemplateComposite_1=new FieldTemplateComposite();fieldTemplateComposite_1.getFieldNameTextBox().setText("lastName");fieldTemplateComposite_1.getTemplateNameTextBox().setText("Contacts");getPagePanel().add(fieldTemplateComposite_1);}"
java.lang.Throwable
   at com.swtdesigner.model.util.ast.ASTEditor.hasValidSource(ASTEditor.java:3800)
   at com.swtdesigner.model.util.ast.ASTEditor$10.preVisit(ASTEditor.java:3759)
   at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476)
   at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2525)
   at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:502)
   at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2478)
   at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2548)
   at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:475)
   at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2478)
   at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2548)
   at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:214)
   at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2478)
   at com.swtdesigner.model.util.ast.ASTEditor.performDiagnosticTests(ASTEditor.java:3756)
   at com.swtdesigner.model.util.ast.ASTEditor.endEdit(ASTEditor.java:627)
   at com.swtdesigner.model.util.ast.ASTEditor.endEdit(ASTEditor.java:601)
   at com.swtdesigner.model.util.ast.ASTEditor.endEdit(ASTEditor.java:587)
   at com.swtdesigner.model.JavaInfo.endEdit(JavaInfo.java:770)
   at com.swtdesigner.gef.common.property.DesignerEditorPropertyComposite$15.performDrop(DesignerEditorPropertyComposite.java:1251)
   at org.eclipse.jface.viewers.ViewerDropAdapter.drop(ViewerDropAdapter.java:239)
   at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:90)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
   at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:770)
   at org.eclipse.swt.dnd.DropTarget.Drop(DropTarget.java:455)
   at org.eclipse.swt.dnd.DropTarget$3.method6(DropTarget.java:257)
   at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:119)
   at org.eclipse.swt.internal.ole.win32.COM.DoDragDrop(Native Method)
   at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:362)
   at org.eclipse.swt.dnd.DragSource.access$0(DragSource.java:288)
   at org.eclipse.swt.dnd.DragSource$1.handleEvent(DragSource.java:171)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
   at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
   at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
   at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
   at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
   at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
   at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
   at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
   at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
   at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
mwaschkowski
 
Posts: 23
Joined: Mon Jan 21, 2008 8:54 am

Re: exception occuring when moving comps to new VerticalPanel

Postby mwaschkowski » Thu Aug 28, 2008 6:37 am

PS. here is the relevant code from the base class as well:

public class BasePage extends Composite implements HasWidgets {

protected VerticalPanel pagePanel = new VerticalPanel();

...

public VerticalPanel getPagePanel() {
return pagePanel;
}

}
mwaschkowski
 
Posts: 23
Joined: Mon Jan 21, 2008 8:54 am

Re: exception occuring when moving comps to new VerticalPanel

Postby Eric Clayberg » Thu Aug 28, 2008 7:33 am

mwaschkowski wrote:am I doing something I shouldn't be?

Yes.

Turn off diagnostic mode (Designer > General > Enable diagnostic checking pref). You shouldn't turn that on unless we ask you to for some reason (as stated in the docs and in the tooltip associated with that option).

Enable diagnostic checking

This preference controls whether diagnostic checking is turned on. Diagnostic checking traps certain types of code generation errors. Diagnostic mode is intended to flag differences between the source that exists and the source as recreated by the Eclipse parser. Normally, the two will match exactly, but syntactical differences or problems in the source (even minor ones) will cause a diagnostic failure (this is intentional). In general, you should not turn this option on unless asked to for some reason by Instantiations technical support.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: exception occuring when moving comps to new VerticalPanel

Postby mwaschkowski » Thu Aug 28, 2008 10:35 am

Ugh, my apologies. I did not see the warning as you have to wait for the popup, and I do have a tendency to tinker sometimes...

Perhaps I'm a bit bias :lol: , but I would suggest maybe putting that error message right into the dialog so you don't have to wait for a tooltip. I've read through some of the docs, but not that part, and like I said, I do tinker, which can lead to trouble :oops: , but I'm not used to checking a preference box and having things come to a <crashing> halt, although it does make perfect sense, now.

A lot of things that seemed to not be working that I was simply blaming on beta status are now working (surprise, surprise).

Thanks, and again, sorry for the bother.

Mark
mwaschkowski
 
Posts: 23
Joined: Mon Jan 21, 2008 8:54 am

Re: exception occuring when moving comps to new VerticalPanel

Postby Eric Clayberg » Thu Aug 28, 2008 5:03 pm

mwaschkowski wrote:A lot of things that seemed to not be working that I was simply blaming on beta status are now working

I'm glad its now working for you.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to GWT Designer

Who is online

Users browsing this forum: No registered users and 3 guests