4444import org .eclipse .swt .widgets .Scrollable ;
4545import org .eclipse .swt .widgets .Shell ;
4646import org .eclipse .swt .widgets .Text ;
47- import org .eclipse .swt .widgets .ToolBar ;
4847import org .eclipse .swt .widgets .ToolItem ;
4948import org .eclipse .swt .widgets .Widget ;
5049
@@ -91,7 +90,7 @@ class FindReplaceOverlay extends Dialog {
9190 private Composite searchContainer ;
9291 private Composite searchBarContainer ;
9392 private Text searchBar ;
94- private ToolBar searchTools ;
93+ private AccessibleToolBar searchTools ;
9594
9695 private ToolItem searchInSelectionButton ;
9796 private ToolItem wholeWordSearchButton ;
@@ -104,7 +103,7 @@ class FindReplaceOverlay extends Dialog {
104103 private Composite replaceContainer ;
105104 private Composite replaceBarContainer ;
106105 private Text replaceBar ;
107- private ToolBar replaceTools ;
106+ private AccessibleToolBar replaceTools ;
108107 private ToolItem replaceButton ;
109108 private ToolItem replaceAllButton ;
110109
@@ -193,6 +192,7 @@ private void performSearchOnEnter(boolean isShiftPressed) {
193192 @ Override
194193 public void keyPressed (KeyEvent e ) {
195194 e .doit = false ;
195+ System .out .println (e .keyCode );
196196 if ((e .stateMask & SWT .CTRL ) != 0 && (e .keyCode == 'F' || e .keyCode == 'f' )) {
197197 close ();
198198 } else if ((e .stateMask & SWT .CTRL ) != 0 && (e .keyCode == 'R' || e .keyCode == 'r' )) {
@@ -450,7 +450,7 @@ private void retrieveBackgroundColor() {
450450 }
451451
452452 private void createSearchTools () {
453- searchTools = new ToolBar (searchContainer , SWT . HORIZONTAL );
453+ searchTools = new AccessibleToolBar (searchContainer );
454454 GridDataFactory .fillDefaults ().grab (false , true ).align (GridData .CENTER , GridData .END ).applyTo (searchTools );
455455
456456 createWholeWordsButton ();
@@ -459,9 +459,9 @@ private void createSearchTools() {
459459 createAreaSearchButton ();
460460
461461 @ SuppressWarnings ("unused" )
462- ToolItem separator = new ToolItem ( searchTools , SWT .SEPARATOR );
462+ ToolItem separator = searchTools . createToolItem ( SWT .SEPARATOR );
463463
464- searchUpButton = new ToolItem ( searchTools , SWT .PUSH );
464+ searchUpButton = searchTools . createToolItem ( SWT .PUSH );
465465 searchUpButton .setImage (FindReplaceOverlayImages .get (FindReplaceOverlayImages .OBJ_FIND_PREV ));
466466 searchUpButton .setToolTipText (FindReplaceMessages .FindReplaceOverlay_upSearchButton_toolTip );
467467 searchUpButton .addSelectionListener (new SelectionListener () {
@@ -476,7 +476,7 @@ public void widgetDefaultSelected(SelectionEvent e) {
476476 // Do Nothing
477477 }
478478 });
479- searchDownButton = new ToolItem ( searchTools , SWT .PUSH );
479+ searchDownButton = searchTools . createToolItem ( SWT .PUSH );
480480 searchDownButton .setSelection (true ); // by default, search down
481481 searchDownButton .setImage (FindReplaceOverlayImages .get (FindReplaceOverlayImages .OBJ_FIND_NEXT ));
482482 searchDownButton .setToolTipText (FindReplaceMessages .FindReplaceOverlay_downSearchButton_toolTip );
@@ -493,7 +493,7 @@ public void widgetDefaultSelected(SelectionEvent e) {
493493 // Do nothing
494494 }
495495 });
496- searchAllButton = new ToolItem ( searchTools , SWT .PUSH );
496+ searchAllButton = searchTools . createToolItem ( SWT .PUSH );
497497 searchAllButton .setImage (FindReplaceOverlayImages .get (FindReplaceOverlayImages .OBJ_SEARCH_ALL ));
498498 searchAllButton .setToolTipText (FindReplaceMessages .FindReplaceOverlay_searchAllButton_toolTip );
499499 searchAllButton .addSelectionListener (new SelectionListener () {
@@ -513,7 +513,7 @@ public void widgetDefaultSelected(SelectionEvent e) {
513513 }
514514
515515 private void createAreaSearchButton () {
516- searchInSelectionButton = new ToolItem ( searchTools , SWT .CHECK );
516+ searchInSelectionButton = searchTools . createToolItem ( SWT .CHECK );
517517 searchInSelectionButton .setImage (FindReplaceOverlayImages .get (FindReplaceOverlayImages .OBJ_SEARCH_IN_AREA ));
518518 searchInSelectionButton .setToolTipText (FindReplaceMessages .FindReplaceOverlay_searchInSelectionButton_toolTip );
519519 searchInSelectionButton .setSelection (findReplaceLogic .isActive (SearchOptions .WHOLE_WORD ));
@@ -533,7 +533,7 @@ public void widgetDefaultSelected(SelectionEvent e) {
533533 }
534534
535535 private void createRegexSearchButton () {
536- regexSearchButton = new ToolItem ( searchTools , SWT .CHECK );
536+ regexSearchButton = searchTools . createToolItem ( SWT .CHECK );
537537 regexSearchButton .setImage (FindReplaceOverlayImages .get (FindReplaceOverlayImages .OBJ_FIND_REGEX ));
538538 regexSearchButton .setToolTipText (FindReplaceMessages .FindReplaceOverlay_regexSearchButton_toolTip );
539539 regexSearchButton .setSelection (findReplaceLogic .isActive (SearchOptions .REGEX ));
@@ -554,7 +554,7 @@ public void widgetDefaultSelected(SelectionEvent e) {
554554 }
555555
556556 private void createCaseSensitiveButton () {
557- caseSensitiveSearchButton = new ToolItem ( searchTools , SWT .CHECK );
557+ caseSensitiveSearchButton = searchTools . createToolItem ( SWT .CHECK );
558558 caseSensitiveSearchButton .setImage (FindReplaceOverlayImages .get (FindReplaceOverlayImages .OBJ_CASE_SENSITIVE ));
559559 caseSensitiveSearchButton .setToolTipText (FindReplaceMessages .FindReplaceOverlay_caseSensitiveButton_toolTip );
560560 caseSensitiveSearchButton .setSelection (findReplaceLogic .isActive (SearchOptions .CASE_SENSITIVE ));
@@ -574,7 +574,7 @@ public void widgetDefaultSelected(SelectionEvent e) {
574574 }
575575
576576 private void createWholeWordsButton () {
577- wholeWordSearchButton = new ToolItem ( searchTools , SWT .CHECK );
577+ wholeWordSearchButton = searchTools . createToolItem ( SWT .CHECK );
578578 wholeWordSearchButton .setImage (FindReplaceOverlayImages .get (FindReplaceOverlayImages .OBJ_WHOLE_WORD ));
579579 wholeWordSearchButton .setToolTipText (FindReplaceMessages .FindReplaceOverlay_wholeWordsButton_toolTip );
580580 wholeWordSearchButton .setSelection (findReplaceLogic .isActive (SearchOptions .WHOLE_WORD ));
@@ -596,9 +596,10 @@ public void widgetDefaultSelected(SelectionEvent e) {
596596 private void createReplaceTools () {
597597 Color warningColor = JFaceColors .getErrorText (getShell ().getDisplay ());
598598
599- replaceTools = new ToolBar (replaceContainer , SWT . HORIZONTAL );
599+ replaceTools = new AccessibleToolBar (replaceContainer );
600600 GridDataFactory .fillDefaults ().grab (false , true ).align (GridData .CENTER , GridData .END ).applyTo (replaceTools );
601- replaceButton = new ToolItem (replaceTools , SWT .PUSH );
601+
602+ replaceButton = replaceTools .createToolItem (SWT .PUSH );
602603 replaceButton .setImage (FindReplaceOverlayImages .get (FindReplaceOverlayImages .OBJ_REPLACE ));
603604 replaceButton .setToolTipText (FindReplaceMessages .FindReplaceOverlay_replaceButton_toolTip );
604605 replaceButton .addSelectionListener (new SelectionListener () {
@@ -617,7 +618,7 @@ public void widgetDefaultSelected(SelectionEvent e) {
617618 // Do nothing
618619 }
619620 });
620- replaceAllButton = new ToolItem ( replaceTools , SWT .PUSH );
621+ replaceAllButton = replaceTools . createToolItem ( SWT .PUSH );
621622 replaceAllButton .setImage (FindReplaceOverlayImages .get (FindReplaceOverlayImages .OBJ_REPLACE_ALL ));
622623 replaceAllButton .setToolTipText (FindReplaceMessages .FindReplaceOverlay_replaceAllButton_toolTip );
623624 replaceAllButton .addSelectionListener (new SelectionListener () {
0 commit comments