[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dsdp-ercp-dev] RE: eRCP MultiPageDialog Virtual support issue


Wouldn't changing the Event class create an incompatibility with SWT?



Eric MF Hsu <mfhsu@xxxxxxxxxx>
Sent by: dsdp-ercp-dev-bounces@xxxxxxxxxxx

04/30/2008 04:01 AM

Please respond to
DSDP ercp list <dsdp-ercp-dev@xxxxxxxxxxx>

To
"DSDP ercp list" <dsdp-ercp-dev@xxxxxxxxxxx>
cc
Subject
Re: [dsdp-ercp-dev] RE: eRCP MultiPageDialog Virtual support issue





Hi....All

Since MultiPageDialog extends Dialog which doesn't have addListener() and removeListener() methods to support SWT.Virtual functionality, I suggest to add new three methods in eSWT MPD and Event javadoc in below.

1.
public void addListener(int eventType, Listener listener)
2.
public void removeListener(int eventType, Listener listener)
3.
"int index" field in Event class indicates the index number for items transferred into SetData block.

Any suggestion? Thanks


Sincerely,

Eric MF Hsu (徐銘法)
eRCP/Lotus Expeditor device development
China Software Development Lab, IBM Taiwan
E-Mail : mfhsu@xxxxxxxxxx
Inactive hide details for Eric MF Hsu/Taiwan/IBMEric MF Hsu/Taiwan/IBM

Eric MF Hsu/Taiwan/IBM

2008/04/16 上午 12:14



To

"DSDP ercp list" <dsdp-ercp-dev@xxxxxxxxxxx>

cc

Subject

Re: [dsdp-ercp-dev] RE: eRCP MultiPageDialog Virtual support issue
Eric MF Hsu



From the flexibility perspective, I am in favor of option 1.
I'd suggest to add one more field(index) in Event class.
Since SWT ultilizes it to pass the item index in
handleEvent() block, developer can take advantage of event.index to get corresponding index of transferred item.
Please refer to SWT javadoc and the article (
http://www.eclipse.org/articles/Article-SWT-Virtual/Virtual-in-SWT.html) for more details.
Thank you all.

Sincerely,

Eric MF Hsu (徐銘法)
eRCP/Lotus Expeditor device development
China Software Development Lab, IBM Taiwan
E-Mail : mfhsu@xxxxxxxxxx
Inactive hide details for "Gorkem Ercan" <gercan@xxxxxxx>"Gorkem Ercan" <gercan@xxxxxxx>

"Gorkem Ercan" <gercan@xxxxxxx>
Sent by: dsdp-ercp-dev-bounces@xxxxxxxxxxx

2008/04/14 下午 10:59

Please respond to
DSDP ercp list <dsdp-ercp-dev@xxxxxxxxxxx>



To

"DSDP ercp list" <dsdp-ercp-dev@xxxxxxxxxxx>

cc

Subject

Re: [dsdp-ercp-dev] RE: eRCP MultiPageDialog Virtual support issue




I am in favor of option 1. The composite should be returned from the
createPage() call, it enables more flexible solutions to the use of
virtual.  Comparing the composites is one option but we can also pass
the page number using one of the fields on Event class.
--
Gorkem

2008/4/14 Mark Rogalski <rogalski@xxxxxxxxxx>:
>
> Using the widgetSelected event  for MPD virtual support is dangerous. We
> don't know that filling in the page composite at that point will necessarily
> get that content rendered. It may in WM, but not other implementations.
> Therefore, i suggest sticking with setData().
>  A setPageCount(int) method does not work because page titles are not
> supplied and the MPD tabs would be unnamed until the page is actually
> created.
>
>  Here are two alternatives:
>
>         1) As normally done now, program creates pages before dialog is
> displayed but does not populate them until handleEvent is called. MPD code
> must create the composite, but that is only one widget.. When handleEvent is
> called program can match provided composite to the originally created one.
>
>         2) Instead of getting  a composite back from createPage, that method
> could return null when SWT.VIRTUAL is used. Then no widgets are created
> until needed. However, for that to work, the handleEvent must pass both the
> Composite as well as a page number, so the program knows what page to
> populate. Can this be done?
>
>
>
>
>  Eric MF Hsu <mfhsu@xxxxxxxxxx>
>
> 04/13/2008 11:57 AM
>
>
> To <Gorkem.Ercan@xxxxxxxxx>, Mark Rogalski/Austin/IBM@IBMUS, Uriel KL Liu
> <liukl@xxxxxxxxxx>
>
> cc Daniel DL Su <dlsu@xxxxxxxxxx>
>
> Subject eRCP MultiPageDialog Virtual support issue
>
>
>
>
>
>
>
>  Hi....Gorkem et al
>
>  I have some issues regarding the new function of virtual support of
> MultipageDialog.
>
>  The sample code in mobile spec is as below
>  final MultiPageDialog dialog = new MultiPageDialog(shell, SWT.PRIMARY_MODAL
> | SWT.VIRTUAL);
>  dialog.createPage(&quot;Page 1&quot;, null);
>  dialog.createPage(&quot;Page 2&quot;, null);
>  dialog.createPage(&quot;Page 3&quot;, null);
>  dialog.addListener(SWT.SetData, new Listener() {
>  public void handleEvent(Event event) {
>  Composite page = (Composite)event.item;
>  //Populate rest of the UI
>  }
>
>  Since dialog.createPage(...) will return a instantiated Composite to
> developer, they can just use it without writing any codes in handleEvent()
> block. This will break the spirit of virtual style and make virtual useless.
>  I'd suggest to add a new method ( setPageCount(int PageCount)). Then the
> sample code will be :
>
>  final MultiPageDialog dialog = new MultiPageDialog(shell, SWT.PRIMARY_MODAL
> | SWT.VIRTUAL);
>  dialog.addListener(SWT.SetData, new Listener() {
>  public void handleEvent(Event event) {
>  Composite page = (Composite)event.item;
>  //Populate rest of the UI
>  }
>  dialog.setPageCount(3);
>
>
>  However, we noticed that MPD has the method
> addSelectionListener(SelectionListener listener) {} already. This will be
> notified while one page is selected.
>  The method can be used to simulate similar functionality of virtual MPD.
>  The sample code can be as below.
>  final MultiPageDialog dialog = new MultiPageDialog(shell,
> SWT.PRIMARY_MODAL);
>  dialog.createPage(&quot;Page 1&quot;, null);
>  dialog.createPage(&quot;Page 2&quot;, null);
>  dialog.createPage(&quot;Page 3&quot;, null);
>  dialog.addSelectionListener(new SelectionListener() {
>  public void widgetDefaultSelected(SelectionEvent event) {
>  }
>
>  public void widgetSelected(SelectionEvent event) {
>  //Populate rest of the UI
>  }
>  });
>  However, developer needs to get desired page to complete work, It's not
> convenient as virtual MPD.
>
>  Do you have any suggestion? Thank you.
>
>
>  Sincerely,
>
>  Eric MF Hsu (徐銘法)
>  eRCP/Lotus Expeditor device development
>  China Software Development Lab, IBM Taiwan
>  E-Mail : mfhsu@xxxxxxxxxx Tel : 886-2-8170-6571
>
>
> _______________________________________________
>  dsdp-ercp-dev mailing list
>  dsdp-ercp-dev@xxxxxxxxxxx
>  
https://dev.eclipse.org/mailman/listinfo/dsdp-ercp-dev
>
>
_______________________________________________
dsdp-ercp-dev mailing list
dsdp-ercp-dev@xxxxxxxxxxx

https://dev.eclipse.org/mailman/listinfo/dsdp-ercp-dev

_______________________________________________
dsdp-ercp-dev mailing list
dsdp-ercp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dsdp-ercp-dev

Attachment: pic22833.gif
Description: GIF image

Attachment: pic05239.gif
Description: GIF image