#1154 done.
authorem.lee <em.lee@localhost>
Mon, 11 Jan 2010 15:19:15 +0000 (15:19 +0000)
committerem.lee <em.lee@localhost>
Mon, 11 Jan 2010 15:19:15 +0000 (15:19 +0000)
taxeditor-bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditor.java

index 3474ea7693a73ba4ce65f1ce9eaf0f2efea74b24..2800682cd1ff8f7c0921e611684a1e713f828545 100644 (file)
@@ -40,6 +40,7 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.ui.IEditorInput;\r
 import org.eclipse.ui.IEditorSite;\r
 import org.eclipse.ui.PartInitException;\r
+import org.eclipse.ui.PlatformUI;\r
 import org.eclipse.ui.texteditor.IDocumentProvider;\r
 import org.eclipse.ui.views.properties.IPropertySheetEntry;\r
 import org.eclipse.ui.views.properties.IPropertySheetPage;\r
@@ -52,6 +53,7 @@ import eu.etaxonomy.taxeditor.annotatedlineeditor.AnnotatedLineEditor;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation;\r
 import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotationModel;\r
 import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInput;\r
+import eu.etaxonomy.taxeditor.editor.EditorUtil;\r
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 import eu.etaxonomy.taxeditor.store.VocabularyStore;\r
@@ -67,7 +69,9 @@ public class BulkEditor extends AnnotatedLineEditor implements PropertyChangeLis
        public static final String ID = "bulkeditor.editor";\r
 \r
        private boolean isInitialFocus = true;\r
-\r
+       \r
+       private BulkEditorSearchComposite searchBar = null;\r
+       \r
        private IPropertyChangeListener markerPreferenceListener;\r
        \r
        /**\r
@@ -135,7 +139,7 @@ public class BulkEditor extends AnnotatedLineEditor implements PropertyChangeLis
                GridLayout gridLayout = new GridLayout();\r
                parent.setLayout(gridLayout);\r
                \r
-               BulkEditorSearchComposite searchBar = new BulkEditorSearchComposite(this, parent, SWT.NONE);\r
+               searchBar = new BulkEditorSearchComposite(this, parent, SWT.NONE);\r
                searchBar.getParent().setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));\r
 \r
                if (isEditableMarkerTypes()) {\r
@@ -227,7 +231,10 @@ public class BulkEditor extends AnnotatedLineEditor implements PropertyChangeLis
         */\r
        @Override\r
        public void setFocus() {\r
-               super.setFocus();\r
+//             super.setFocus();\r
+               \r
+               // TODO Since setFocus() is called by RCP, can a global variable (searchBar) be avoided?\r
+               setFocusOnToolBar();\r
 \r
                // TODO find a better place to put this - this dialog should be shown after initial contents of \r
                //      Editor are displayed\r
@@ -236,6 +243,15 @@ public class BulkEditor extends AnnotatedLineEditor implements PropertyChangeLis
                        isInitialFocus = false;\r
                }\r
        }\r
+\r
+       /**\r
+        * Sets focus on the toolbar.\r
+        */\r
+       private void setFocusOnToolBar() {\r
+               if (searchBar != null) {\r
+                       searchBar.setFocus();\r
+               }\r
+       }\r
        \r
        /**\r
         * \r