Posted By:
Charles_Daniel
Posted On:
Wednesday, May 7, 2008 01:36 PM
I've tried to fashion a Calendar combo by using the CalendarCombo widget from Nebula (http://www.eclipse.org/nebula/widgets/calendarcombo/calendarcombo.php). My label provider follows: public class MyCalendarLabelProvider extends ColumnLabelProvider { private static final String CALENDAR_KEY = "CALENDAR_KEY"; public MyCalendarLabelProvider(ColumnViewer viewer) { JFaceResources.getImageRegistry().put(CALENDAR_KEY, makeShot(viewer.getControl().getShell(), Calendar.getInstance())); } private Image makeShot(Shell shell, Calendar now) { Shell s = new Shell(shell, SWT.NO_TRIM); CalendarCombo cCombo = new Calendar
More>>
I've tried to fashion a Calendar combo by using the CalendarCombo widget from Nebula (http://www.eclipse.org/nebula/widgets/calendarcombo/calendarcombo.php). My label provider follows:
public class MyCalendarLabelProvider extends ColumnLabelProvider {
private static final String CALENDAR_KEY = "CALENDAR_KEY";
public MyCalendarLabelProvider(ColumnViewer viewer) {
JFaceResources.getImageRegistry().put(CALENDAR_KEY, makeShot(viewer.getControl().getShell(), Calendar.getInstance()));
}
private Image makeShot(Shell shell, Calendar now)
{
Shell s = new Shell(shell, SWT.NO_TRIM);
CalendarCombo cCombo = new CalendarCombo(s, SWT.READ_ONLY);
cCombo.setDate(now);
Point cComboSize = cCombo.computeSize(SWT.DEFAULT, SWT.DEFAULT);
cCombo.setSize(cComboSize);
cCombo.setLocation(0, 0);
s.setSize(cComboSize);
s.open();
GC gc = new GC(cCombo);
Image image = new Image(shell.getDisplay(), cComboSize.x, cComboSize.y);
gc.copyArea(image, 0, 0);
gc.dispose();
s.close();
return image;
}
In order to compile, I must point to the .jar file named org.eclipse.nebula.widgets.calendarcombo_1.0.0.jar that came w/ the calendar. To do this from the Workbench, I choose Properties->Build Path->Add External Jars. Then I can compile. However, I get runtime errors as follows:
Error creating the view.
org/eclipse/nebula/widgets/calendarcombo/CalendarCombo
java.lang.NoClassDefFoundError: org/eclipse/nebula/widgets/calendarcombo/CalendarCombo
at tabletesting.provider.MyCalendarLabelProvider.makeShot(MyCalendarLabelProvider.java:32)
at tabletesting.provider.MyCalendarLabelProvider.
(MyCalendarLabelProvider.java:26)
at tabletesting.provider.MyColumnLabelProvider.createColumns(MyColumnLabelProvider.java:69)
at calcombo.View.createPartControl(View.java:67) ...
Am I including the JARs incorrectly? How can I remedy this?
<<Less