Home » Archived » Visual Editor (VE) » Parse Error and partial solution
| |
Re: Parse Error and partial solution [message #118133 is a reply to message #118091] |
Thu, 16 February 2006 14:48 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
I downloaded the source and no where does it do:
>
> final PopupCalendar popupCal = new PopupCalendar(sShell , PopupCalendar.SHOWALL, Locale.FRENCH);
>
So I can't debug it. I need to have the code this was in so that I can
see why you are getting the error. Often the parser is sensitive to all
of the code, not just one line of code.
--
Thanks,
Rich Kulp
|
|
|
Re: Parse Error and partial solution [message #118144 is a reply to message #118133] |
Thu, 16 February 2006 16:14 |
Dominique Buenzli Messages: 59 Registered: July 2009 |
Member |
|
|
------=_Part_2151_8167228.1140106564225
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Thanks for your reply,
I am using Eclipse 3.2M4, VE1.2M1, EMF2.2M3, GEF3,2M3 on Mac OS X 10.4.5 with java 1.5 (it is actually the same problem on a windows xp machine with java 1.4.2 and the same eclipse configuration).
Concerning the code, I installed the package net.cwroethel.swt.popupcalendar and then used the SimpleExample2 to produce the attached source.
------=_Part_2151_8167228.1140106564225
Content-Type: application/octet-stream;
name=Medclipse_Consultation_Consultation_PopUp_RDV.java
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename=Medclipse_Consultation_Consultation_PopUp_RDV.java
package ch.medclipse.application;
import java.util.Locale;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.layout.GridData;
import net.cwroethel.swt.popupcalendar.*;
import org.eclipse.swt.events.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.SWT;
import java.text.SimpleDateFormat;
import java.util.Locale;
public class Medclipse_Consultation_Consultation_PopUp_RDV {
Shell sShell = null; // @jve:decl-index=0:visual-constraint="10,10"
private ScrolledComposite scrolledComposite = null;
private Composite composite = null;
private Combo combodans = null;
private Button radioButtondans = null;
private Button radioButtontousles = null;
private Combo combotousles = null;
private Button radioButtondate = null;
private Button buttonajouter = null;
//* Pop-Up Calendar
private Text textdate = null;
private Button buttondatepop = null;
//**
/**
* This method initializes sShell
*/
void createSShell() {
sShell = new Shell(SWT.SHELL_TRIM | SWT.APPLICATION_MODAL);
sShell.setText("PROCHAIN RENDEZ-VOUS");
sShell.setLayout(new FillLayout()); // Generated
sShell.setLocation(new Point(300, 300));
createScrolledComposite();
sShell.setSize(new Point(302, 172));
}
/**
* This method initializes scrolledComposite
*
*/
private void createScrolledComposite() {
scrolledComposite = new ScrolledComposite(sShell, SWT.NONE);
scrolledComposite.setExpandHorizontal(true); // Generated
createComposite();
scrolledComposite.setExpandVertical(true); // Generated
scrolledComposite.setContent(composite); // Generated
}
//* create the popup calendar.
final PopupCalendar popupCal = new PopupCalendar(sShell , PopupCalendar.SHOWALL, Locale.FRENCH);
//**
/**
* This method initializes composite
*
*/
private void createComposite() {
GridData gridData = new GridData();
gridData.widthHint = 100; // Generated
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 3; // Generated
composite = new Composite(scrolledComposite, SWT.NONE);
composite.setLayout(gridLayout); // Generated
radioButtondate = new Button(composite, SWT.RADIO);
radioButtondate.setText("Date"); // Generated
//* Pop-Up Calendar
//create the Calendar Text widget.
textdate = new Text(composite, SWT.CENTER | SWT.READ_ONLY);
GridData data = new GridData();
data.widthHint = 80;
data.heightHint = 20;
textdate.setLayoutData(data);
textdate.setBackground(Display.getCurrent().getSystemColor(S WT.COLOR_WHITE));
//create the Calendar button and pop-up, listener
buttondatepop = new Button(composite, SWT.NONE);
buttondatepop
.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
Control comp = (Control)event.getSource();
popupCal.open(comp, PopupCalendar.RIGHT);
buttondatepop.setFocus();
// a little trick to speed up opening the window
popupCal.getDateChooser().paint();
}
});
// finally add the selection listener for pop-up calendar
popupCal.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (popupCal.getDate() != null) {
textdate.setText(new SimpleDateFormat("EEE dd/MM/yy").format(
popupCal.getDate().getTime()));
}
}
});
//** End Pop-Up Calendar
radioButtondans = new Button(composite, SWT.RADIO);
radioButtondans.setText("Dans"); // Generated
createCombodans();
Label filler3 = new Label(composite, SWT.NONE);
radioButtontousles = new Button(composite, SWT.RADIO);
radioButtontousles.setText("Tous les"); // Generated
createCombotousles();
Label filler = new Label(composite, SWT.NONE);
Label filler1 = new Label(composite, SWT.NONE);
Label filler2 = new Label(composite, SWT.NONE);
buttonajouter = new Button(composite, SWT.NONE);
buttonajouter.setText("Ajouter"); // Generated
}
/**
* This method initializes combodans
*
*/
private void createCombodans() {
GridData gridData1 = new GridData();
gridData1.widthHint = 100;
combodans = new Combo(composite, SWT.NONE);
combodans.setItems (new String []{"","1 jour","2 jours","3 jours","4 jours","5 jours","6 jours","1 semaine", "2 semaines","3 semaines","1 mois","2 mois","3 mois","4 mois", "5 mois","6 mois","7 mois","8 mois", "9 mois","10 mois","11 mois","1 an"});
combodans.setLayoutData(gridData1);
}
/**
* This method initializes combotousles
*
*/
private void createCombotousles() {
GridData gridData2 = new GridData();
gridData2.widthHint = 100;
combotousles = new Combo(composite, SWT.NONE);
combotousles.setItems (new String []{"","1 jour","2 jours","3 jours","4 jours","5 jours","1 semaine", "2 semaines","3 semaines","1 mois","2 mois","3 mois","4 mois", "5 mois","6 mois","7 mois","8 mois", "9 mois","10 mois","11 mois","1 an"});
combotousles.setLayoutData(gridData2);
}}
------=_Part_2151_8167228.1140106564225--
|
|
|
Re: Parse Error and partial solution [message #118166 is a reply to message #118144] |
Thu, 16 February 2006 17:01 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
Thanks.
I've opened
https://bugs.eclipse.org/bugs/show_bug.cgi?id=128247
to address this problem. But for now what you need to do is change to:
PopupCalendar popupCal;
createShell() {
sShell = ...
popupCal = new PopupCalendar(sShell , PopupCalendar.SHOWALL,
Locale.FRENCH);
}
You will get some exceptions in the error log, but you can ignore them.
The problem with this new pattern is that we don't realize that
PopupCalendar is an SWT wrapper so we don't call the constructor on the
SWT UI thread. But the rest of your class will show.
Buenzli wrote:
> Thanks for your reply,
>
> I am using Eclipse 3.2M4, VE1.2M1, EMF2.2M3, GEF3,2M3 on Mac OS X 10.4.5 with java 1.5 (it is actually the same problem on a windows xp machine with java 1.4.2 and the same eclipse configuration).
>
> Concerning the code, I installed the package net.cwroethel.swt.popupcalendar and then used the SimpleExample2 to produce the attached source.
--
Thanks,
Rich Kulp
|
|
| |
Re: Parse Error and partial solution [message #118187 is a reply to message #118177] |
Thu, 16 February 2006 22:43 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
The error is happening in your code:
> Caused by: java.lang.NullPointerException
> at ch.medclipse.application.Medclipse_Consultation_Consultation _PopUp_Demandes.createGrouplaboratoire(Medclipse_Consultatio n_Consultation_PopUp_Demandes.java:314)
> at ch.medclipse.application.Medclipse_Consultation_Consultation _PopUp_Demandes.createComposite(Medclipse_Consultation_Consu ltation_PopUp_Demandes.java:223)
> at ch.medclipse.application.Medclipse_Consultation_Consultation _PopUp_Demandes.createScrolledComposite(Medclipse_Consultati on_Consultation_PopUp_Demandes.java:186)
> at ch.medclipse.application.Medclipse_Consultation_Consultation _PopUp_Demandes.createSShell(Medclipse_Consultation_Consulta tion_PopUp_Demandes.java:172)
> ... 7 more
>
> MMmmfff what does it mean ? Am I doing something wrong ?
You need to see why you would get an NPE at line 314 of the class
Medclipse_Consultation_Consultation_PopUp_Demandes.
--
Thanks,
Rich Kulp
|
|
| |
Re: Parse Error and partial solution [message #118293 is a reply to message #118211] |
Fri, 17 February 2006 15:20 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
What line is actually in error? Is it the popupCal.addSelectionListener()?
If it is, then the problem is popupCal is null. This would happen
because where you put the popupCal = new .... has not yet been called.
The best place to put it is immediately after the new Shell() for which
the popupCal is for. Assuming you are trying to access it after that
shell has been created and not before.
Buenzli wrote:
> The error comes from here:
> // **// finally add the selection listener for pop-up calendar
> popupCal.addSelectionListener(new SelectionAdapter() {
> public void widgetSelected(SelectionEvent e) {
> if (popupCal.getDate() != null) {
> textdatelabo.setText(new SimpleDateFormat("EEE dd/MM/yy").format(
> popupCal.getDate().getTime()));
> }
> }
> });
>
> I attached the full code.
--
Thanks,
Rich Kulp
|
|
| | |
Re: Parse Error and partial solution [message #612129 is a reply to message #118091] |
Thu, 16 February 2006 14:48 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
I downloaded the source and no where does it do:
>
> final PopupCalendar popupCal = new PopupCalendar(sShell , PopupCalendar.SHOWALL, Locale.FRENCH);
>
So I can't debug it. I need to have the code this was in so that I can
see why you are getting the error. Often the parser is sensitive to all
of the code, not just one line of code.
--
Thanks,
Rich Kulp
|
|
|
Re: Parse Error and partial solution [message #612130 is a reply to message #118133] |
Thu, 16 February 2006 16:14 |
Dominique Buenzli Messages: 59 Registered: July 2009 |
Member |
|
|
------=_Part_2151_8167228.1140106564225
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Thanks for your reply,
I am using Eclipse 3.2M4, VE1.2M1, EMF2.2M3, GEF3,2M3 on Mac OS X 10.4.5 with java 1.5 (it is actually the same problem on a windows xp machine with java 1.4.2 and the same eclipse configuration).
Concerning the code, I installed the package net.cwroethel.swt.popupcalendar and then used the SimpleExample2 to produce the attached source.
------=_Part_2151_8167228.1140106564225
Content-Type: application/octet-stream;
name=Medclipse_Consultation_Consultation_PopUp_RDV.java
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename=Medclipse_Consultation_Consultation_PopUp_RDV.java
package ch.medclipse.application;
import java.util.Locale;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.layout.GridData;
import net.cwroethel.swt.popupcalendar.*;
import org.eclipse.swt.events.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.SWT;
import java.text.SimpleDateFormat;
import java.util.Locale;
public class Medclipse_Consultation_Consultation_PopUp_RDV {
Shell sShell = null; // @jve:decl-index=0:visual-constraint="10,10"
private ScrolledComposite scrolledComposite = null;
private Composite composite = null;
private Combo combodans = null;
private Button radioButtondans = null;
private Button radioButtontousles = null;
private Combo combotousles = null;
private Button radioButtondate = null;
private Button buttonajouter = null;
//* Pop-Up Calendar
private Text textdate = null;
private Button buttondatepop = null;
//**
/**
* This method initializes sShell
*/
void createSShell() {
sShell = new Shell(SWT.SHELL_TRIM | SWT.APPLICATION_MODAL);
sShell.setText("PROCHAIN RENDEZ-VOUS");
sShell.setLayout(new FillLayout()); // Generated
sShell.setLocation(new Point(300, 300));
createScrolledComposite();
sShell.setSize(new Point(302, 172));
}
/**
* This method initializes scrolledComposite
*
*/
private void createScrolledComposite() {
scrolledComposite = new ScrolledComposite(sShell, SWT.NONE);
scrolledComposite.setExpandHorizontal(true); // Generated
createComposite();
scrolledComposite.setExpandVertical(true); // Generated
scrolledComposite.setContent(composite); // Generated
}
//* create the popup calendar.
final PopupCalendar popupCal = new PopupCalendar(sShell , PopupCalendar.SHOWALL, Locale.FRENCH);
//**
/**
* This method initializes composite
*
*/
private void createComposite() {
GridData gridData = new GridData();
gridData.widthHint = 100; // Generated
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 3; // Generated
composite = new Composite(scrolledComposite, SWT.NONE);
composite.setLayout(gridLayout); // Generated
radioButtondate = new Button(composite, SWT.RADIO);
radioButtondate.setText("Date"); // Generated
//* Pop-Up Calendar
//create the Calendar Text widget.
textdate = new Text(composite, SWT.CENTER | SWT.READ_ONLY);
GridData data = new GridData();
data.widthHint = 80;
data.heightHint = 20;
textdate.setLayoutData(data);
textdate.setBackground(Display.getCurrent().getSystemColor(S WT.COLOR_WHITE));
//create the Calendar button and pop-up, listener
buttondatepop = new Button(composite, SWT.NONE);
buttondatepop
.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
Control comp = (Control)event.getSource();
popupCal.open(comp, PopupCalendar.RIGHT);
buttondatepop.setFocus();
// a little trick to speed up opening the window
popupCal.getDateChooser().paint();
}
});
// finally add the selection listener for pop-up calendar
popupCal.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (popupCal.getDate() != null) {
textdate.setText(new SimpleDateFormat("EEE dd/MM/yy").format(
popupCal.getDate().getTime()));
}
}
});
//** End Pop-Up Calendar
radioButtondans = new Button(composite, SWT.RADIO);
radioButtondans.setText("Dans"); // Generated
createCombodans();
Label filler3 = new Label(composite, SWT.NONE);
radioButtontousles = new Button(composite, SWT.RADIO);
radioButtontousles.setText("Tous les"); // Generated
createCombotousles();
Label filler = new Label(composite, SWT.NONE);
Label filler1 = new Label(composite, SWT.NONE);
Label filler2 = new Label(composite, SWT.NONE);
buttonajouter = new Button(composite, SWT.NONE);
buttonajouter.setText("Ajouter"); // Generated
}
/**
* This method initializes combodans
*
*/
private void createCombodans() {
GridData gridData1 = new GridData();
gridData1.widthHint = 100;
combodans = new Combo(composite, SWT.NONE);
combodans.setItems (new String []{"","1 jour","2 jours","3 jours","4 jours","5 jours","6 jours","1 semaine", "2 semaines","3 semaines","1 mois","2 mois","3 mois","4 mois", "5 mois","6 mois","7 mois","8 mois", "9 mois","10 mois","11 mois","1 an"});
combodans.setLayoutData(gridData1);
}
/**
* This method initializes combotousles
*
*/
private void createCombotousles() {
GridData gridData2 = new GridData();
gridData2.widthHint = 100;
combotousles = new Combo(composite, SWT.NONE);
combotousles.setItems (new String []{"","1 jour","2 jours","3 jours","4 jours","5 jours","1 semaine", "2 semaines","3 semaines","1 mois","2 mois","3 mois","4 mois", "5 mois","6 mois","7 mois","8 mois", "9 mois","10 mois","11 mois","1 an"});
combotousles.setLayoutData(gridData2);
}}
------=_Part_2151_8167228.1140106564225--
|
|
|
Re: Parse Error and partial solution [message #612132 is a reply to message #118144] |
Thu, 16 February 2006 17:01 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
Thanks.
I've opened
https://bugs.eclipse.org/bugs/show_bug.cgi?id=128247
to address this problem. But for now what you need to do is change to:
PopupCalendar popupCal;
createShell() {
sShell = ...
popupCal = new PopupCalendar(sShell , PopupCalendar.SHOWALL,
Locale.FRENCH);
}
You will get some exceptions in the error log, but you can ignore them.
The problem with this new pattern is that we don't realize that
PopupCalendar is an SWT wrapper so we don't call the constructor on the
SWT UI thread. But the rest of your class will show.
Buenzli wrote:
> Thanks for your reply,
>
> I am using Eclipse 3.2M4, VE1.2M1, EMF2.2M3, GEF3,2M3 on Mac OS X 10.4.5 with java 1.5 (it is actually the same problem on a windows xp machine with java 1.4.2 and the same eclipse configuration).
>
> Concerning the code, I installed the package net.cwroethel.swt.popupcalendar and then used the SimpleExample2 to produce the attached source.
--
Thanks,
Rich Kulp
|
|
| |
Re: Parse Error and partial solution [message #612134 is a reply to message #118177] |
Thu, 16 February 2006 22:43 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
The error is happening in your code:
> Caused by: java.lang.NullPointerException
> at ch.medclipse.application.Medclipse_Consultation_Consultation _PopUp_Demandes.createGrouplaboratoire(Medclipse_Consultatio n_Consultation_PopUp_Demandes.java:314)
> at ch.medclipse.application.Medclipse_Consultation_Consultation _PopUp_Demandes.createComposite(Medclipse_Consultation_Consu ltation_PopUp_Demandes.java:223)
> at ch.medclipse.application.Medclipse_Consultation_Consultation _PopUp_Demandes.createScrolledComposite(Medclipse_Consultati on_Consultation_PopUp_Demandes.java:186)
> at ch.medclipse.application.Medclipse_Consultation_Consultation _PopUp_Demandes.createSShell(Medclipse_Consultation_Consulta tion_PopUp_Demandes.java:172)
> ... 7 more
>
> MMmmfff what does it mean ? Am I doing something wrong ?
You need to see why you would get an NPE at line 314 of the class
Medclipse_Consultation_Consultation_PopUp_Demandes.
--
Thanks,
Rich Kulp
|
|
| |
Re: Parse Error and partial solution [message #612144 is a reply to message #118211] |
Fri, 17 February 2006 15:20 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
What line is actually in error? Is it the popupCal.addSelectionListener()?
If it is, then the problem is popupCal is null. This would happen
because where you put the popupCal = new .... has not yet been called.
The best place to put it is immediately after the new Shell() for which
the popupCal is for. Assuming you are trying to access it after that
shell has been created and not before.
Buenzli wrote:
> The error comes from here:
> // **// finally add the selection listener for pop-up calendar
> popupCal.addSelectionListener(new SelectionAdapter() {
> public void widgetSelected(SelectionEvent e) {
> if (popupCal.getDate() != null) {
> textdatelabo.setText(new SimpleDateFormat("EEE dd/MM/yy").format(
> popupCal.getDate().getTime()));
> }
> }
> });
>
> I attached the full code.
--
Thanks,
Rich Kulp
|
|
| |
Goto Forum:
Current Time: Thu Apr 25 17:00:09 GMT 2024
Powered by FUDForum. Page generated in 0.08705 seconds
|