Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: editor/tools/plugins/com.xored.glance.ui/src/com/xored/glance/internal/ui/panels/SearchPanelManager.java

Issue 17431004: New UI for Find command: find-as-you-type. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.xored.glance.ui/src/com/xored/glance/internal/ui/panels/SearchPanelManager.java
===================================================================
--- editor/tools/plugins/com.xored.glance.ui/src/com/xored/glance/internal/ui/panels/SearchPanelManager.java (revision 0)
+++ editor/tools/plugins/com.xored.glance.ui/src/com/xored/glance/internal/ui/panels/SearchPanelManager.java (revision 0)
@@ -0,0 +1,46 @@
+/**
+ *
+ */
+package com.xored.glance.internal.ui.panels;
+
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbenchWindow;
+
+import com.xored.glance.internal.ui.GlancePlugin;
+import com.xored.glance.internal.ui.preferences.IPreferenceConstants;
+import com.xored.glance.ui.panels.ISearchPanel;
+
+/**
+ * @author Yuri Strot
+ */
+public class SearchPanelManager {
+
+ public static SearchPanelManager getInstance() {
+ if (instance == null)
+ instance = new SearchPanelManager();
+ return instance;
+ }
+
+ public ISearchPanel getPanel(Control control) {
+ if (showStatusLine()) {
+ IWorkbenchWindow window = SearchStatusLine.getWindow(control);
+ if (window != null) {
+ return SearchStatusLine.getSearchLine(window);
+ }
+ }
+ PopupSearchDialog dialog = new PopupSearchDialog(control);
+ dialog.open();
+ return dialog;
+ }
+
+ private boolean showStatusLine() {
+ return GlancePlugin.getDefault().getPreferenceStore().getBoolean(
+ IPreferenceConstants.PANEL_STATUS_LINE);
+ }
+
+ private static SearchPanelManager instance;
+
+ private SearchPanelManager() {
+ }
+
+}

Powered by Google App Engine
This is Rietveld 408576698