Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » problem in selecting a particular date
icon9.gif  problem in selecting a particular date [message #659148] Fri, 11 March 2011 09:55 Go to next message
marie Missing name is currently offline marie Missing nameFriend
Messages: 63
Registered: March 2011
Member
hi all,
protected Control createContents(Composite parent)
{

//Composite container = new Composite(parent, SWT.NONE);
final CalenderUtil cal1 = new CalenderUtil(parent,SWT.NONE ,m_selDate );
final Label selectedDate = new Label(parent, SWT.NONE);
final DateFormat fmt = SimpleDateFormat.getDateInstance(DateFormat.LONG);
// Button cal=new Button(m_shell, SWT.PUSH);
cal1.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e) {
String data=cal1.getdate();
selectedDate.setText(data);
System.out.println(data);
selectedDate.getParent().layout();
}
});
return selectedDate;

}
here i am calling claender util class i which is

public CalenderUtil(Composite parent, int style,Text selDate) {

m_comp = parent;
m_selDate = selDate;
final Button cals=new Button(m_comp, SWT.PUSH);

cals.setText("calendar");
cals.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e) {

DateTime calendar = new DateTime (m_comp, SWT.CALENDAR | SWT.BORDER);
Button ok = new Button (m_comp, SWT.PUSH);
ok.setText ("OK");
ok.setLayoutData(new GridData (SWT.FILL, SWT.CENTER, false, false));
ok.addSelectionListener (new SelectionAdapter () {
public void widgetSelected (SelectionEvent e) {

m_comp.getShell().close ();

}
});
m_comp.getShell().setDefaultButton (ok);
m_comp.getShell().pack ();
m_comp.getShell().open ();

}

});

my problems
1) i tried with d mouselistener but is there any diff b/w rap control class
2) whn i click on calendar button it creates the calendar but it again created calendar button on calender dialog

can anybody help me to resolve it please

thanks in advance
Re: problem in selecting a particular date [message #659570 is a reply to message #659148] Mon, 14 March 2011 15:38 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Mariya,
to be honest I don't understand what is your problem. Could you explain
it a little bit more?
Thanks,
Ivan

On 3/11/2011 11:55 AM, mariya wrote:
> hi all,
> protected Control createContents(Composite parent)
> {
>
> //Composite container = new Composite(parent, SWT.NONE);
> final CalenderUtil cal1 = new CalenderUtil(parent,SWT.NONE
> ,m_selDate );
> final Label selectedDate = new Label(parent, SWT.NONE);
> final DateFormat fmt =
> SimpleDateFormat.getDateInstance(DateFormat.LONG);
> // Button cal=new Button(m_shell, SWT.PUSH);
> cal1.addSelectionListener(new SelectionAdapter(){
> public void widgetSelected(SelectionEvent e) {
> String data=cal1.getdate();
> selectedDate.setText(data);
> System.out.println(data);
> selectedDate.getParent().layout();
> }
> });
> return selectedDate;
>
> }
> here i am calling claender util class i which is
>
> public CalenderUtil(Composite parent, int style,Text selDate) {
>
> m_comp = parent;
> m_selDate = selDate;
> final Button cals=new Button(m_comp, SWT.PUSH);
>
> cals.setText("calendar");
> cals.addSelectionListener(new SelectionAdapter(){
> public void widgetSelected(SelectionEvent e) {
>
> DateTime calendar = new DateTime (m_comp, SWT.CALENDAR
> | SWT.BORDER);
> Button ok = new Button (m_comp, SWT.PUSH);
> ok.setText ("OK");
> ok.setLayoutData(new GridData (SWT.FILL, SWT.CENTER,
> false, false));
> ok.addSelectionListener (new SelectionAdapter () {
> public void widgetSelected (SelectionEvent e) {
>
> m_comp.getShell().close ();
>
> }
> });
> m_comp.getShell().setDefaultButton (ok);
> m_comp.getShell().pack ();
> m_comp.getShell().open ();
>
> }
>
> });
>
> my problems
> 1) i tried with d mouselistener but is there any diff b/w rap control
> class
> 2) whn i click on calendar button it creates the calendar but it again
> created calendar button on calender dialog
>
> can anybody help me to resolve it please
>
> thanks in advance
Re: problem in selecting a particular date [message #659659 is a reply to message #659570] Tue, 15 March 2011 04:35 Go to previous messageGo to next message
marie Missing name is currently offline marie Missing nameFriend
Messages: 63
Registered: March 2011
Member
ok
here is the problem
I am able to get the calendar but i want to select particular date from calendar and want to print this date in a text box.
It is like some web application in which when u open a calendar and as u click on a particular date and this date will come in text box.
see my code

cals.setText("calendar");
cals.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e) {

DateTime calendar = new DateTime (m_comp, SWT.CALENDAR | SWT.BORDER);
final Button ok = new Button (m_comp, SWT.PUSH);
ok.setText ("OK");
ok.setLayoutData(new GridData (SWT.FILL, SWT.CENTER, false, false));
ok.addSelectionListener (new SelectionAdapter () {
public void widgetSelected (SelectionEvent e) {


m_comp.getShell().close ();

}
});

m_comp.getShell().setDefaultButton (ok);
m_comp.getShell().pack ();
m_comp.getShell().open ();

}

});


thanks in advance
P.S. its an rap application
Re: problem in selecting a particular date [message #659680 is a reply to message #659659] Tue, 15 March 2011 08:27 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Mariya,
add a selection listener to the DateTime (calendar) control and you
will be notified when the date is changed.
HTH,
Ivan

On 3/15/2011 6:36 AM, mariya wrote:
> ok
> here is the problem I am able to get the calendar but i want to select
> particular date from calendar and want to print this date in a text box.
> It is like some web application in which when u open a calendar and as
> u click on a particular date and this date will come in text box.
> see my code
>
> cals.setText("calendar");
> cals.addSelectionListener(new SelectionAdapter(){
> public void widgetSelected(SelectionEvent e) {
>
> DateTime calendar = new DateTime (m_comp, SWT.CALENDAR
> | SWT.BORDER);
> final Button ok = new Button (m_comp, SWT.PUSH);
> ok.setText ("OK");
> ok.setLayoutData(new GridData (SWT.FILL, SWT.CENTER,
> false, false));
> ok.addSelectionListener (new SelectionAdapter () {
> public void widgetSelected (SelectionEvent e) {
>
>
> m_comp.getShell().close ();
>
> }
> });
>
> m_comp.getShell().setDefaultButton (ok);
> m_comp.getShell().pack ();
> m_comp.getShell().open ();
>
> }
>
> });
>
>
> thanks in advance
> P.S. its an rap application
Previous Topic:download widget
Next Topic:[ANN] IMPORTANT: Platform filters in RAP
Goto Forum:
  


Current Time: Sun Oct 24 19:59:55 GMT 2021

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

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

Back to the top