From: em.lee Date: Mon, 11 Jan 2010 15:19:15 +0000 (+0000) Subject: #1154 done. X-Git-Tag: rcp.ss-first-working-version~430 X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/35a229414858661e89ad4dd630799bc2ecf23f95 #1154 done. --- diff --git a/taxeditor-bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditor.java b/taxeditor-bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditor.java index 3474ea769..2800682cd 100644 --- a/taxeditor-bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditor.java +++ b/taxeditor-bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditor.java @@ -40,6 +40,7 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IEditorSite; import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; import org.eclipse.ui.texteditor.IDocumentProvider; import org.eclipse.ui.views.properties.IPropertySheetEntry; import org.eclipse.ui.views.properties.IPropertySheetPage; @@ -52,6 +53,7 @@ import eu.etaxonomy.taxeditor.annotatedlineeditor.AnnotatedLineEditor; import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation; import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotationModel; import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInput; +import eu.etaxonomy.taxeditor.editor.EditorUtil; import eu.etaxonomy.taxeditor.preference.PreferencesUtil; import eu.etaxonomy.taxeditor.store.CdmStore; import eu.etaxonomy.taxeditor.store.VocabularyStore; @@ -67,7 +69,9 @@ public class BulkEditor extends AnnotatedLineEditor implements PropertyChangeLis public static final String ID = "bulkeditor.editor"; private boolean isInitialFocus = true; - + + private BulkEditorSearchComposite searchBar = null; + private IPropertyChangeListener markerPreferenceListener; /** @@ -135,7 +139,7 @@ public class BulkEditor extends AnnotatedLineEditor implements PropertyChangeLis GridLayout gridLayout = new GridLayout(); parent.setLayout(gridLayout); - BulkEditorSearchComposite searchBar = new BulkEditorSearchComposite(this, parent, SWT.NONE); + searchBar = new BulkEditorSearchComposite(this, parent, SWT.NONE); searchBar.getParent().setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); if (isEditableMarkerTypes()) { @@ -227,7 +231,10 @@ public class BulkEditor extends AnnotatedLineEditor implements PropertyChangeLis */ @Override public void setFocus() { - super.setFocus(); +// super.setFocus(); + + // TODO Since setFocus() is called by RCP, can a global variable (searchBar) be avoided? + setFocusOnToolBar(); // TODO find a better place to put this - this dialog should be shown after initial contents of // Editor are displayed @@ -236,6 +243,15 @@ public class BulkEditor extends AnnotatedLineEditor implements PropertyChangeLis isInitialFocus = false; } } + + /** + * Sets focus on the toolbar. + */ + private void setFocusOnToolBar() { + if (searchBar != null) { + searchBar.setFocus(); + } + } /** *