/* $Id: SearchDialogManager.java 125 2011-03-09 09:49:51Z ohura $ */
package smart_gs.current_text_search;

import javax.swing.JFrame;

import smart_gs.swingui.toolbar.GSEditorToolBar;

public class SearchDialogManager {
	protected static CurrentSearchTextDialog currentSearchTextDialog;

	
	public static void setGSEditorToolBar(GSEditorToolBar gsEditorToolBar){
		if(currentSearchTextDialog == null){
			currentSearchTextDialog = new CurrentSearchTextDialog(new JFrame(),"Search Dialog");
			currentSearchTextDialog.setLocationRelativeTo(null);
		}
		currentSearchTextDialog.setGSEditorToolBar(gsEditorToolBar);
	}
	
	public static void visible(){
		if(currentSearchTextDialog != null){
			if(!currentSearchTextDialog.isVisible()){
				currentSearchTextDialog.setAlwaysOnTop(true);
				currentSearchTextDialog.setVisible(true);
			}
		}
	}
	
	public static GSEditorToolBar getGSEditorToolBar(){
		if(currentSearchTextDialog != null){
			return currentSearchTextDialog.getGSEditorToolBar();
		}
		return null;
	}
	
}
