Skip to main content



      Home
Home » Archived » Visual Editor (VE) » novice
novice [message #121232] Fri, 31 March 2006 12:53 Go to next message
Eclipse UserFriend
Originally posted by: adoneNOSPAMborione.cantv.net

Hi all

I would like to ask if there is some tutorial on VE for me to start do
some coding.

I tried to open the examples "SimpleTextEditor" (file->new->example) but
the example only shows a skeleton class with almost no code.

A comment says "An example which shows off a functional simple text
editor. Includes a variety of events." but I can't see anything useful

So, how do I learn more?

Are there online courses?

Thanks
Adone
Re: novice [message #121249 is a reply to message #121232] Fri, 31 March 2006 13:21 Go to previous messageGo to next message
Eclipse UserFriend
Hmmm, there may be something wrong with your installation if you're not
getting the contents of the Examples. Check the error log by going to
Window->Show View->Other->PDE Runtime->Error log

Below is the code I get when I try the SimpleTextEditor example:


import javax.swing.JFrame;
import java.io.*;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;

/**
* An example which shows off a functional simple text editor.
Includes a variety of events.
*/
public class SimpleTextEditor extends JFrame {

private javax.swing.JPanel jContentPane = null;

private javax.swing.JPanel jPanel = null;

private javax.swing.JButton jButton = null;

private javax.swing.JButton jButton1 = null;

private javax.swing.JButton jButton2 = null;

private javax.swing.JScrollPane jScrollPane = null;

private javax.swing.JTextArea jTextArea = null;

private javax.swing.JFileChooser jFileChooser = null; //
@jve:visual-info decl-index=0 visual-constraint="582,36"

private boolean hasChanged = false;

private static final String title = "Simple Text Editor";

/**
* This method initializes
*
*/
public SimpleTextEditor() {
super();
initialize();
}

public static void main(String[] args) {
SimpleTextEditor ste = new SimpleTextEditor();
ste.show();
}

/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
*/
private javax.swing.JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new javax.swing.JPanel();
jContentPane.setLayout(new java.awt.BorderLayout());
jContentPane.add(getJPanel(), java.awt.BorderLayout.SOUTH);
jContentPane.add(getJScrollPane(), java.awt.BorderLayout.CENTER);
jContentPane.setBorder(javax.swing.BorderFactory.createEmpty Border(
5, 5, 5, 5));
}
return jContentPane;
}

/**
* This method initializes this
*
* @return void
*/
private void initialize() {
this.setContentPane(getJContentPane());
this.setSize(480, 284);
this.setTitle(title);
this

..setDefaultCloseOperation(javax.swing.WindowConstants.DO_NO THING_ON_CLOSE);
this.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
doExit();
}
});

}

/**
* This method initializes jPanel
*
* @return javax.swing.JPanel
*/
private javax.swing.JPanel getJPanel() {
if (jPanel == null) {
jPanel = new javax.swing.JPanel();
jPanel.add(getJButton(), null);
jPanel.add(getJButton1(), null);
jPanel.add(getJButton2(), null);
}
return jPanel;
}

/**
* This method initializes jButton
*
* @return javax.swing.JButton
*/
private javax.swing.JButton getJButton() {
if (jButton == null) {
jButton = new javax.swing.JButton();
jButton.setText("Load File");
jButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
loadFile();
}
});
}
return jButton;
}

/**
* This method initializes jButton1
*
* @return javax.swing.JButton
*/
private javax.swing.JButton getJButton1() {
if (jButton1 == null) {
jButton1 = new javax.swing.JButton();
jButton1.setText("Save File");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
saveFile();
}
});
}
return jButton1;
}

/**
* This method initializes jButton2
*
* @return javax.swing.JButton
*/
private javax.swing.JButton getJButton2() {
if (jButton2 == null) {
jButton2 = new javax.swing.JButton();
jButton2.setText("Exit");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
doExit();
}
});
}
return jButton2;
}

/**
* This method initializes jScrollPane
*
* @return javax.swing.JScrollPane
*/
private javax.swing.JScrollPane getJScrollPane() {
if (jScrollPane == null) {
jScrollPane = new javax.swing.JScrollPane();
jScrollPane.setViewportView(getJTextArea());
}
return jScrollPane;
}

/**
* This method initializes jTextArea
*
* @return javax.swing.JTextArea
*/
private javax.swing.JTextArea getJTextArea() {
if (jTextArea == null) {
jTextArea = new javax.swing.JTextArea();
jTextArea.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent e) {
if (!hasChanged) {
setTitle(title + " *");
hasChanged = true;
}
}
});
}
return jTextArea;
}

/**
* This method initializes jFileChooser
*
* @return javax.swing.JFileChooser
*/
private javax.swing.JFileChooser getJFileChooser() {
if (jFileChooser == null) {
jFileChooser = new javax.swing.JFileChooser();
jFileChooser.setMultiSelectionEnabled(false);
}
return jFileChooser;
}

private void loadFile() {
int state = getJFileChooser().showOpenDialog(this);
if (state == JFileChooser.APPROVE_OPTION) {
File f = getJFileChooser().getSelectedFile();
try {
BufferedReader br = new BufferedReader(new FileReader(f));
getJTextArea().read(br, null);
br.close();
setTitle(title);
hasChanged = false;
} catch (FileNotFoundException e1) {
e1.printStackTrace();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}

private void saveFile() {
int state = getJFileChooser().showSaveDialog(this);
if (state == JFileChooser.APPROVE_OPTION) {
File f = getJFileChooser().getSelectedFile();
try {
BufferedWriter bw = new BufferedWriter(new FileWriter(f));
getJTextArea().write(bw);
bw.close();
setTitle(title);
hasChanged = false;
} catch (FileNotFoundException e1) {
e1.printStackTrace();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}

private void doExit() {
if (hasChanged) {
int state = JOptionPane.showConfirmDialog(this,
"File has been changed. Save before exit?");
if (state == JOptionPane.YES_OPTION) {
saveFile();
} else if (state == JOptionPane.CANCEL_OPTION) {
return;
}
}
System.exit(0);
}
} // @jve:visual-info decl-index=0 visual-constraint="20,27"
Re: novice [message #121256 is a reply to message #121249] Fri, 31 March 2006 13:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: adoneNOSPAMborione.cantv.net

There is the following messages but I do not think are related to the
examples

eclipse.buildId=I20060223-1656
java.version=1.5.0_06
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=es_VE
Command-line arguments: -os win32 -ws win32 -arch x86

Error
2006-03-29 13:08:52.593
Unable to access site:
"http://http://update.eclipse.org/tools/ve/updates/1.0/" [http]

java.net.UnknownHostException: http
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedExcept ion(Unknown
Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(U nknown
Source)
at
org.eclipse.update.internal.core.connection.ConnectionThread Manager$StreamRunnable.run(ConnectionThreadManager.java:97)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.UnknownHostException: http
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient (Unknown
Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unk nown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(U nknown
Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at
org.eclipse.update.internal.core.connection.HttpResponse.get StatusCode(HttpResponse.java:183)
at
org.eclipse.update.internal.core.UpdateManagerUtils.checkCon nectionResult(UpdateManagerUtils.java:553)
at
org.eclipse.update.internal.core.SiteURLFactory.createSite(S iteURLFactory.java:74)
at
org.eclipse.update.internal.core.InternalSiteManager.createS ite(InternalSiteManager.java:332)
at
org.eclipse.update.internal.core.InternalSiteManager.createS ite(InternalSiteManager.java:324)
at
org.eclipse.update.internal.core.InternalSiteManager.createS ite(InternalSiteManager.java:296)
at
org.eclipse.update.internal.core.InternalSiteManager.attempt CreateSite(InternalSiteManager.java:220)
at
org.eclipse.update.internal.core.InternalSiteManager.getSite (InternalSiteManager.java:161)
at org.eclipse.update.core.SiteManager.getSite(SiteManager.java :78)
at
org.eclipse.update.search.UpdateSearchRequest.searchOneSite( UpdateSearchRequest.java:345)
at
org.eclipse.update.search.UpdateSearchRequest.performSearch( UpdateSearchRequest.java:273)
at org.eclipse.update.ui.UpdateJob.runSearchForNew(UpdateJob.ja va:180)
at org.eclipse.update.ui.UpdateJob.run(UpdateJob.java:168)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)





Jeff Myers wrote:

> Hmmm, there may be something wrong with your installation if you're not
> getting the contents of the Examples. Check the error log by going to
> Window->Show View->Other->PDE Runtime->Error log

> Below is the code I get when I try the SimpleTextEditor example:


> import javax.swing.JFrame;
> import java.io.*;
> import javax.swing.JFileChooser;
> import javax.swing.JOptionPane;

> /**
> * An example which shows off a functional simple text editor.
> Includes a variety of events.
> */
> public class SimpleTextEditor extends JFrame {

> private javax.swing.JPanel jContentPane = null;

> private javax.swing.JPanel jPanel = null;

> private javax.swing.JButton jButton = null;

> private javax.swing.JButton jButton1 = null;

> private javax.swing.JButton jButton2 = null;

> private javax.swing.JScrollPane jScrollPane = null;

> private javax.swing.JTextArea jTextArea = null;

> private javax.swing.JFileChooser jFileChooser = null; //
> @jve:visual-info decl-index=0 visual-constraint="582,36"

> private boolean hasChanged = false;

> private static final String title = "Simple Text Editor";

> /**
> * This method initializes
> *
> */
> public SimpleTextEditor() {
> super();
> initialize();
> }

> public static void main(String[] args) {
> SimpleTextEditor ste = new SimpleTextEditor();
> ste.show();
> }

> /**
> * This method initializes jContentPane
> *
> * @return javax.swing.JPanel
> */
> private javax.swing.JPanel getJContentPane() {
> if (jContentPane == null) {
> jContentPane = new javax.swing.JPanel();
> jContentPane.setLayout(new java.awt.BorderLayout());
> jContentPane.add(getJPanel(), java.awt.BorderLayout.SOUTH);
> jContentPane.add(getJScrollPane(), java.awt.BorderLayout.CENTER);
> jContentPane.setBorder(javax.swing.BorderFactory.createEmpty Border(
> 5, 5, 5, 5));
> }
> return jContentPane;
> }

> /**
> * This method initializes this
> *
> * @return void
> */
> private void initialize() {
> this.setContentPane(getJContentPane());
> this.setSize(480, 284);
> this.setTitle(title);
> this

> ..setDefaultCloseOperation(javax.swing.WindowConstants.DO_NO THING_ON_CLOSE);
> this.addWindowListener(new java.awt.event.WindowAdapter() {
> public void windowClosing(java.awt.event.WindowEvent e) {
> doExit();
> }
> });

> }

> /**
> * This method initializes jPanel
> *
> * @return javax.swing.JPanel
> */
> private javax.swing.JPanel getJPanel() {
> if (jPanel == null) {
> jPanel = new javax.swing.JPanel();
> jPanel.add(getJButton(), null);
> jPanel.add(getJButton1(), null);
> jPanel.add(getJButton2(), null);
> }
> return jPanel;
> }

> /**
> * This method initializes jButton
> *
> * @return javax.swing.JButton
> */
> private javax.swing.JButton getJButton() {
> if (jButton == null) {
> jButton = new javax.swing.JButton();
> jButton.setText("Load File");
> jButton.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent e) {
> loadFile();
> }
> });
> }
> return jButton;
> }

> /**
> * This method initializes jButton1
> *
> * @return javax.swing.JButton
> */
> private javax.swing.JButton getJButton1() {
> if (jButton1 == null) {
> jButton1 = new javax.swing.JButton();
> jButton1.setText("Save File");
> jButton1.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent e) {
> saveFile();
> }
> });
> }
> return jButton1;
> }

> /**
> * This method initializes jButton2
> *
> * @return javax.swing.JButton
> */
> private javax.swing.JButton getJButton2() {
> if (jButton2 == null) {
> jButton2 = new javax.swing.JButton();
> jButton2.setText("Exit");
> jButton2.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent e) {
> doExit();
> }
> });
> }
> return jButton2;
> }

> /**
> * This method initializes jScrollPane
> *
> * @return javax.swing.JScrollPane
> */
> private javax.swing.JScrollPane getJScrollPane() {
> if (jScrollPane == null) {
> jScrollPane = new javax.swing.JScrollPane();
> jScrollPane.setViewportView(getJTextArea());
> }
> return jScrollPane;
> }

> /**
> * This method initializes jTextArea
> *
> * @return javax.swing.JTextArea
> */
> private javax.swing.JTextArea getJTextArea() {
> if (jTextArea == null) {
> jTextArea = new javax.swing.JTextArea();
> jTextArea.addKeyListener(new java.awt.event.KeyAdapter() {
> public void keyTyped(java.awt.event.KeyEvent e) {
> if (!hasChanged) {
> setTitle(title + " *");
> hasChanged = true;
> }
> }
> });
> }
> return jTextArea;
> }

> /**
> * This method initializes jFileChooser
> *
> * @return javax.swing.JFileChooser
> */
> private javax.swing.JFileChooser getJFileChooser() {
> if (jFileChooser == null) {
> jFileChooser = new javax.swing.JFileChooser();
> jFileChooser.setMultiSelectionEnabled(false);
> }
> return jFileChooser;
> }

> private void loadFile() {
> int state = getJFileChooser().showOpenDialog(this);
> if (state == JFileChooser.APPROVE_OPTION) {
> File f = getJFileChooser().getSelectedFile();
> try {
> BufferedReader br = new BufferedReader(new FileReader(f));
> getJTextArea().read(br, null);
> br.close();
> setTitle(title);
> hasChanged = false;
> } catch (FileNotFoundException e1) {
> e1.printStackTrace();
> } catch (IOException e1) {
> e1.printStackTrace();
> }
> }
> }

> private void saveFile() {
> int state = getJFileChooser().showSaveDialog(this);
> if (state == JFileChooser.APPROVE_OPTION) {
> File f = getJFileChooser().getSelectedFile();
> try {
> BufferedWriter bw = new BufferedWriter(new FileWriter(f));
> getJTextArea().write(bw);
> bw.close();
> setTitle(title);
> hasChanged = false;
> } catch (FileNotFoundException e1) {
> e1.printStackTrace();
> } catch (IOException e1) {
> e1.printStackTrace();
> }
> }
> }

> private void doExit() {
> if (hasChanged) {
> int state = JOptionPane.showConfirmDialog(this,
> "File has been changed. Save before exit?");
> if (state == JOptionPane.YES_OPTION) {
> saveFile();
> } else if (state == JOptionPane.CANCEL_OPTION) {
> return;
> }
> }
> System.exit(0);
> }
> } // @jve:visual-info decl-index=0 visual-constraint="20,27"
Re: novice [message #121281 is a reply to message #121256] Sat, 01 April 2006 11:25 Go to previous messageGo to next message
Eclipse UserFriend
You need to take out that extra http:// in the update site url of the VE project//
Re: novice [message #121289 is a reply to message #121281] Sat, 01 April 2006 12:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: adoneNOSPAMborione.cantv.net

Thanks Fred but I have done it and the update manager does not report any
update available.

How do I reinstall the examples?


Fred Grott wrote:

> You need to take out that extra http:// in the update site url of the VE
project//
Re: novice [message #121337 is a reply to message #121289] Sat, 01 April 2006 20:33 Go to previous message
Eclipse UserFriend
Originally posted by: adoneNOSPAMborione.cantv.net

I got it!

At last I understood the philosophy of eclipse and its plugins!

I was able to create different installs of different versions. I
understood also what release and stream mean.

I understood that I cannot use update manager unless I am using a release
version.

EUREKA!!

I MADE IT!!!
Re: novice [message #612412 is a reply to message #121232] Fri, 31 March 2006 13:21 Go to previous message
Eclipse UserFriend
Hmmm, there may be something wrong with your installation if you're not
getting the contents of the Examples. Check the error log by going to
Window->Show View->Other->PDE Runtime->Error log

Below is the code I get when I try the SimpleTextEditor example:


import javax.swing.JFrame;
import java.io.*;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;

/**
* An example which shows off a functional simple text editor.
Includes a variety of events.
*/
public class SimpleTextEditor extends JFrame {

private javax.swing.JPanel jContentPane = null;

private javax.swing.JPanel jPanel = null;

private javax.swing.JButton jButton = null;

private javax.swing.JButton jButton1 = null;

private javax.swing.JButton jButton2 = null;

private javax.swing.JScrollPane jScrollPane = null;

private javax.swing.JTextArea jTextArea = null;

private javax.swing.JFileChooser jFileChooser = null; //
@jve:visual-info decl-index=0 visual-constraint="582,36"

private boolean hasChanged = false;

private static final String title = "Simple Text Editor";

/**
* This method initializes
*
*/
public SimpleTextEditor() {
super();
initialize();
}

public static void main(String[] args) {
SimpleTextEditor ste = new SimpleTextEditor();
ste.show();
}

/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
*/
private javax.swing.JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new javax.swing.JPanel();
jContentPane.setLayout(new java.awt.BorderLayout());
jContentPane.add(getJPanel(), java.awt.BorderLayout.SOUTH);
jContentPane.add(getJScrollPane(), java.awt.BorderLayout.CENTER);
jContentPane.setBorder(javax.swing.BorderFactory.createEmpty Border(
5, 5, 5, 5));
}
return jContentPane;
}

/**
* This method initializes this
*
* @return void
*/
private void initialize() {
this.setContentPane(getJContentPane());
this.setSize(480, 284);
this.setTitle(title);
this

..setDefaultCloseOperation(javax.swing.WindowConstants.DO_NO THING_ON_CLOSE);
this.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
doExit();
}
});

}

/**
* This method initializes jPanel
*
* @return javax.swing.JPanel
*/
private javax.swing.JPanel getJPanel() {
if (jPanel == null) {
jPanel = new javax.swing.JPanel();
jPanel.add(getJButton(), null);
jPanel.add(getJButton1(), null);
jPanel.add(getJButton2(), null);
}
return jPanel;
}

/**
* This method initializes jButton
*
* @return javax.swing.JButton
*/
private javax.swing.JButton getJButton() {
if (jButton == null) {
jButton = new javax.swing.JButton();
jButton.setText("Load File");
jButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
loadFile();
}
});
}
return jButton;
}

/**
* This method initializes jButton1
*
* @return javax.swing.JButton
*/
private javax.swing.JButton getJButton1() {
if (jButton1 == null) {
jButton1 = new javax.swing.JButton();
jButton1.setText("Save File");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
saveFile();
}
});
}
return jButton1;
}

/**
* This method initializes jButton2
*
* @return javax.swing.JButton
*/
private javax.swing.JButton getJButton2() {
if (jButton2 == null) {
jButton2 = new javax.swing.JButton();
jButton2.setText("Exit");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
doExit();
}
});
}
return jButton2;
}

/**
* This method initializes jScrollPane
*
* @return javax.swing.JScrollPane
*/
private javax.swing.JScrollPane getJScrollPane() {
if (jScrollPane == null) {
jScrollPane = new javax.swing.JScrollPane();
jScrollPane.setViewportView(getJTextArea());
}
return jScrollPane;
}

/**
* This method initializes jTextArea
*
* @return javax.swing.JTextArea
*/
private javax.swing.JTextArea getJTextArea() {
if (jTextArea == null) {
jTextArea = new javax.swing.JTextArea();
jTextArea.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent e) {
if (!hasChanged) {
setTitle(title + " *");
hasChanged = true;
}
}
});
}
return jTextArea;
}

/**
* This method initializes jFileChooser
*
* @return javax.swing.JFileChooser
*/
private javax.swing.JFileChooser getJFileChooser() {
if (jFileChooser == null) {
jFileChooser = new javax.swing.JFileChooser();
jFileChooser.setMultiSelectionEnabled(false);
}
return jFileChooser;
}

private void loadFile() {
int state = getJFileChooser().showOpenDialog(this);
if (state == JFileChooser.APPROVE_OPTION) {
File f = getJFileChooser().getSelectedFile();
try {
BufferedReader br = new BufferedReader(new FileReader(f));
getJTextArea().read(br, null);
br.close();
setTitle(title);
hasChanged = false;
} catch (FileNotFoundException e1) {
e1.printStackTrace();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}

private void saveFile() {
int state = getJFileChooser().showSaveDialog(this);
if (state == JFileChooser.APPROVE_OPTION) {
File f = getJFileChooser().getSelectedFile();
try {
BufferedWriter bw = new BufferedWriter(new FileWriter(f));
getJTextArea().write(bw);
bw.close();
setTitle(title);
hasChanged = false;
} catch (FileNotFoundException e1) {
e1.printStackTrace();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}

private void doExit() {
if (hasChanged) {
int state = JOptionPane.showConfirmDialog(this,
"File has been changed. Save before exit?");
if (state == JOptionPane.YES_OPTION) {
saveFile();
} else if (state == JOptionPane.CANCEL_OPTION) {
return;
}
}
System.exit(0);
}
} // @jve:visual-info decl-index=0 visual-constraint="20,27"
Re: novice [message #612415 is a reply to message #121249] Fri, 31 March 2006 13:31 Go to previous message
Eclipse UserFriend
Originally posted by: adoneNOSPAMborione.cantv.net

There is the following messages but I do not think are related to the
examples

eclipse.buildId=I20060223-1656
java.version=1.5.0_06
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=es_VE
Command-line arguments: -os win32 -ws win32 -arch x86

Error
2006-03-29 13:08:52.593
Unable to access site:
"http://http://update.eclipse.org/tools/ve/updates/1.0/" [http]

java.net.UnknownHostException: http
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedExcept ion(Unknown
Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(U nknown
Source)
at
org.eclipse.update.internal.core.connection.ConnectionThread Manager$StreamRunnable.run(ConnectionThreadManager.java:97)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.UnknownHostException: http
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient (Unknown
Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unk nown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(U nknown
Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at
org.eclipse.update.internal.core.connection.HttpResponse.get StatusCode(HttpResponse.java:183)
at
org.eclipse.update.internal.core.UpdateManagerUtils.checkCon nectionResult(UpdateManagerUtils.java:553)
at
org.eclipse.update.internal.core.SiteURLFactory.createSite(S iteURLFactory.java:74)
at
org.eclipse.update.internal.core.InternalSiteManager.createS ite(InternalSiteManager.java:332)
at
org.eclipse.update.internal.core.InternalSiteManager.createS ite(InternalSiteManager.java:324)
at
org.eclipse.update.internal.core.InternalSiteManager.createS ite(InternalSiteManager.java:296)
at
org.eclipse.update.internal.core.InternalSiteManager.attempt CreateSite(InternalSiteManager.java:220)
at
org.eclipse.update.internal.core.InternalSiteManager.getSite (InternalSiteManager.java:161)
at org.eclipse.update.core.SiteManager.getSite(SiteManager.java :78)
at
org.eclipse.update.search.UpdateSearchRequest.searchOneSite( UpdateSearchRequest.java:345)
at
org.eclipse.update.search.UpdateSearchRequest.performSearch( UpdateSearchRequest.java:273)
at org.eclipse.update.ui.UpdateJob.runSearchForNew(UpdateJob.ja va:180)
at org.eclipse.update.ui.UpdateJob.run(UpdateJob.java:168)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)





Jeff Myers wrote:

> Hmmm, there may be something wrong with your installation if you're not
> getting the contents of the Examples. Check the error log by going to
> Window->Show View->Other->PDE Runtime->Error log

> Below is the code I get when I try the SimpleTextEditor example:


> import javax.swing.JFrame;
> import java.io.*;
> import javax.swing.JFileChooser;
> import javax.swing.JOptionPane;

> /**
> * An example which shows off a functional simple text editor.
> Includes a variety of events.
> */
> public class SimpleTextEditor extends JFrame {

> private javax.swing.JPanel jContentPane = null;

> private javax.swing.JPanel jPanel = null;

> private javax.swing.JButton jButton = null;

> private javax.swing.JButton jButton1 = null;

> private javax.swing.JButton jButton2 = null;

> private javax.swing.JScrollPane jScrollPane = null;

> private javax.swing.JTextArea jTextArea = null;

> private javax.swing.JFileChooser jFileChooser = null; //
> @jve:visual-info decl-index=0 visual-constraint="582,36"

> private boolean hasChanged = false;

> private static final String title = "Simple Text Editor";

> /**
> * This method initializes
> *
> */
> public SimpleTextEditor() {
> super();
> initialize();
> }

> public static void main(String[] args) {
> SimpleTextEditor ste = new SimpleTextEditor();
> ste.show();
> }

> /**
> * This method initializes jContentPane
> *
> * @return javax.swing.JPanel
> */
> private javax.swing.JPanel getJContentPane() {
> if (jContentPane == null) {
> jContentPane = new javax.swing.JPanel();
> jContentPane.setLayout(new java.awt.BorderLayout());
> jContentPane.add(getJPanel(), java.awt.BorderLayout.SOUTH);
> jContentPane.add(getJScrollPane(), java.awt.BorderLayout.CENTER);
> jContentPane.setBorder(javax.swing.BorderFactory.createEmpty Border(
> 5, 5, 5, 5));
> }
> return jContentPane;
> }

> /**
> * This method initializes this
> *
> * @return void
> */
> private void initialize() {
> this.setContentPane(getJContentPane());
> this.setSize(480, 284);
> this.setTitle(title);
> this

> ..setDefaultCloseOperation(javax.swing.WindowConstants.DO_NO THING_ON_CLOSE);
> this.addWindowListener(new java.awt.event.WindowAdapter() {
> public void windowClosing(java.awt.event.WindowEvent e) {
> doExit();
> }
> });

> }

> /**
> * This method initializes jPanel
> *
> * @return javax.swing.JPanel
> */
> private javax.swing.JPanel getJPanel() {
> if (jPanel == null) {
> jPanel = new javax.swing.JPanel();
> jPanel.add(getJButton(), null);
> jPanel.add(getJButton1(), null);
> jPanel.add(getJButton2(), null);
> }
> return jPanel;
> }

> /**
> * This method initializes jButton
> *
> * @return javax.swing.JButton
> */
> private javax.swing.JButton getJButton() {
> if (jButton == null) {
> jButton = new javax.swing.JButton();
> jButton.setText("Load File");
> jButton.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent e) {
> loadFile();
> }
> });
> }
> return jButton;
> }

> /**
> * This method initializes jButton1
> *
> * @return javax.swing.JButton
> */
> private javax.swing.JButton getJButton1() {
> if (jButton1 == null) {
> jButton1 = new javax.swing.JButton();
> jButton1.setText("Save File");
> jButton1.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent e) {
> saveFile();
> }
> });
> }
> return jButton1;
> }

> /**
> * This method initializes jButton2
> *
> * @return javax.swing.JButton
> */
> private javax.swing.JButton getJButton2() {
> if (jButton2 == null) {
> jButton2 = new javax.swing.JButton();
> jButton2.setText("Exit");
> jButton2.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent e) {
> doExit();
> }
> });
> }
> return jButton2;
> }

> /**
> * This method initializes jScrollPane
> *
> * @return javax.swing.JScrollPane
> */
> private javax.swing.JScrollPane getJScrollPane() {
> if (jScrollPane == null) {
> jScrollPane = new javax.swing.JScrollPane();
> jScrollPane.setViewportView(getJTextArea());
> }
> return jScrollPane;
> }

> /**
> * This method initializes jTextArea
> *
> * @return javax.swing.JTextArea
> */
> private javax.swing.JTextArea getJTextArea() {
> if (jTextArea == null) {
> jTextArea = new javax.swing.JTextArea();
> jTextArea.addKeyListener(new java.awt.event.KeyAdapter() {
> public void keyTyped(java.awt.event.KeyEvent e) {
> if (!hasChanged) {
> setTitle(title + " *");
> hasChanged = true;
> }
> }
> });
> }
> return jTextArea;
> }

> /**
> * This method initializes jFileChooser
> *
> * @return javax.swing.JFileChooser
> */
> private javax.swing.JFileChooser getJFileChooser() {
> if (jFileChooser == null) {
> jFileChooser = new javax.swing.JFileChooser();
> jFileChooser.setMultiSelectionEnabled(false);
> }
> return jFileChooser;
> }

> private void loadFile() {
> int state = getJFileChooser().showOpenDialog(this);
> if (state == JFileChooser.APPROVE_OPTION) {
> File f = getJFileChooser().getSelectedFile();
> try {
> BufferedReader br = new BufferedReader(new FileReader(f));
> getJTextArea().read(br, null);
> br.close();
> setTitle(title);
> hasChanged = false;
> } catch (FileNotFoundException e1) {
> e1.printStackTrace();
> } catch (IOException e1) {
> e1.printStackTrace();
> }
> }
> }

> private void saveFile() {
> int state = getJFileChooser().showSaveDialog(this);
> if (state == JFileChooser.APPROVE_OPTION) {
> File f = getJFileChooser().getSelectedFile();
> try {
> BufferedWriter bw = new BufferedWriter(new FileWriter(f));
> getJTextArea().write(bw);
> bw.close();
> setTitle(title);
> hasChanged = false;
> } catch (FileNotFoundException e1) {
> e1.printStackTrace();
> } catch (IOException e1) {
> e1.printStackTrace();
> }
> }
> }

> private void doExit() {
> if (hasChanged) {
> int state = JOptionPane.showConfirmDialog(this,
> "File has been changed. Save before exit?");
> if (state == JOptionPane.YES_OPTION) {
> saveFile();
> } else if (state == JOptionPane.CANCEL_OPTION) {
> return;
> }
> }
> System.exit(0);
> }
> } // @jve:visual-info decl-index=0 visual-constraint="20,27"
Re: novice [message #612427 is a reply to message #121256] Sat, 01 April 2006 11:25 Go to previous message
Eclipse UserFriend
You need to take out that extra http:// in the update site url of the VE project//
Re: novice [message #612431 is a reply to message #121281] Sat, 01 April 2006 12:44 Go to previous message
Eclipse UserFriend
Originally posted by: adoneNOSPAMborione.cantv.net

Thanks Fred but I have done it and the update manager does not report any
update available.

How do I reinstall the examples?


Fred Grott wrote:

> You need to take out that extra http:// in the update site url of the VE
project//
Re: novice [message #612448 is a reply to message #121289] Sat, 01 April 2006 20:33 Go to previous message
Eclipse UserFriend
Originally posted by: adoneNOSPAMborione.cantv.net

I got it!

At last I understood the philosophy of eclipse and its plugins!

I was able to create different installs of different versions. I
understood also what release and stream mean.

I understood that I cannot use update manager unless I am using a release
version.

EUREKA!!

I MADE IT!!!
Previous Topic:Problems with VE Examples
Next Topic:EUREKA!!!!
Goto Forum:
  


Current Time: Mon Jun 16 08:17:09 EDT 2025

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

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

Back to the top