Formattted Text Widget [message #37777] |
Thu, 26 July 2007 23:01 |
Eclipse User |
|
|
|
Originally posted by: tim.mehrens.fiserv.com
I am still trying to use the Formatted Text Widget. To get this to work I
was told to get the jar out of my project classpath and put it in the
plugin classpath. My problem is that when I do this I get import errors
in the editor class that uses the jar.
To add the jar to my plugin classpath I created a new folder called /lib
to my project and copied the jar to it using windows explorer. I then
double clicked the plugin.xml file to open up the project Manifest >
Selected the Runtime tab > Added the /lib folder to the Classpath.
How do I associate this jar with the plugin and resolve the problem of the
editor that uses the jar not being able to find the jar to be able to
import it?
TIA
|
|
|
|
Re: Formattted Text Widget [message #37850 is a reply to message #37817] |
Tue, 31 July 2007 19:42 |
Eclipse User |
|
|
|
Originally posted by: tim.mehrens.fiserv.com
Eric,
How do you set it up so I can select just the formattedtext.jar? When I
click on the Add button next to the Classpath window in the plugin.xml
runtime tab all I see are the diretories that are in my project.
Tim
|
|
|
|
|
Re: Formattted Text Widget [message #37948 is a reply to message #37883] |
Thu, 02 August 2007 15:39 |
Eclipse User |
|
|
|
Originally posted by: tim.mehrens.fiserv.com
Eric,
I added the following line to my Manifest.MF
Bundle-ClassPath: .,lib/org.eclipse.nebula.widgets.formatttedtext_1.0.0.jar
The jar is in the lib directory of the project
I then removed the jar from my Project Build Path and the following code
gets an error message that "The import org.eclipse.nebula cannot be
resolved."
I would really love to use this widget. What am I doing wrong?
package util;
import org.eclipse.nebula.widgets.formattedtext.DateFormatter;
import org.eclipse.nebula.widgets.formattedtext.FormattedText;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
/**
* Snippet 2 for DateFormatter : fixed mask yyyy/MM/dd, no default value.
*/
public class DateFormatterSnippet2 {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout());
FormattedText text = new FormattedText(shell, SWT.BORDER);
text.setFormatter(new DateFormatter("yyyy/MM/dd"));
GridData data = new GridData();
data.widthHint = 60;
text.getControl().setLayoutData(data);
shell.open();
while ( ! shell.isDisposed() ) {
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
}
}
|
|
|
|
Re: Formattted Text Widget [message #38016 is a reply to message #37948] |
Thu, 02 August 2007 21:55 |
Eclipse User |
|
|
|
Originally posted by: zx.us.ibm.com
Please add it using Require-Bundle, please get out of the mindset of
managing your own classpath and have Eclipse/PDE do it for you :)
Managing classpaths is so 90's :P
Cheers,
~ Chris
|
|
|
|
Re: Formattted Text Widget [message #583713 is a reply to message #37817] |
Tue, 31 July 2007 19:42 |
Eclipse User |
|
|
|
Originally posted by: tim.mehrens.fiserv.com
Eric,
How do you set it up so I can select just the formattedtext.jar? When I
click on the Add button next to the Classpath window in the plugin.xml
runtime tab all I see are the diretories that are in my project.
Tim
|
|
|
|
|
Re: Formattted Text Widget [message #583756 is a reply to message #37883] |
Thu, 02 August 2007 15:39 |
Eclipse User |
|
|
|
Originally posted by: tim.mehrens.fiserv.com
Eric,
I added the following line to my Manifest.MF
Bundle-ClassPath: .,lib/org.eclipse.nebula.widgets.formatttedtext_1.0.0.jar
The jar is in the lib directory of the project
I then removed the jar from my Project Build Path and the following code
gets an error message that "The import org.eclipse.nebula cannot be
resolved."
I would really love to use this widget. What am I doing wrong?
package util;
import org.eclipse.nebula.widgets.formattedtext.DateFormatter;
import org.eclipse.nebula.widgets.formattedtext.FormattedText;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
/**
* Snippet 2 for DateFormatter : fixed mask yyyy/MM/dd, no default value.
*/
public class DateFormatterSnippet2 {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout());
FormattedText text = new FormattedText(shell, SWT.BORDER);
text.setFormatter(new DateFormatter("yyyy/MM/dd"));
GridData data = new GridData();
data.widthHint = 60;
text.getControl().setLayoutData(data);
shell.open();
while ( ! shell.isDisposed() ) {
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
}
}
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03613 seconds