Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Problem with DoubleClickListener in IE after updating to 1.1M3
Problem with DoubleClickListener in IE after updating to 1.1M3 [message #82427] Fri, 11 April 2008 08:09 Go to next message
Eclipse UserFriend
Hi,

After the update on M3 (previously I had M1) is my DoubleClickListener on
TableViewer unreachable in Internet Explorer. In Firefox does the same
listener very good. Can anyone see the same behavior?

Here is my code:

tableViewer.addDoubleClickListener(new IDoubleClickListener()
{
public void doubleClick(DoubleClickEvent arg0)
{
doubleClickAction.run();
}
});

the expression "doubleClickAction.run()" is never reached in IE.

Regards,

Nikolai
Re: Problem with DoubleClickListener in IE after updating to 1.1M3 [message #82442 is a reply to message #82427] Fri, 11 April 2008 08:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rherrmann.innoopract.com

Hi Nikolai,

I cannot reproduce what you describe. I took the TableViewerTab from
the ControlsDemo and added a listener like this:
viewer.addDoubleClickListener( new IDoubleClickListener() {
public void doubleClick( DoubleClickEvent event ) {
System.out.println( "double-click" );
}
} );
In both, FF and IE, the listener is executed. Are you doing anything
else that might interfere with this?

Cheers,
Rüdiger


Nikolai wrote:
> Hi,
>
> After the update on M3 (previously I had M1) is my DoubleClickListener
> on TableViewer unreachable in Internet Explorer. In Firefox does the
> same listener very good. Can anyone see the same behavior?
>
> Here is my code:
>
> tableViewer.addDoubleClickListener(new IDoubleClickListener()
> {
> public void doubleClick(DoubleClickEvent arg0)
> {
> doubleClickAction.run();
> }
> });
>
> the expression "doubleClickAction.run()" is never reached in IE.
>
> Regards,
>
> Nikolai
>
Re: Problem with DoubleClickListener in IE after updating to 1.1M3 [message #82513 is a reply to message #82442] Fri, 11 April 2008 09:46 Go to previous messageGo to next message
Eclipse UserFriend
Hallo Rüdiger,

I have reproduced it with ControlsDemo. This has what with FormToolkit to
do.

Here my code (sorry, if it is too large):

1)
--------------------------------------
--------------------------------------
a new class TableViewerTabDoubleClick:
--------------------------------------
package org.eclipse.rap.demo.controls;

import java.util.ArrayList;

import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.ui.forms.widgets.FormToolkit;

public class TableViewerTabDoubleClick extends ExampleTab {

private static final class Person {
String firstName;
String lastName;
int age;

public Person(final String firstName, final String lastName,
final int age) {
this.firstName = firstName;
this.lastName = lastName;
this.age = age;
}

public String toString() {
return firstName + " " + lastName + " " + age;
}
}

private static final class PersonContentProvider implements
IStructuredContentProvider {
Object[] elements;

public Object[] getElements(final Object inputElement) {
return elements;
}

public void inputChanged(final Viewer viewer, final Object oldInput,
final Object newInput) {
if (newInput == null) {
elements = new Object[0];
} else {
java.util.List personList = (java.util.List) newInput;
elements = personList.toArray();
}
}

public void dispose() {
// do nothing
}
}

private static final class PersonLabelProvider extends LabelProvider
implements ITableLabelProvider {
public Image getColumnImage(final Object element, final int columnIndex)
{
return null;
}

public String getColumnText(final Object element, final int columnIndex)
{
Person person = (Person) element;
String result;
switch (columnIndex) {
case 0:
result = person.firstName;
break;
case 1:
result = person.lastName;
break;
case 2:
result = String.valueOf(person.age);
break;
default:
result = "";
break;
}
return result;
}
}

private Table table;
private TableViewer viewer;
private final java.util.List persons = new ArrayList();
private ScrolledComposite scrolledComposite;
private FormToolkit formToolkit;

public TableViewerTabDoubleClick(final CTabFolder topFolder) {
super(topFolder, "TableViewerDoubleClick");
}

private void initPersons() {
persons.clear();
persons.add(new Person("Rögn\"íy&", "Hövl<, the char tester", 1));
persons.add(new Person("Paul", "Panther", 1));
persons.add(new Person("Karl", "Marx", 2));
persons.add(new Person("Sofia", "Loren", 3));
persons.add(new Person("King", "Cool", 4));
persons.add(new Person("Albert", "Einstein", 5));
persons.add(new Person("Donald", "Duck", 6));
persons.add(new Person("Mickey", "Mouse", 7));
persons.add(new Person("Asterix", "", 8));
persons.add(new Person("Nero", "", 9));
persons.add(new Person("Elvis", "Presley", 10));
}

protected void createStyleControls(final Composite parent) {
createStyleButton("MULTI", SWT.MULTI);
createStyleButton("VIRTUAL", SWT.VIRTUAL);
}

protected void createExampleControls(final Composite parent) {
parent.setLayout(new GridLayout(2, false));
GridData gridData = new GridData();
gridData.grabExcessHorizontalSpace = true;
gridData.verticalAlignment = GridData.FILL;
gridData.grabExcessVerticalSpace = true;
gridData.horizontalAlignment = GridData.FILL;

scrolledComposite = new ScrolledComposite(parent, SWT.V_SCROLL
| SWT.H_SCROLL);
scrolledComposite.setExpandHorizontal(true);
scrolledComposite.setExpandVertical(true);
scrolledComposite.setAlwaysShowScrollBars(false);
scrolledComposite.setLayoutData(gridData);
scrolledComposite.setLayout(new GridLayout());

initPersons();

table = getFormToolkit().createTable(scrolledComposite, SWT.NONE);
initColumnProperties();
table.setHeaderVisible(true);
table.setLinesVisible(true);

viewer = new TableViewer(table);
viewer.setContentProvider(new PersonContentProvider());
viewer.setLabelProvider(new PersonLabelProvider());

viewer.setInput(persons);

viewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
System.out.println("double-click");
}
});

scrolledComposite.setContent(table);
registerControl(scrolledComposite);
}

private FormToolkit getFormToolkit() {
if (formToolkit == null) {
formToolkit = new FormToolkit(Display.getCurrent());
}
return formToolkit;
}

private void initColumnProperties() {
TableColumn firstNameColumn = new TableColumn(table, SWT.NONE);
firstNameColumn.setText("First Name");
firstNameColumn.setWidth(170);
firstNameColumn.setMoveable(true);

TableColumn lastNameColumn = new TableColumn(table, SWT.NONE);
lastNameColumn.setText("Last Name");
lastNameColumn.setWidth(100);
lastNameColumn.setMoveable(true);

TableColumn ageColumn = new TableColumn(table, SWT.NONE);
ageColumn.setText("Age");
ageColumn.setWidth(80);
ageColumn.setMoveable(true);
}

}

-----------------------------------------------------
-----------------------------------------------------
End 1)

2.)

One new row in ControlsDemo.java after new TableViewerTab( topFolder ):
-----------------------------------------------------
-----------------------------------------------------
new TableViewerTabDoubleClick( topFolder ),

---------------------------------------------------
--------------------------------------------------
End 2)

3.) you need a plugin dependence in org.eclipse.rap.demo project to
org.eclipse.rap.ui.forms
--------------------------------------------------
---------------------------------------------------
end 3)


The code in createExampleControls method is the same as in my application

Attention:

if you replace
table = getFormToolkit().createTable(scrolledComposite, SWT.NONE);

with
table = new Table(scrolledComposite, SWT.NONE);

the doubleclick listener works in IE and FF.

with FormToolkit only in FF

regards,

Nikolai
Re: Problem with DoubleClickListener in IE after updating to 1.1M3 [message #82587 is a reply to message #82513] Fri, 11 April 2008 11:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rherrmann.innoopract.com

Hi Nikolai,

thanks for the hint. Now I can reproduce what you described.
It is caused by the call to setForeground and/or setBackground that
takes place when using the FormToolkit to create the Table.
Would you file a bugzilla so that we can track progress on this issue?

Cheers,
Rüdiger


Nikolai wrote:
> Hallo Rüdiger,
>
> I have reproduced it with ControlsDemo. This has what with FormToolkit
> to do.
>
> Here my code (sorry, if it is too large):
>
> 1)
> --------------------------------------
> --------------------------------------
> a new class TableViewerTabDoubleClick:
> --------------------------------------
> package org.eclipse.rap.demo.controls;
>
> import java.util.ArrayList;
>
> import org.eclipse.jface.viewers.DoubleClickEvent;
> import org.eclipse.jface.viewers.IDoubleClickListener;
> import org.eclipse.jface.viewers.IStructuredContentProvider;
> import org.eclipse.jface.viewers.ITableLabelProvider;
> import org.eclipse.jface.viewers.LabelProvider;
> import org.eclipse.jface.viewers.TableViewer;
> import org.eclipse.jface.viewers.Viewer;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.custom.CTabFolder;
> import org.eclipse.swt.custom.ScrolledComposite;
> import org.eclipse.swt.graphics.Image;
> import org.eclipse.swt.layout.GridData;
> import org.eclipse.swt.layout.GridLayout;
> import org.eclipse.swt.widgets.Composite;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Label;
> import org.eclipse.swt.widgets.Table;
> import org.eclipse.swt.widgets.TableColumn;
> import org.eclipse.ui.forms.widgets.FormToolkit;
>
> public class TableViewerTabDoubleClick extends ExampleTab {
>
> private static final class Person {
> String firstName;
> String lastName;
> int age;
>
> public Person(final String firstName, final String lastName,
> final int age) {
> this.firstName = firstName;
> this.lastName = lastName;
> this.age = age;
> }
>
> public String toString() {
> return firstName + " " + lastName + " " + age;
> }
> }
>
> private static final class PersonContentProvider implements
> IStructuredContentProvider {
> Object[] elements;
>
> public Object[] getElements(final Object inputElement) {
> return elements;
> }
>
> public void inputChanged(final Viewer viewer, final Object
> oldInput,
> final Object newInput) {
> if (newInput == null) {
> elements = new Object[0];
> } else {
> java.util.List personList = (java.util.List) newInput;
> elements = personList.toArray();
> }
> }
>
> public void dispose() {
> // do nothing
> }
> }
>
> private static final class PersonLabelProvider extends LabelProvider
> implements ITableLabelProvider {
> public Image getColumnImage(final Object element, final int
> columnIndex) {
> return null;
> }
>
> public String getColumnText(final Object element, final int
> columnIndex) {
> Person person = (Person) element;
> String result;
> switch (columnIndex) {
> case 0:
> result = person.firstName;
> break;
> case 1:
> result = person.lastName;
> break;
> case 2:
> result = String.valueOf(person.age);
> break;
> default:
> result = "";
> break;
> }
> return result;
> }
> }
>
> private Table table;
> private TableViewer viewer;
> private final java.util.List persons = new ArrayList();
> private ScrolledComposite scrolledComposite;
> private FormToolkit formToolkit;
>
> public TableViewerTabDoubleClick(final CTabFolder topFolder) {
> super(topFolder, "TableViewerDoubleClick");
> }
>
> private void initPersons() {
> persons.clear();
> persons.add(new Person("Rögn\"íy&", "Hövl<, the char tester",
> 1));
> persons.add(new Person("Paul", "Panther", 1));
> persons.add(new Person("Karl", "Marx", 2));
> persons.add(new Person("Sofia", "Loren", 3));
> persons.add(new Person("King", "Cool", 4));
> persons.add(new Person("Albert", "Einstein", 5));
> persons.add(new Person("Donald", "Duck", 6));
> persons.add(new Person("Mickey", "Mouse", 7));
> persons.add(new Person("Asterix", "", 8));
> persons.add(new Person("Nero", "", 9));
> persons.add(new Person("Elvis", "Presley", 10));
> }
>
> protected void createStyleControls(final Composite parent) {
> createStyleButton("MULTI", SWT.MULTI);
> createStyleButton("VIRTUAL", SWT.VIRTUAL);
> }
>
> protected void createExampleControls(final Composite parent) {
> parent.setLayout(new GridLayout(2, false));
> GridData gridData = new GridData();
> gridData.grabExcessHorizontalSpace = true;
> gridData.verticalAlignment = GridData.FILL;
> gridData.grabExcessVerticalSpace = true;
> gridData.horizontalAlignment = GridData.FILL;
>
> scrolledComposite = new ScrolledComposite(parent, SWT.V_SCROLL
> | SWT.H_SCROLL);
> scrolledComposite.setExpandHorizontal(true);
> scrolledComposite.setExpandVertical(true);
> scrolledComposite.setAlwaysShowScrollBars(false);
> scrolledComposite.setLayoutData(gridData);
> scrolledComposite.setLayout(new GridLayout());
>
> initPersons();
>
> table = getFormToolkit().createTable(scrolledComposite, SWT.NONE);
> initColumnProperties();
> table.setHeaderVisible(true);
> table.setLinesVisible(true);
>
> viewer = new TableViewer(table);
> viewer.setContentProvider(new PersonContentProvider());
> viewer.setLabelProvider(new PersonLabelProvider());
>
> viewer.setInput(persons);
>
> viewer.addDoubleClickListener(new IDoubleClickListener() {
> public void doubleClick(DoubleClickEvent event) {
> System.out.println("double-click");
> }
> });
>
> scrolledComposite.setContent(table);
> registerControl(scrolledComposite);
> }
>
> private FormToolkit getFormToolkit() {
> if (formToolkit == null) {
> formToolkit = new FormToolkit(Display.getCurrent());
> }
> return formToolkit;
> }
>
> private void initColumnProperties() {
> TableColumn firstNameColumn = new TableColumn(table, SWT.NONE);
> firstNameColumn.setText("First Name");
> firstNameColumn.setWidth(170);
> firstNameColumn.setMoveable(true);
>
> TableColumn lastNameColumn = new TableColumn(table, SWT.NONE);
> lastNameColumn.setText("Last Name");
> lastNameColumn.setWidth(100);
> lastNameColumn.setMoveable(true);
>
> TableColumn ageColumn = new TableColumn(table, SWT.NONE);
> ageColumn.setText("Age");
> ageColumn.setWidth(80);
> ageColumn.setMoveable(true);
> }
>
> }
>
> -----------------------------------------------------
> -----------------------------------------------------
> End 1)
>
> 2.)
>
> One new row in ControlsDemo.java after new TableViewerTab( topFolder ):
> -----------------------------------------------------
> -----------------------------------------------------
> new TableViewerTabDoubleClick( topFolder ),
>
> ---------------------------------------------------
> --------------------------------------------------
> End 2)
>
> 3.) you need a plugin dependence in org.eclipse.rap.demo project to
> org.eclipse.rap.ui.forms
> --------------------------------------------------
> ---------------------------------------------------
> end 3)
>
>
> The code in createExampleControls method is the same as in my application
>
> Attention:
>
> if you replace
> table = getFormToolkit().createTable(scrolledComposite, SWT.NONE);
>
> with
> table = new Table(scrolledComposite, SWT.NONE);
>
> the doubleclick listener works in IE and FF.
>
> with FormToolkit only in FF
>
> regards,
>
> Nikolai
>
Re: Problem with DoubleClickListener in IE after updating to 1.1M3 [message #82600 is a reply to message #82587] Fri, 11 April 2008 14:21 Go to previous message
Eclipse UserFriend
Hi Rüdiger,

226737 is filled.

Regards and beautiful weekend,

Nikolai
Previous Topic:Problems using ScrolledComposite
Next Topic:Ivalid version of Require-Bundle in org.eclipse.rap.jface 1.1.0
Goto Forum:
  


Current Time: Sun Aug 31 08:55:14 EDT 2025

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

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

Back to the top