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 111283 Details for
Bug 244004
Cursor support missing
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.
[patch]
Add support for set/get cursor of Control.
Cursor_Infrastructure_Patch.txt (text/plain), 46.60 KB, created by
Ivan Furnadjiev
on 2008-08-29 06:11:40 EDT
(
hide
)
Description:
Add support for set/get cursor of Control.
Filename:
MIME Type:
Creator:
Ivan Furnadjiev
Created:
2008-08-29 06:11:40 EDT
Size:
46.60 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt.q07.test >Index: src/org/eclipse/rwt/lifecycle/ControlLCAUtil_Test.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.rwt.q07.test/src/org/eclipse/rwt/lifecycle/ControlLCAUtil_Test.java,v >retrieving revision 1.3 >diff -u -r1.3 ControlLCAUtil_Test.java >--- src/org/eclipse/rwt/lifecycle/ControlLCAUtil_Test.java 25 Aug 2008 13:49:38 -0000 1.3 >+++ src/org/eclipse/rwt/lifecycle/ControlLCAUtil_Test.java 29 Aug 2008 10:06:57 -0000 >@@ -16,12 +16,14 @@ > import junit.framework.TestCase; > > import org.eclipse.rwt.Fixture; >+import org.eclipse.rwt.graphics.Graphics; > import org.eclipse.rwt.internal.lifecycle.DisplayUtil; > import org.eclipse.rwt.internal.lifecycle.JSConst; > import org.eclipse.rwt.internal.service.RequestParams; > import org.eclipse.swt.RWTFixture; > import org.eclipse.swt.SWT; > import org.eclipse.swt.events.*; >+import org.eclipse.swt.graphics.Cursor; > import org.eclipse.swt.graphics.Rectangle; > import org.eclipse.swt.internal.events.ActivateAdapter; > import org.eclipse.swt.internal.events.ActivateEvent; >@@ -224,6 +226,28 @@ > assertEquals( new Integer( 1 ), adapter.getPreserved( Props.Z_INDEX ) ); > } > >+ public void testWriteCursor() throws Exception { >+ Display display = new Display(); >+ Shell shell = new Shell( display, SWT.NONE ); >+ final Control control = new Button( shell, SWT.PUSH ); >+ AbstractWidgetLCA controlLCA = WidgetUtil.getLCA( control ); >+ Cursor cursor = Graphics.getCursor( SWT.CURSOR_HAND ); >+ RWTFixture.markInitialized( control ); >+ RWTFixture.preserveWidgets(); >+ control.setCursor( cursor ); >+ ControlLCAUtil.writeCursor( control ); >+ assertTrue( Fixture.getAllMarkup().indexOf( "setCursor" ) != -1 ); >+ >+ Fixture.fakeResponseWriter(); >+ controlLCA.preserveValues( control ); >+ ControlLCAUtil.writeCursor( control ); >+ assertEquals( "", Fixture.getAllMarkup() ); >+ >+ control.setCursor( null ); >+ ControlLCAUtil.writeCursor( control ); >+ assertTrue( Fixture.getAllMarkup().indexOf( "resetCursor" ) != -1 ); >+ } >+ > protected void setUp() throws Exception { > RWTFixture.setUp(); > Fixture.fakeResponseWriter(); >#P org.eclipse.rap.rwt.q07 >Index: js/org/eclipse/swt/theme/AppearancesBase.js >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.rwt.q07/js/org/eclipse/swt/theme/AppearancesBase.js,v >retrieving revision 1.13 >diff -u -r1.13 AppearancesBase.js >--- js/org/eclipse/swt/theme/AppearancesBase.js 25 Aug 2008 14:55:41 -0000 1.13 >+++ js/org/eclipse/swt/theme/AppearancesBase.js 29 Aug 2008 10:07:00 -0000 >@@ -142,6 +142,7 @@ > result.backgroundColor = tv.getColor( "label.background" ); > result.textColor = tv.getColor( "label.foreground" ); > } >+ result.cursor = "default"; > return result; > } > }, >@@ -764,6 +765,7 @@ > style : function( states ) { > var tv = new org.eclipse.swt.theme.ThemeValues( states ); > return { >+ cursor : "default", > overflow : "hidden", > textColor : tv.getColor( "list.foreground" ), > backgroundColor : tv.getColor( "list.background" ), >@@ -777,7 +779,6 @@ > style : function( states ) { > var tv = new org.eclipse.swt.theme.ThemeValues( states ); > var result = { >- cursor : "default", > height : "auto", > horizontalChildrenAlign : "left", > verticalChildrenAlign : "middle", >#P org.eclipse.rap.demo >Index: src/org/eclipse/rap/demo/controls/ExampleTab.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/ExampleTab.java,v >retrieving revision 1.36 >diff -u -r1.36 ExampleTab.java >--- src/org/eclipse/rap/demo/controls/ExampleTab.java 17 Aug 2008 16:16:28 -0000 1.36 >+++ src/org/eclipse/rap/demo/controls/ExampleTab.java 29 Aug 2008 10:07:02 -0000 >@@ -11,6 +11,7 @@ > > package org.eclipse.rap.demo.controls; > >+import java.lang.reflect.Field; > import java.util.*; > import java.util.List; > >@@ -58,6 +59,29 @@ > public static final Color FG_COLOR_BLUE = Graphics.getColor( 28, 96, 141 ); > public static final Color FG_COLOR_ORANGE = Graphics.getColor( 249, 158, 0 ); > >+ private static final String[] SWT_CURSORS = { >+ "null", >+ "CURSOR_ARROW", >+ "CURSOR_WAIT", >+ "CURSOR_CROSS", >+ "CURSOR_HELP", >+ "CURSOR_SIZEALL", >+ "CURSOR_SIZENESW", >+ "CURSOR_SIZENS", >+ "CURSOR_SIZENWSE", >+ "CURSOR_SIZEWE", >+ "CURSOR_SIZEN", >+ "CURSOR_SIZES", >+ "CURSOR_SIZEE", >+ "CURSOR_SIZEW", >+ "CURSOR_SIZENE", >+ "CURSOR_SIZESE", >+ "CURSOR_SIZESW", >+ "CURSOR_SIZENW", >+ "CURSOR_IBEAM", >+ "CURSOR_HAND" >+ }; >+ > public static Image BG_PATTERN_IMAGE > = Graphics.getImage( "resources/pattern.png", > ExampleTab.class.getClassLoader() ); >@@ -376,6 +400,32 @@ > } > > /** >+ * Creates a combo that controls whether a cursor is set on the >+ * registered controls. >+ * >+ * @return the created combo >+ */ >+ protected Combo createCursorCombo() { >+ Composite group = new Composite( styleComp, SWT.NONE ); >+ group.setLayout( new GridLayout( 2, false ) ); >+ new Label( group, SWT.NONE ).setText( "Cursor:" ); >+ final Combo combo = new Combo( group, SWT.READ_ONLY ); >+ combo.setItems( SWT_CURSORS ); >+ combo.select( 0 ); >+ combo.addSelectionListener( new SelectionAdapter() { >+ public void widgetSelected( final SelectionEvent e ) { >+ String selection = null; >+ int index = combo.getSelectionIndex(); >+ if( index > 0 ) { >+ selection = combo.getItem( index ); >+ } >+ updateCursor( selection ); >+ } >+ } ); >+ return combo; >+ } >+ >+ /** > * Adds a control to the list of registered controls. Registered controls can > * be hidden and disabled by the checkbuttons in the property area. This > * method is to be called within <code>createExampleControls</code>. >@@ -473,6 +523,24 @@ > } > } > >+ private void updateCursor( final String selection ) { >+ Cursor cursor = null; >+ Class swtClass = SWT.class; >+ if( selection != null ) { >+ try { >+ Field field = swtClass.getField( selection ); >+ int cursorStyle = field.getInt( swtClass ); >+ cursor = Graphics.getCursor( cursorStyle ); >+ } catch( Exception e ) { >+ } >+ } >+ Iterator iter = controls.iterator(); >+ while( iter.hasNext() ) { >+ Control control = ( Control )iter.next(); >+ control.setCursor( cursor ); >+ } >+ } >+ > protected Shell getShell() { > return folder.getShell(); > } >Index: src/org/eclipse/rap/demo/controls/ScaleTab.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/ScaleTab.java,v >retrieving revision 1.1 >diff -u -r1.1 ScaleTab.java >--- src/org/eclipse/rap/demo/controls/ScaleTab.java 12 Jul 2008 17:11:35 -0000 1.1 >+++ src/org/eclipse/rap/demo/controls/ScaleTab.java 29 Aug 2008 10:07:02 -0000 >@@ -19,28 +19,29 @@ > import org.eclipse.swt.layout.RowLayout; > import org.eclipse.swt.widgets.*; > >-public class ScaleTab extends ExampleTab { >+public class ScaleTab extends ExampleTab { > > private static final String PROP_CONTEXT_MENU = "contextMenu"; > private static final String PROP_SELECTION_LISTENER = "selectionListener"; >- >- Scale scale; >+ >+ Scale scale; > Spinner minimumSpinner, maximumSpinner, selectionSpinner, > incrementSpinner, pageIncrementSpinner; >- >+ > public ScaleTab( final CTabFolder folder ) { > super( folder, "Scale" ); > setDefaultStyle( SWT.HORIZONTAL ); > } > >- protected void createStyleControls( final Composite parent ) { >+ protected void createStyleControls( final Composite parent ) { > createStyleButton( parent, "HORIZONTAL", SWT.HORIZONTAL, SWT.RADIO, true ); >- createStyleButton( parent, "VERTICAL", SWT.VERTICAL, SWT.RADIO, false ); >+ createStyleButton( parent, "VERTICAL", SWT.VERTICAL, SWT.RADIO, false ); > createStyleButton( "BORDER", SWT.BORDER ); > createVisibilityButton(); >- createEnablementButton(); >+ createEnablementButton(); > createBgColorButton(); >- createBgImageButton(); >+ createBgImageButton(); >+ createCursorCombo(); > minimumSpinner = createSpinnerControl( parent, "Minimum", > 0, 100000, 0 ); > minimumSpinner.addModifyListener( new ModifyListener() { >@@ -142,7 +143,7 @@ > } > registerControl( scale ); > } >- >+ > protected Button createStyleButton( final Composite parent, > final String name, > final int style, >@@ -161,7 +162,7 @@ > button.setSelection( checked ); > return button; > } >- >+ > private Spinner createSpinnerControl( final Composite parent, > final String labelText, > final int minimum, >@@ -174,7 +175,7 @@ > final Spinner spinner = new Spinner( composite, SWT.BORDER ); > spinner.setSelection( selection ); > spinner.setMinimum( minimum ); >- spinner.setMaximum( maximum ); >+ spinner.setMaximum( maximum ); > return spinner; > } > } >Index: src/org/eclipse/rap/demo/controls/ListTab.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/ListTab.java,v >retrieving revision 1.25 >diff -u -r1.25 ListTab.java >--- src/org/eclipse/rap/demo/controls/ListTab.java 12 Jun 2008 14:00:46 -0000 1.25 >+++ src/org/eclipse/rap/demo/controls/ListTab.java 29 Aug 2008 10:07:02 -0000 >@@ -76,6 +76,7 @@ > createBgColorButton(); > createBgImageButton(); > createFontChooser(); >+ createCursorCombo(); > createSelectionButton(); > } > >Index: src/org/eclipse/rap/demo/controls/SpinnerTab.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/SpinnerTab.java,v >retrieving revision 1.12 >diff -u -r1.12 SpinnerTab.java >--- src/org/eclipse/rap/demo/controls/SpinnerTab.java 12 Jun 2008 14:00:46 -0000 1.12 >+++ src/org/eclipse/rap/demo/controls/SpinnerTab.java 29 Aug 2008 10:07:02 -0000 >@@ -37,6 +37,7 @@ > createFgColorButton(); > createBgColorButton(); > createFontChooser(); >+ createCursorCombo(); > } > > protected void createExampleControls( final Composite parent ) { >Index: src/org/eclipse/rap/demo/controls/CompositeTab.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/CompositeTab.java,v >retrieving revision 1.15 >diff -u -r1.15 CompositeTab.java >--- src/org/eclipse/rap/demo/controls/CompositeTab.java 12 Jun 2008 14:00:46 -0000 1.15 >+++ src/org/eclipse/rap/demo/controls/CompositeTab.java 29 Aug 2008 10:07:01 -0000 >@@ -35,6 +35,7 @@ > createBgColorButton(); > createBgImageButton(); > createBackgroundModeControls( parent ); >+ createCursorCombo(); > Button cbAddMouseListener = new Button( parent, SWT.CHECK ); > cbAddMouseListener.setText( "Attach MouseListener" ); > cbAddMouseListener.addSelectionListener( new SelectionAdapter() { >Index: src/org/eclipse/rap/demo/controls/TextTab.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/TextTab.java,v >retrieving revision 1.29 >diff -u -r1.29 TextTab.java >--- src/org/eclipse/rap/demo/controls/TextTab.java 19 Aug 2008 15:58:34 -0000 1.29 >+++ src/org/eclipse/rap/demo/controls/TextTab.java 29 Aug 2008 10:07:02 -0000 >@@ -92,6 +92,7 @@ > createFgColorButton(); > createBgColorButton(); > createFontChooser(); >+ createCursorCombo(); > createLimitText( parent ); > createSelectionChooser( parent ); > } >@@ -160,7 +161,7 @@ > final Button defaultButton = new Button( composite, SWT.PUSH ); > defaultButton.setText( "Default" ); > defaultButton.addSelectionListener( new SelectionAdapter() { >- >+ > public void widgetSelected( SelectionEvent e ) { > String message = "Default button triggered"; > MessageDialog.openInformation( parent.getShell(), "Info", message ); >@@ -169,7 +170,7 @@ > final Button setDefaultButton = new Button( composite, SWT.CHECK ); > setDefaultButton.setText( "set as defaultButton" ); > setDefaultButton.addSelectionListener( new SelectionAdapter() { >- >+ > public void widgetSelected( SelectionEvent e ) { > if( setDefaultButton.getSelection() ) { > parent.getShell().setDefaultButton( defaultButton ); >@@ -265,7 +266,7 @@ > Button selectAllButton = new Button( composite, SWT.PUSH ); > selectAllButton.setText( "select all" ); > selectAllButton.addSelectionListener( new SelectionAdapter() { >- >+ > public void widgetSelected( SelectionEvent e ) { > text.selectAll(); > } >Index: src/org/eclipse/rap/demo/controls/ComboTab.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/ComboTab.java,v >retrieving revision 1.26 >diff -u -r1.26 ComboTab.java >--- src/org/eclipse/rap/demo/controls/ComboTab.java 12 Jun 2008 14:00:46 -0000 1.26 >+++ src/org/eclipse/rap/demo/controls/ComboTab.java 29 Aug 2008 10:07:01 -0000 >@@ -60,6 +60,7 @@ > createFgColorButton(); > createBgColorButton(); > createFontChooser(); >+ createCursorCombo(); > createPropertyCheckbox( "Create Empty Combo", PROP_EMPTY ); > createPropertyCheckbox( "Preselect First Item", PROP_PRESELECT_ITEM ); > createPropertyCheckbox( "Add Selection Listener", PROP_SELECTION_LISTENER ); >Index: src/org/eclipse/rap/demo/controls/LabelTab.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/LabelTab.java,v >retrieving revision 1.20 >diff -u -r1.20 LabelTab.java >--- src/org/eclipse/rap/demo/controls/LabelTab.java 12 Jun 2008 14:00:46 -0000 1.20 >+++ src/org/eclipse/rap/demo/controls/LabelTab.java 29 Aug 2008 10:07:02 -0000 >@@ -60,6 +60,7 @@ > createBgColorButton(); > createBgImageButton(); > createFontChooser(); >+ createCursorCombo(); > createChangeTextControl( parent ); > createChangeToolTipControl( parent ); > } >Index: src/org/eclipse/rap/demo/controls/ButtonTab.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/ButtonTab.java,v >retrieving revision 1.24 >diff -u -r1.24 ButtonTab.java >--- src/org/eclipse/rap/demo/controls/ButtonTab.java 12 Jun 2008 14:00:46 -0000 1.24 >+++ src/org/eclipse/rap/demo/controls/ButtonTab.java 29 Aug 2008 10:07:01 -0000 >@@ -54,6 +54,7 @@ > createBgColorButton(); > createBgImageButton(); > createFontChooser(); >+ createCursorCombo(); > Button button = createPropertyButton( "Toggle Button", SWT.PUSH ); > button.setToolTipText( "Remote control the toggle button" ); > button.addSelectionListener( new SelectionAdapter() { >#P org.eclipse.rap.rwt.test >Index: src/org/eclipse/swt/widgets/Control_Test.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.rwt.test/src/org/eclipse/swt/widgets/Control_Test.java,v >retrieving revision 1.9 >diff -u -r1.9 Control_Test.java >--- src/org/eclipse/swt/widgets/Control_Test.java 12 Jun 2008 13:23:14 -0000 1.9 >+++ src/org/eclipse/swt/widgets/Control_Test.java 29 Aug 2008 10:07:04 -0000 >@@ -605,4 +605,21 @@ > } catch( IllegalArgumentException e ) { > } > } >+ >+ public void testCursor() { >+ Display display = new Display(); >+ Shell shell = new Shell( display, SWT.NONE ); >+ final Control control = new Button( shell, SWT.PUSH ); >+ Cursor cursor = Graphics.getCursor( SWT.CURSOR_HAND ); >+ control.setCursor( cursor ); >+ assertEquals( cursor, control.getCursor() ); >+ >+ cursor = null; >+ control.setCursor( cursor ); >+ assertEquals( cursor, control.getCursor() ); >+ >+ cursor = Graphics.getCursor( SWT.CURSOR_CROSS ); >+ control.setCursor( cursor ); >+ assertEquals( cursor, control.getCursor() ); >+ } > } >#P org.eclipse.rap.rwt >Index: src/org/eclipse/swt/internal/widgets/Props.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.rwt/src/org/eclipse/swt/internal/widgets/Props.java,v >retrieving revision 1.4 >diff -u -r1.4 Props.java >--- src/org/eclipse/swt/internal/widgets/Props.java 12 Jun 2008 13:12:12 -0000 1.4 >+++ src/org/eclipse/swt/internal/widgets/Props.java 29 Aug 2008 10:07:09 -0000 >@@ -22,7 +22,8 @@ > public static final String VISIBLE = "visible"; > public static final String ENABLED = "enabled"; > public static final String CONTROL_LISTENERS = "hasControlListeners"; >- >+ public static final String CURSOR = "cursor"; >+ > // Scrollable > public static final String CLIENT_AREA = "clientArea"; > >@@ -30,21 +31,21 @@ > public static final String SELECTION_LISTENERS = "selectionListeners"; > public static final String ACTIVATE_LISTENER = "activateListener"; > public static final String FOCUS_LISTENER = "focusListener"; >- >+ > // Text properties > public static final String TEXT = "text"; >- >+ > public static final String IMAGE = "image"; >- >+ > // Table, TableItem and TableColumn properties > public static final String SELECTION_INDICES = "selection"; >- >+ > // CoolBar/CoolItem properties > public static final String LOCKED = "locked"; > public static final String CONTROL = "control"; >- >+ > public static final String TOOLTIP = "toolTip"; >- >+ > public static final String BACKGROUND = "background"; > public static final String FOREGROUND = "foreground"; > public static final String FONT = "font"; >Index: src/org/eclipse/rwt/graphics/Graphics.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.rwt/src/org/eclipse/rwt/graphics/Graphics.java,v >retrieving revision 1.14 >diff -u -r1.14 Graphics.java >--- src/org/eclipse/rwt/graphics/Graphics.java 12 Jun 2008 13:56:32 -0000 1.14 >+++ src/org/eclipse/rwt/graphics/Graphics.java 29 Aug 2008 10:07:06 -0000 >@@ -23,7 +23,7 @@ > * As RAP needs to handle with multiple clients simultaneously there are no > * constructors for these objects to share them between different sessions > * in order to have a much smaller memory footprint. >- * >+ * > * @since 1.0 > */ > public final class Graphics { >@@ -31,10 +31,10 @@ > /** > * Returns an instance of {@link Color} given an > * <code>RGB</code> describing the desired red, green and blue values. >- * >+ * > * @param rgb the RGB values of the desired color > * @return the color >- * >+ * > * @see RGB > * @see Device#getSystemColor > */ >@@ -46,7 +46,7 @@ > * Returns a {@link Color} given the > * desired red, green and blue values expressed as ints in the range > * 0 to 255 (where 0 is black and 255 is full brightness). >- * >+ * > * @param red the amount of red in the color > * @param green the amount of green in the color > * @param blue the amount of blue in the color >@@ -60,7 +60,7 @@ > /** > * Returns a new font given a font data > * which describes the desired font's appearance. >- * >+ * > * @param data the {@link FontData} to use > * @return the font > */ >@@ -71,7 +71,7 @@ > /** > * Returns a {@link Font} object given a font name, the height of the desired > * font in points, and a font style. >- * >+ * > * @param name the name of the font (must not be null) > * @param height the font height in points > * @param style a bit or combination of <code>NORMAL</code>, >@@ -88,9 +88,9 @@ > /** > * Returns an instance of {@link Image} based on the specified > * image path. The image has to be on the applications class-path. >- * >+ * > * @param path the path to the image >- * >+ * > * @return the image > */ > public static Image getImage( final String path ) { >@@ -101,10 +101,10 @@ > * Returns an instance of {@link Image} based on the specified > * image path. The image has to be on the applications class-path. > * Uses the specified classloader to load the image. >- * >+ * > * @param path the path to the image > * @param imageLoader the classloader to use >- * >+ * > * @return the image > */ > public static Image getImage( final String path, >@@ -113,14 +113,14 @@ > return ResourceFactory.findImage( path, imageLoader ); > } > >- >+ > /** > * Returns an instance of {@link Image} based on the specified > * image path. The image will be read from the provided InputStream. >- * >+ * > * @param path the path to the image > * @param inputStream the input stream for the image >- * >+ * > * @return the image > */ > public static Image getImage( final String path, >@@ -128,10 +128,22 @@ > { > return ResourceFactory.findImage( path, inputStream ); > } >- >+ >+ /** >+ * Returns an instance of {@link Cursor} based on the specified style. >+ * >+ * @param style the cursor style >+ * @return >+ * >+ * @return the cursor >+ */ >+ public static Cursor getCursor( final int style ) { >+ return ResourceFactory.getCursor( style ); >+ } >+ > ////////////////////////// > // Text-Size-Determination >- >+ > /** > * Returns the extent of the given string. Tab expansion and carriage return > * processing are performed. >@@ -139,7 +151,7 @@ > * The <em>extent</em> of a string is the width and height of the > * rectangular area it would cover if drawn in a particular font. > * </p> >- * >+ * > * @param font the font for which the result is valid > * @param string the string to measure > * @param wrapWidth the maximum width of the text. The text will be wrapped to >@@ -159,7 +171,7 @@ > } > return TextSizeDetermination.textExtent( font, string, wrapWidth ); > } >- >+ > /** > * Returns the extent of the given string. No tab expansion or carriage return > * processing will be performed. >@@ -167,7 +179,7 @@ > * The <em>extent</em> of a string is the width and height of the > * rectangular area it would cover if drawn in a particular font. > * </p> >- * >+ * > * @param font the font for which the result is valid > * @param string the string to measure > * @return a point containing the extent of the string >@@ -182,10 +194,10 @@ > } > return TextSizeDetermination.stringExtent( font, string ); > } >- >+ > /** > * Returns the height of the specified font, measured in pixels. >- * >+ * > * @param font the font for which the result is valid > * @return the height of the font > */ >@@ -195,11 +207,11 @@ > } > return TextSizeDetermination.getCharHeight( font ); > } >- >+ > /** > * Returns the average character width of the specified font, measured in > * pixels. >- * >+ * > * @param font the font for which the result is valid > * @return the average character width of the font > */ >Index: src/org/eclipse/rwt/lifecycle/ControlLCAUtil.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.rwt/src/org/eclipse/rwt/lifecycle/ControlLCAUtil.java,v >retrieving revision 1.15 >diff -u -r1.15 ControlLCAUtil.java >--- src/org/eclipse/rwt/lifecycle/ControlLCAUtil.java 12 Jun 2008 13:12:18 -0000 1.15 >+++ src/org/eclipse/rwt/lifecycle/ControlLCAUtil.java 29 Aug 2008 10:07:07 -0000 >@@ -51,7 +51,7 @@ > = new JSListenerInfo( "focusout", > "org.eclipse.swt.EventUtil.focusLost", > JSListenerType.ACTION ); >- >+ > private static final JSListenerInfo MOUSE_DOWN_LISTENER_INFO > = new JSListenerInfo( "mousedown", > "org.eclipse.swt.EventUtil.mouseDown", >@@ -124,6 +124,7 @@ > controlAdapter.getBackgroundTransparency() ); > preserveBackgroundImage( control ); > WidgetLCAUtil.preserveFont( control, controlAdapter.getUserFont() ); >+ adapter.preserve( Props.CURSOR, control.getCursor() ); > adapter.preserve( Props.CONTROL_LISTENERS, > Boolean.valueOf( ControlEvent.hasListener( control ) ) ); > adapter.preserve( PROP_ACTIVATE_LISTENER, >@@ -310,6 +311,7 @@ > writeBackground( control ); > writeBackgroundImage( control ); > writeFont( control ); >+ writeCursor( control ); > // TODO [rst] missing: writeControlListener( control ); > writeActivateListener( control ); > writeFocusListener( control ); >@@ -634,6 +636,49 @@ > WidgetLCAUtil.resetFont(); > } > >+ /** >+ * Determines whether the property <code>cursor</code> of the given control >+ * has changed during the processing of the current request and if so, writes >+ * JavaScript code to the response that updates the client-side cursor property. >+ * >+ * @param control the control whose font property to write >+ * @throws IOException >+ */ >+ public static void writeCursor( final Control control ) throws IOException { >+ Cursor newValue = control.getCursor(); >+ if( WidgetLCAUtil.hasChanged( control, Props.CURSOR, newValue, null ) ) { >+ String qxCursor = null; >+ if( newValue != null ) { >+ int hashCode = newValue.hashCode(); >+ if( hashCode >= 0 && hashCode < JSConst.QX_CURSOR_VALUES.length ) { >+ qxCursor = JSConst.QX_CURSOR_VALUES[ hashCode ]; >+ if( "null".equals( qxCursor ) ) { >+ qxCursor = null; >+ } >+ } >+ } >+ JSWriter writer = JSWriter.getWriterFor( control ); >+ if( qxCursor == null ) { >+ writer.reset( JSConst.QX_FIELD_CURSOR ); >+ } else { >+ writer.set( JSConst.QX_FIELD_CURSOR, qxCursor ); >+ } >+ } >+ } >+ >+ /** >+ * Writes JavaScript code to the response that resets the property >+ * <code>cursor</code> of a control. This method is intended to be used by >+ * implementations of the method >+ * {@link AbstractWidgetLCA#createResetHandlerCalls(String)}. >+ * >+ * @throws IOException >+ */ >+ public static void resetCursor() throws IOException { >+ JSWriter writer = JSWriter.getWriterForResetHandler(); >+ writer.reset( JSConst.QX_FIELD_CURSOR ); >+ } >+ > public static void writeActivateListener( final Control control ) > throws IOException > { >@@ -697,9 +742,9 @@ > writer.removeListener( FOCUS_LOST_LISTENER_INFO.getEventType(), > FOCUS_LOST_LISTENER_INFO.getJSListener() ); > } >- >- private static void writeMouseListener( final Control control ) >- throws IOException >+ >+ private static void writeMouseListener( final Control control ) >+ throws IOException > { > boolean hasListener = MouseEvent.hasListener( control ); > JSWriter writer = JSWriter.getWriterFor( control ); >@@ -863,17 +908,17 @@ > true, > SWT.NONE ); > } >- >+ > public static void processMouseEvents( final Control control ) { > if( WidgetLCAUtil.wasEventSent( control, JSConst.EVENT_MOUSE_DOWN ) ) { > MouseEvent event = new MouseEvent( control, MouseEvent.MOUSE_DOWN ); > event.button > = readIntParam( control, JSConst.EVENT_MOUSE_DOWN_BUTTON ); > Point point = readXYParams( control, >- JSConst.EVENT_MOUSE_DOWN_X, >+ JSConst.EVENT_MOUSE_DOWN_X, > JSConst.EVENT_MOUSE_DOWN_Y ); >- event.x = point.x; >- event.y = point.y; >+ event.x = point.x; >+ event.y = point.y; > event.processEvent(); > } > String eventId = JSConst.EVENT_MOUSE_DOUBLE_CLICK; >@@ -882,36 +927,36 @@ > = new MouseEvent( control, MouseEvent.MOUSE_DOUBLE_CLICK ); > event.button > = readIntParam( control, JSConst.EVENT_MOUSE_DOUBLE_CLICK_BUTTON ); >- Point point = readXYParams( control, >- JSConst.EVENT_MOUSE_DOUBLE_CLICK_X, >+ Point point = readXYParams( control, >+ JSConst.EVENT_MOUSE_DOUBLE_CLICK_X, > JSConst.EVENT_MOUSE_DOUBLE_CLICK_Y ); >- event.x = point.x; >- event.y = point.y; >+ event.x = point.x; >+ event.y = point.y; > event.processEvent(); > } > if( WidgetLCAUtil.wasEventSent( control, JSConst.EVENT_MOUSE_UP ) ) { > MouseEvent event = new MouseEvent( control, MouseEvent.MOUSE_UP ); > event.button = readIntParam( control, JSConst.EVENT_MOUSE_UP_BUTTON ); > Point point = readXYParams( control, >- JSConst.EVENT_MOUSE_UP_X, >+ JSConst.EVENT_MOUSE_UP_X, > JSConst.EVENT_MOUSE_UP_Y ); >- event.x = point.x; >- event.y = point.y; >+ event.x = point.x; >+ event.y = point.y; > event.processEvent(); > } > } > >- private static int readIntParam( final Control control, >- final String paramName ) >+ private static int readIntParam( final Control control, >+ final String paramName ) > { > HttpServletRequest request = ContextProvider.getRequest(); > String value = request.getParameter( paramName ); > return Integer.parseInt( value ); > } > >- private static Point readXYParams( final Control control, >+ private static Point readXYParams( final Control control, > final String paramNameX, >- final String paramNameY ) >+ final String paramNameY ) > { > int x = readIntParam( control, paramNameX ); > int y = readIntParam( control, paramNameY ); >Index: src/org/eclipse/swt/internal/graphics/ResourceFactory.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.rwt/src/org/eclipse/swt/internal/graphics/ResourceFactory.java,v >retrieving revision 1.12 >diff -u -r1.12 ResourceFactory.java >--- src/org/eclipse/swt/internal/graphics/ResourceFactory.java 12 Jun 2008 13:12:19 -0000 1.12 >+++ src/org/eclipse/swt/internal/graphics/ResourceFactory.java 29 Aug 2008 10:07:08 -0000 >@@ -30,6 +30,7 @@ > private final static Map colors = new HashMap(); > private static final Map fonts = new HashMap(); > private static final Map images = new HashMap(); >+ private static final Map cursors = new HashMap(); > private static final ImageDataCache imageDataCache = new ImageDataCache(); > > ///////// >@@ -218,6 +219,22 @@ > return result; > } > >+ //////// >+ // Cursors >+ >+ public static Cursor getCursor( final int style ) { >+ Cursor result; >+ Integer key = new Integer( style ); >+ synchronized( Cursor.class ) { >+ result = ( Cursor )cursors.get( key ); >+ if( result == null ) { >+ result = createCursorInstance( style ); >+ cursors.put( key, result ); >+ } >+ } >+ return result; >+ } >+ > /////////////// > // Test helpers > >@@ -225,6 +242,7 @@ > colors.clear(); > fonts.clear(); > images.clear(); >+ cursors.clear(); > } > > static int colorsCount() { >@@ -239,6 +257,10 @@ > return images.size(); > } > >+ static int cursorsCount() { >+ return cursors.size(); >+ } >+ > > ////////////////// > // Helping methods >@@ -447,7 +469,7 @@ > Class[] paramList = new Class[] { int.class, int.class }; > Constructor constr = fontClass.getDeclaredConstructor( paramList ); > constr.setAccessible( true ); >- result = ( Image )constr.newInstance( new Object[]{ >+ result = ( Image )constr.newInstance( new Object[] { > new Integer( width ), new Integer( height ) > } ); > } catch( final Exception e ) { >@@ -456,6 +478,22 @@ > return result; > } > >+ private static Cursor createCursorInstance( final int style ) { >+ Cursor result = null; >+ try { >+ Class cursorClass = Cursor.class; >+ Class[] paramList = new Class[] { int.class }; >+ Constructor constr = cursorClass.getDeclaredConstructor( paramList ); >+ constr.setAccessible( true ); >+ result = ( Cursor )constr.newInstance( new Object[] { >+ new Integer( style ) >+ } ); >+ } catch( final Exception e ) { >+ throw new RuntimeException( "Failed to instantiate Cursor", e ); >+ } >+ return result; >+ } >+ > private ResourceFactory() { > // prevent instantiation > } >Index: src/org/eclipse/rwt/internal/lifecycle/JSConst.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/lifecycle/JSConst.java,v >retrieving revision 1.6 >diff -u -r1.6 JSConst.java >--- src/org/eclipse/rwt/internal/lifecycle/JSConst.java 12 Jun 2008 13:12:18 -0000 1.6 >+++ src/org/eclipse/rwt/internal/lifecycle/JSConst.java 29 Aug 2008 10:07:06 -0000 >@@ -145,6 +145,34 @@ > public static final String QX_FIELD_APPEARANCE = "appearance"; > public static final String QX_FIELD_Z_INDEX = "zIndex"; > public static final String QX_FIELD_TAB_INDEX = "tabIndex"; >+ public static final String QX_FIELD_CURSOR = "cursor"; >+ >+ // cursor values >+ // the order in the array correspond to the SWT#CURSOR_xxxx constants >+ public static final String[] QX_CURSOR_VALUES = { >+ "default", >+ "wait", >+ "crosshair", >+ "null", // SWT#CURSOR_APPSTARTING not exist in qx >+ "help", >+ "move", >+ "ne-resize", >+ "n-resize", >+ "nw-resize", >+ "w-resize", >+ "n-resize", >+ "s-resize", >+ "e-resize", >+ "w-resize", >+ "ne-resize", >+ "se-resize", >+ "sw-resize", >+ "nw-resize", >+ "null", // SWT#CURSOR_UPARROW not exist in qx >+ "text", >+ "null", // SWT#CURSOR_NO not exist in qx >+ "pointer" >+ }; > > // constants > public static final JSVar QX_CONST_VERTICAL_ORIENTATION >Index: src/org/eclipse/swt/widgets/Control.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Control.java,v >retrieving revision 1.40 >diff -u -r1.40 Control.java >--- src/org/eclipse/swt/widgets/Control.java 26 Aug 2008 14:16:32 -0000 1.40 >+++ src/org/eclipse/swt/widgets/Control.java 29 Aug 2008 10:07:10 -0000 >@@ -96,6 +96,7 @@ > private Image backgroundImage = null; > private boolean backgroundTransparency; > private Font font; >+ private Cursor cursor; > > Control( final Composite parent ) { > // prevent instantiation from outside this package; only called by Shell >@@ -584,6 +585,56 @@ > return result; > } > >+ ///////// >+ // Cursors >+ >+ /** >+ * Sets the receiver's cursor to the cursor specified by the >+ * argument, or to the default cursor for that kind of control >+ * if the argument is null. >+ * <p> >+ * When the mouse pointer passes over a control its appearance >+ * is changed to match the control's cursor. >+ * </p> >+ * >+ * @param cursor the new cursor (or null) >+ * >+ * @exception IllegalArgumentException <ul> >+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> >+ * </ul> >+ * @exception SWTException <ul> >+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> >+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> >+ * </ul> >+ * >+ * @since 1.1.1 >+ */ >+ public void setCursor (final Cursor cursor) { >+ checkWidget (); >+ this.cursor = cursor; >+ } >+ >+ /** >+ * Returns the receiver's cursor, or null if it has not been set. >+ * <p> >+ * When the mouse pointer passes over a control its appearance >+ * is changed to match the control's cursor. >+ * </p> >+ * >+ * @return the receiver's cursor or <code>null</code> >+ * >+ * @exception SWTException <ul> >+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> >+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> >+ * </ul> >+ * >+ * @since 1.1.1 >+ */ >+ public Cursor getCursor () { >+ checkWidget (); >+ return cursor; >+ } >+ > ////////////////// > // Focus handling > >Index: src/org/eclipse/swt/SWT.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.rwt/src/org/eclipse/swt/SWT.java,v >retrieving revision 1.31 >diff -u -r1.31 SWT.java >--- src/org/eclipse/swt/SWT.java 22 Aug 2008 13:19:36 -0000 1.31 >+++ src/org/eclipse/swt/SWT.java 29 Aug 2008 10:07:08 -0000 >@@ -971,6 +971,141 @@ > */ > public static final int ITALIC = 1 << 1; > >+ // Cursor style constants >+ >+ /** >+ * System arrow cursor (value is 0). >+ * >+ * @see Graphics#getCursor(int) >+ */ >+ public static final int CURSOR_ARROW = 0; >+ >+ /** >+ * System wait cursor (value is 1). >+ * >+ * @see Graphics#getCursor(int) >+ */ >+ public static final int CURSOR_WAIT = 1; >+ >+ /** >+ * System cross hair cursor (value is 2). >+ * >+ * @see Graphics#getCursor(int) >+ */ >+ public static final int CURSOR_CROSS = 2; >+ >+ /** >+ * System help cursor (value is 4). >+ * >+ * @see Graphics#getCursor(int) >+ */ >+ public static final int CURSOR_HELP = 4; >+ >+ /** >+ * System resize all directions cursor (value is 5). >+ * >+ * @see Graphics#getCursor(int) >+ */ >+ public static final int CURSOR_SIZEALL = 5; >+ >+ /** >+ * System resize north-east-south-west cursor (value is 6). >+ * >+ * @see Graphics#getCursor(int) >+ */ >+ public static final int CURSOR_SIZENESW = 6; >+ >+ /** >+ * System resize north-south cursor (value is 7). >+ * >+ * @see Graphics#getCursor(int) >+ */ >+ public static final int CURSOR_SIZENS = 7; >+ >+ /** >+ * System resize north-west-south-east cursor (value is 8). >+ * >+ * @see Graphics#getCursor(int) >+ */ >+ public static final int CURSOR_SIZENWSE = 8; >+ >+ /** >+ * System resize west-east cursor (value is 9). >+ * >+ * @see Graphics#getCursor(int) >+ */ >+ public static final int CURSOR_SIZEWE = 9; >+ >+ /** >+ * System resize north cursor (value is 10). >+ * >+ * @see Graphics#getCursor(int) >+ */ >+ public static final int CURSOR_SIZEN = 10; >+ >+ /** >+ * System resize south cursor (value is 11). >+ * >+ * @see Graphics#getCursor(int) >+ */ >+ public static final int CURSOR_SIZES = 11; >+ >+ /** >+ * System resize east cursor (value is 12). >+ * >+ * @see Graphics#getCursor(int) >+ */ >+ public static final int CURSOR_SIZEE = 12; >+ >+ /** >+ * System resize west cursor (value is 13). >+ * >+ * @see Graphics#getCursor(int) >+ */ >+ public static final int CURSOR_SIZEW = 13; >+ >+ /** >+ * System resize north-east cursor (value is 14). >+ * >+ * @see Graphics#getCursor(int) >+ */ >+ public static final int CURSOR_SIZENE = 14; >+ >+ /** >+ * System resize south-east cursor (value is 15). >+ * >+ * @see Graphics#getCursor(int) >+ */ >+ public static final int CURSOR_SIZESE = 15; >+ >+ /** >+ * System resize south-west cursor (value is 16). >+ * >+ * @see Graphics#getCursor(int) >+ */ >+ public static final int CURSOR_SIZESW = 16; >+ >+ /** >+ * System resize north-west cursor (value is 17). >+ * >+ * @see Graphics#getCursor(int) >+ */ >+ public static final int CURSOR_SIZENW = 17; >+ >+ /** >+ * System i-beam cursor (value is 19). >+ * >+ * @see Graphics#getCursor(int) >+ */ >+ public static final int CURSOR_IBEAM = 19; >+ >+ /** >+ * System hand cursor (value is 21). >+ * >+ * @see Graphics#getCursor(int) >+ */ >+ public static final int CURSOR_HAND = 21; >+ > // Predefined images > > /** >Index: src/org/eclipse/swt/graphics/Cursor.java >=================================================================== >RCS file: src/org/eclipse/swt/graphics/Cursor.java >diff -N src/org/eclipse/swt/graphics/Cursor.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/swt/graphics/Cursor.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,211 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 Innoopract Informationssysteme GmbH. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Innoopract Informationssysteme GmbH - initial API and implementation >+ ******************************************************************************/ >+package org.eclipse.swt.graphics; >+ >+import org.eclipse.rwt.graphics.Graphics; >+import org.eclipse.swt.SWT; >+ >+/** >+ * Instances of this class manage operating system resources that >+ * specify the appearance of the on-screen pointer. >+ * >+ * <p>Cursors may be constructed using one of the <code>getCursor</code> methods >+ * in class <code>Graphics</code> by providing a style information. >+ * </p> >+ * <dl> >+ * <dt><b>Styles:</b></dt> >+ * <dd> >+ * CURSOR_ARROW, CURSOR_WAIT, CURSOR_CROSS, CURSOR_HELP, >+ * CURSOR_SIZEALL, CURSOR_SIZENESW, CURSOR_SIZENS, CURSOR_SIZENWSE, CURSOR_SIZEWE, >+ * CURSOR_SIZEN, CURSOR_SIZES, CURSOR_SIZEE, CURSOR_SIZEW, CURSOR_SIZENE, CURSOR_SIZESE, >+ * CURSOR_SIZESW, CURSOR_SIZENW, CURSOR_IBEAM, CURSOR_HAND >+ * </dd> >+ * </dl> >+ * <p> >+ * Note: Only one of the above styles may be specified. >+ * </p> >+ * >+ * @see Graphics >+ * >+ * @since 1.1.1 >+ */ >+ >+public final class Cursor extends Resource { >+ >+ /** >+ * the handle to the cursor resource >+ */ >+ int handle; >+ >+ //prevent instance creation >+ private Cursor( final int style ) { >+ switch( style ) { >+ case SWT.CURSOR_HAND: >+ handle = SWT.CURSOR_HAND; >+ break; >+ case SWT.CURSOR_ARROW: >+ handle = SWT.CURSOR_ARROW; >+ break; >+ case SWT.CURSOR_WAIT: >+ handle = SWT.CURSOR_WAIT; >+ break; >+ case SWT.CURSOR_CROSS: >+ handle = SWT.CURSOR_CROSS; >+ break; >+// case SWT.CURSOR_APPSTARTING: >+// handle = SWT.CURSOR_APPSTARTING; >+// break; >+ case SWT.CURSOR_HELP: >+ handle = SWT.CURSOR_HELP; >+ break; >+ case SWT.CURSOR_SIZEALL: >+ handle = SWT.CURSOR_SIZEALL; >+ break; >+ case SWT.CURSOR_SIZENESW: >+ handle = SWT.CURSOR_SIZENESW; >+ break; >+ case SWT.CURSOR_SIZENS: >+ handle = SWT.CURSOR_SIZENS; >+ break; >+ case SWT.CURSOR_SIZENWSE: >+ handle = SWT.CURSOR_SIZENWSE; >+ break; >+ case SWT.CURSOR_SIZEWE: >+ handle = SWT.CURSOR_SIZEWE; >+ break; >+ case SWT.CURSOR_SIZEN: >+ handle = SWT.CURSOR_SIZEN; >+ break; >+ case SWT.CURSOR_SIZES: >+ handle = SWT.CURSOR_SIZES; >+ break; >+ case SWT.CURSOR_SIZEE: >+ handle = SWT.CURSOR_SIZEE; >+ break; >+ case SWT.CURSOR_SIZEW: >+ handle = SWT.CURSOR_SIZEW; >+ break; >+ case SWT.CURSOR_SIZENE: >+ handle = SWT.CURSOR_SIZENE; >+ break; >+ case SWT.CURSOR_SIZESE: >+ handle = SWT.CURSOR_SIZESE; >+ break; >+ case SWT.CURSOR_SIZESW: >+ handle = SWT.CURSOR_SIZESW; >+ break; >+ case SWT.CURSOR_SIZENW: >+ handle = SWT.CURSOR_SIZENW; >+ break; >+// case SWT.CURSOR_UPARROW: >+// handle = SWT.CURSOR_UPARROW; >+// break; >+ case SWT.CURSOR_IBEAM: >+ handle = SWT.CURSOR_IBEAM; >+ break; >+// case SWT.CURSOR_NO: >+// handle = SWT.CURSOR_NO; >+// break; >+ default: >+ SWT.error( SWT.ERROR_INVALID_ARGUMENT ); >+ } >+ } >+ >+ /** >+ * Returns an integer hash code for the receiver. >+ * >+ * @return the receiver's hash >+ */ >+ public int hashCode () { >+ return handle; >+ } >+ >+ /** >+ * Returns a string containing a concise, human-readable >+ * description of the receiver. >+ * >+ * @return a string representation of the receiver >+ */ >+ public String toString () { >+ String type; >+ switch( handle ) { >+ case SWT.CURSOR_HAND: >+ type = "SWT.CURSOR_HAND"; >+ break; >+ case SWT.CURSOR_ARROW: >+ type = "SWT.CURSOR_ARROW"; >+ break; >+ case SWT.CURSOR_WAIT: >+ type = "SWT.CURSOR_WAIT"; >+ break; >+ case SWT.CURSOR_CROSS: >+ type = "SWT.CURSOR_CROSS"; >+ break; >+// case SWT.CURSOR_APPSTARTING: >+// type = "SWT.CURSOR_APPSTARTING"; >+// break; >+ case SWT.CURSOR_HELP: >+ type = "SWT.CURSOR_HELP"; >+ break; >+ case SWT.CURSOR_SIZEALL: >+ type = "SWT.CURSOR_SIZEALL"; >+ break; >+ case SWT.CURSOR_SIZENESW: >+ type = "SWT.CURSOR_SIZENESW"; >+ break; >+ case SWT.CURSOR_SIZENS: >+ type = "SWT.CURSOR_SIZENS"; >+ break; >+ case SWT.CURSOR_SIZENWSE: >+ type = "SWT.CURSOR_SIZENWSE"; >+ break; >+ case SWT.CURSOR_SIZEWE: >+ type = "SWT.CURSOR_SIZEWE"; >+ break; >+ case SWT.CURSOR_SIZEN: >+ type = "SWT.CURSOR_SIZEN"; >+ break; >+ case SWT.CURSOR_SIZES: >+ type = "SWT.CURSOR_SIZES"; >+ break; >+ case SWT.CURSOR_SIZEE: >+ type = "SWT.CURSOR_SIZEE"; >+ break; >+ case SWT.CURSOR_SIZEW: >+ type = "SWT.CURSOR_SIZEW"; >+ break; >+ case SWT.CURSOR_SIZENE: >+ type = "SWT.CURSOR_SIZENE"; >+ break; >+ case SWT.CURSOR_SIZESE: >+ type = "SWT.CURSOR_SIZESE"; >+ break; >+ case SWT.CURSOR_SIZESW: >+ type = "SWT.CURSOR_SIZESW"; >+ break; >+ case SWT.CURSOR_SIZENW: >+ type = "SWT.CURSOR_SIZENW"; >+ break; >+// case SWT.CURSOR_UPARROW: >+// type = "SWT.CURSOR_UPARROW"; >+// break; >+ case SWT.CURSOR_IBEAM: >+ type = "SWT.CURSOR_IBEAM"; >+ break; >+// case SWT.CURSOR_NO: >+// type = "SWT.CURSOR_NO"; >+// break; >+ default: >+ type = "" + handle; >+ } >+ return "Cursor {" + type + "}"; >+ } >+}
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 244004
:
110937
|
110938
|
110939
|
110940
| 111283 |
111284
|
111285