Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 252076 Details for
Bug 463664
[Cocoa][GTK]most of SWT.CURSOR* mouse cursors are incorrect
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
some code for quickly trying out all different mouse pointers
MouseCursorVisualizer.java (text/plain), 1.79 KB, created by
Neeme Praks
on 2015-04-01 06:55:57 EDT
(
hide
)
Description:
some code for quickly trying out all different mouse pointers
Filename:
MIME Type:
Creator:
Neeme Praks
Created:
2015-04-01 06:55:57 EDT
Size:
1.79 KB
patch
obsolete
>package com.zeroturnaround.eclipse.optimizer.plugin; > >import java.lang.reflect.Field; > >import org.eclipse.jface.window.Window; >import org.eclipse.swt.SWT; >import org.eclipse.swt.events.MouseEvent; >import org.eclipse.swt.events.MouseTrackAdapter; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Control; >import org.eclipse.swt.widgets.Label; >import org.eclipse.swt.widgets.Shell; > >public class MouseCursorVisualizer extends Window { > > protected MouseCursorVisualizer(Shell parentShell) { > super(parentShell); > } > > @Override > protected Control createContents(Composite parent) { > Composite contents = new Composite(parent, SWT.NONE); > FillLayout layout; > contents.setLayout(layout = new FillLayout(SWT.VERTICAL)); > layout.spacing = 10; > Field[] fields = SWT.class.getFields(); > for (Field field : fields) { > if (field.getName().startsWith("CURSOR_")) { > Label label = new Label(contents, SWT.NONE); > label.setText(field.getName()); > try { > label.addMouseTrackListener(new ShowMouseCursor(field.getInt(null), getShell())); > } > catch (RuntimeException e) { > throw e; > } > catch (Exception e) { > throw new RuntimeException(e); > } > } > } > return contents; > } > > private static class ShowMouseCursor extends MouseTrackAdapter { > private final int cursorType; > private final Shell shell; > > public ShowMouseCursor(int cursorType, Shell shell) { > this.cursorType = cursorType; > this.shell = shell; > } > @Override > public void mouseEnter(MouseEvent e) { > shell.setCursor(shell.getDisplay().getSystemCursor(cursorType)); > } > @Override > public void mouseExit(MouseEvent e) { > shell.setCursor(null); > } > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 463664
: 252076