summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormianrui2012-11-05 04:42:57 (EST)
committermwu2012-11-05 04:42:57 (EST)
commit2e13149c934a484b93fd1b697e96db87525a66f5 (patch)
tree63d53311fd3f5afd5a37334664b11c60d8846692
parentcfbe47ca80e76dd6b3aa7e8239cb061c02a7d65d (diff)
downloadorg.eclipse.datatools.enablement.oda-2e13149c934a484b93fd1b697e96db87525a66f5.zip
org.eclipse.datatools.enablement.oda-2e13149c934a484b93fd1b697e96db87525a66f5.tar.gz
org.eclipse.datatools.enablement.oda-2e13149c934a484b93fd1b697e96db87525a66f5.tar.bz2
[BZ][accessibility]shortcut don't work in "define xml data source"v201211051742
window(T53997)
-rw-r--r--plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/i18n/messages.properties6
-rw-r--r--plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/wizards/MenuButton.java39
-rw-r--r--plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/control/MenuButton.java43
-rw-r--r--plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/i18n/messages.properties4
4 files changed, 57 insertions, 35 deletions
diff --git a/plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/i18n/messages.properties b/plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/i18n/messages.properties
index 873534f..6d8c460 100644
--- a/plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/i18n/messages.properties
+++ b/plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/i18n/messages.properties
@@ -33,9 +33,9 @@ label.flatfileTab=TSV
label.trailNull=Use trailing nu&ll columns.
button.selectFolder.browse=B&rowse...
-button.selectFileURI.browse=Browse...
-button.selectFileURI.menuItem.relativePath=Relative path
-button.selectFileURI.menuItem.absolutePath=Absolute path
+button.selectFileURI.browse=B&rowse...
+button.selectFileURI.menuItem.relativePath=&Relative path
+button.selectFileURI.menuItem.absolutePath=&Absolute path
button.selectFileURI.browse.tooltips=Select a local file URI.
button.moveUp=&Up
button.moveDown=Do&wn
diff --git a/plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/wizards/MenuButton.java b/plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/wizards/MenuButton.java
index 442bb56..77c2f8c 100644
--- a/plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/wizards/MenuButton.java
+++ b/plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/wizards/MenuButton.java
@@ -75,6 +75,7 @@ public class MenuButton extends Composite
public void setText( String text )
{
this.text = text;
+ this.button.setText( text );
layoutControl( );
}
@@ -267,12 +268,33 @@ public class MenuButton extends Composite
if ( listeners == null )
return;
- e.widget = MenuButton.this;
+ // separate the mouse click from the key press event on the button
+ boolean keyPress = false;
+ if ( e.widget instanceof Button )
+ {
+ if ( ( (Button) e.widget ).getParent( ) instanceof MenuButton )
+ {
+ if ( menu != null )
+ {
+ keyPress = true;
+ Rectangle size = button.getBounds( );
+ menu.setLocation( button.toDisplay( new Point( 0,
+ size.height - 1 ) ) );
+ menu.setVisible( true );
+ }
+ }
+ }
- for ( int i = 0; i < listeners.size( ); i++ )
+ if ( !keyPress )
{
- ( (SelectionListener) listeners.get( i ) ).widgetSelected( new SelectionEvent( e ) );
+ e.widget = MenuButton.this;
+
+ for ( int i = 0; i < listeners.size( ); i++ )
+ {
+ ( (SelectionListener) listeners.get( i ) ).widgetSelected( new SelectionEvent( e ) );
+ }
}
+
}
} );
@@ -429,17 +451,6 @@ public class MenuButton extends Composite
e.gc.setForeground( fgColor );
}
- if ( text != null && text.trim( ).length( ) > 0 )
- {
- int width = e.gc.textExtent( text, DRAW_FLAGS ).x;
- int fontHeight = e.gc.textExtent( text, DRAW_FLAGS ).y;
- left += ( MARGIN_GAP + width );
- e.gc.drawText( text,
- ( size.width - left ) / 2 + MARGIN_GAP,
- ( size.height - fontHeight ) / 2,
- DRAW_FLAGS | SWT.DRAW_TRANSPARENT );
- }
-
if ( image != null )
{
int imageWidth = image.getImageData( ).width;
diff --git a/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/control/MenuButton.java b/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/control/MenuButton.java
index d8d9e9b..b0e5f39 100644
--- a/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/control/MenuButton.java
+++ b/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/control/MenuButton.java
@@ -75,6 +75,7 @@ public class MenuButton extends Composite
public void setText( String text )
{
this.text = text;
+ this.button.setText( text );
layoutControl( );
}
@@ -267,12 +268,33 @@ public class MenuButton extends Composite
if ( listeners == null )
return;
- e.widget = MenuButton.this;
+ // separate the mouse click from the key press event on the button
+ boolean keyPress = false;
+ if( e.widget instanceof Button )
+ {
+ if( ((Button)e.widget).getParent() instanceof MenuButton )
+ {
+ if ( menu != null )
+ {
+ keyPress = true;
+ Rectangle size = button.getBounds( );
+ menu.setLocation( button.toDisplay( new Point( 0,
+ size.height - 1 ) ) );
+ menu.setVisible( true );
+ }
+ }
+ }
+
+ if( !keyPress )
+ {
+ e.widget = MenuButton.this;
+
+ for ( int i = 0; i < listeners.size( ); i++ )
+ {
+ ( (SelectionListener) listeners.get( i ) ).widgetSelected( new SelectionEvent( e ) );
+ }
+ }
- for ( int i = 0; i < listeners.size( ); i++ )
- {
- ( (SelectionListener) listeners.get( i ) ).widgetSelected( new SelectionEvent( e ) );
- }
}
} );
@@ -429,17 +451,6 @@ public class MenuButton extends Composite
e.gc.setForeground( fgColor );
}
- if ( text != null && text.trim( ).length( ) > 0 )
- {
- int width = e.gc.textExtent( text, DRAW_FLAGS ).x;
- int fontHeight = e.gc.textExtent( text, DRAW_FLAGS ).y;
- left += ( MARGIN_GAP + width );
- e.gc.drawText( text,
- ( size.width - left ) / 2 + MARGIN_GAP,
- ( size.height - fontHeight ) / 2,
- DRAW_FLAGS | SWT.DRAW_TRANSPARENT );
- }
-
if ( image != null )
{
int imageWidth = image.getImageData( ).width;
diff --git a/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/i18n/messages.properties b/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/i18n/messages.properties
index bcd2682..ad9dd00 100644
--- a/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/i18n/messages.properties
+++ b/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/i18n/messages.properties
@@ -123,8 +123,8 @@ dataset.new=New Data Set
file.choose=Br&owse...
schema.choose=Brow&se...
title.warning=Warning
-FileSelectionButton.menuItem.absolutePath=Absolute Path
-FileSelectionButton.menuItem.relativePath=Relative Path
+FileSelectionButton.menuItem.absolutePath=&Absolute Path
+FileSelectionButton.menuItem.relativePath=&Relative Path
SelectRelativeFileDialog.Title=Select a file
datasource.propertyPage.tooltip=XML Data Source