Skip to main content



      Home
Home » Newcomers » Newcomers » No event occured at ScaleFieldEditor with mouse wheel
No event occured at ScaleFieldEditor with mouse wheel [message #258263] Thu, 12 June 2008 08:33 Go to next message
Eclipse UserFriend
Hello.

I found the subject issue on SWT/JFace version 3.3.2.
The following source code includes the issue.

----
import java.io.IOException;

import org.eclipse.jface.preference.FieldEditor;
import org.eclipse.jface.preference.IPreferencePageContainer;
import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.preference.PreferenceManager;
import org.eclipse.jface.preference.PreferenceNode;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.preference.ScaleFieldEditor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class NoEvent extends PreferenceDialog {

public NoEvent(Shell parentShell, PreferenceManager manager) throws
IOException {
super(parentShell, manager);
PreferencePage page1 = new SamplePreferencePage("Page1", this);
PreferenceNode node1 = new PreferenceNode("node1", page1);
manager.addToRoot(node1);
}

private final class SamplePreferencePage extends PreferencePage {
private FieldEditor editor;

private SamplePreferencePage(String title,
IPreferencePageContainer container) {
super(title);
setContainer(container);
}

@Override
protected Control createContents(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(2, false));
composite.setLayoutData(new
GridData(GridData.FILL_HORIZONTAL));

editor = new ScaleFieldEditor("scale", "&Scale", composite);
editor.setPage(this);
editor.setPreferenceStore(getPreferenceStore());
editor.load();

editor.setPropertyChangeListener(new IPropertyChangeListener()
{
@Override
public void propertyChange(PropertyChangeEvent event) {
// Event occured when scale editor was clicked.
// However, no event occured when scale value changed
with mouse wheel.
System.out.println("event occured");
}
});

return parent;
}
}

public static void main(String[] args) throws IOException {
Display display = new Display();
Shell shell = new Shell(display);
NoEvent dialog = new NoEvent(shell, new PreferenceManager());
dialog.open();
shell.dispose();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
----

I think this is a bug.
Should I report to Bugzilla this issue?
Re: No event occured at ScaleFieldEditor with mouse wheel [message #258481 is a reply to message #258263] Fri, 13 June 2008 10:00 Go to previous messageGo to next message
Eclipse UserFriend
I assume that you mean the "mouse wheel" issue mentioned in the
comments.

First, I recommend that you include a few words describing the problem
before the code (so that the reader doesn't have to hunt for it).

Second, it does sound like a bug. Please report it.

Wayne

On Thu, 2008-06-12 at 12:33 +0000, Satoshi OGATA wrote:
> Hello.
>
> I found the subject issue on SWT/JFace version 3.3.2.
> The following source code includes the issue.
>
> ----
> import java.io.IOException;
>
> import org.eclipse.jface.preference.FieldEditor;
> import org.eclipse.jface.preference.IPreferencePageContainer;
> import org.eclipse.jface.preference.PreferenceDialog;
> import org.eclipse.jface.preference.PreferenceManager;
> import org.eclipse.jface.preference.PreferenceNode;
> import org.eclipse.jface.preference.PreferencePage;
> import org.eclipse.jface.preference.ScaleFieldEditor;
> import org.eclipse.jface.util.IPropertyChangeListener;
> import org.eclipse.jface.util.PropertyChangeEvent;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.layout.GridData;
> import org.eclipse.swt.layout.GridLayout;
> import org.eclipse.swt.widgets.Composite;
> import org.eclipse.swt.widgets.Control;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Shell;
>
> public class NoEvent extends PreferenceDialog {
>
> public NoEvent(Shell parentShell, PreferenceManager manager) throws
> IOException {
> super(parentShell, manager);
> PreferencePage page1 = new SamplePreferencePage("Page1", this);
> PreferenceNode node1 = new PreferenceNode("node1", page1);
> manager.addToRoot(node1);
> }
>
> private final class SamplePreferencePage extends PreferencePage {
> private FieldEditor editor;
>
> private SamplePreferencePage(String title,
> IPreferencePageContainer container) {
> super(title);
> setContainer(container);
> }
>
> @Override
> protected Control createContents(Composite parent) {
> Composite composite = new Composite(parent, SWT.NONE);
> composite.setLayout(new GridLayout(2, false));
> composite.setLayoutData(new
> GridData(GridData.FILL_HORIZONTAL));
>
> editor = new ScaleFieldEditor("scale", "&Scale", composite);
> editor.setPage(this);
> editor.setPreferenceStore(getPreferenceStore());
> editor.load();
>
> editor.setPropertyChangeListener(new IPropertyChangeListener()
> {
> @Override
> public void propertyChange(PropertyChangeEvent event) {
> // Event occured when scale editor was clicked.
> // However, no event occured when scale value changed
> with mouse wheel.
> System.out.println("event occured");
> }
> });
>
> return parent;
> }
> }
>
> public static void main(String[] args) throws IOException {
> Display display = new Display();
> Shell shell = new Shell(display);
> NoEvent dialog = new NoEvent(shell, new PreferenceManager());
> dialog.open();
> shell.dispose();
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch()) {
> display.sleep();
> }
> }
> display.dispose();
> }
> }
> ----
>
> I think this is a bug.
> Should I report to Bugzilla this issue?
>
Re: No event occured at ScaleFieldEditor with mouse wheel [message #258488 is a reply to message #258481] Fri, 13 June 2008 10:02 Go to previous messageGo to next message
Eclipse UserFriend
FWIW, I apparently have "Subject line" blindness.

Wayne

On Fri, 2008-06-13 at 10:00 -0400, Wayne Beaton wrote:

> First, I recommend that you include a few words describing the problem
> before the code (so that the reader doesn't have to hunt for it).
Re: No event occured at ScaleFieldEditor with mouse wheel [message #258586 is a reply to message #258488] Sat, 14 June 2008 11:04 Go to previous message
Eclipse UserFriend
Hello,

Thank you for your comments.

I was nervous because I have a experience of non-bug reporting before.

I'll try to report this issue.

OGATA
Previous Topic:Eclipse Apache Derby
Next Topic:Managment Tool
Goto Forum:
  


Current Time: Mon Jun 16 18:51:59 EDT 2025

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

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

Back to the top