<commit_before>package edu.ysu.onionuml.ui;

import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;

import edu.ysu.onionuml.core.UmlClassElement;
import edu.ysu.onionuml.core.UmlClassModel;
import edu.ysu.onionuml.core.UmlPackageElement;
import edu.ysu.onionuml.ui.graphics.graphicalmodels.ClassDiagramGraphicalModel;
import edu.ysu.onionuml.ui.graphics.editparts.ClassDiagramEditPart;


public class SearchDialog extends Window {
	private static final String SEARCH_BUTTON_TEXT = "Search";
	private static final String CLOSE_BUTTON_TEXT = "Close";
	
	private static final int PADDING = 10;
	private static final String TEXT_CLASSES_CONTROLLER = "View Classes";
	private static final String TEXT_SELECT_ALL = "View All";
	private static final String TEXT_SELECT_NONE = "View None";
	
	private Table mClassTable;
	private ClassDiagramEditPart mCurrentClassDiagram = null;

	public SearchDialog(Shell parentShell) {
		super(parentShell);
	}

	public Control createContents(Composite parent) {
		parent.setLayout(new FillLayout(SWT.VERTICAL));

		//Search input box.
		Text searchBox = new Text(parent, SWT.SEARCH);

		//Search button and close button.
		Composite buttons_container = new Composite(parent, 0);
		buttons_container.setLayout(new FillLayout(SWT.HORIZONTAL));

		Button search_button = new Button(buttons_container, SWT.PUSH);
		search_button.setText(SEARCH_BUTTON_TEXT);

		Button close_button = new Button(buttons_container, SWT.PUSH);
		close_button.setText(CLOSE_BUTTON_TEXT);

		//Search results.
		createClassFilterListBoxController(parent);

		parent.pack();
		return parent;
	}
	
	/*
	 * 
	 * Class Filter List Box<commit_msg>Correct sizes for components in SearchDialog<commit_after>package edu.ysu.onionuml.ui;

import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;

import edu.ysu.onionuml.core.UmlClassElement;
import edu.ysu.onionuml.core.UmlClassModel;
import edu.ysu.onionuml.core.UmlPackageElement;
import edu.ysu.onionuml.ui.graphics.graphicalmodels.ClassDiagramGraphicalModel;
import edu.ysu.onionuml.ui.graphics.editparts.ClassDiagramEditPart;


public class SearchDialog extends Window {
	private static final String SEARCH_BUTTON_TEXT = "Search";
	private static final String CLOSE_BUTTON_TEXT = "Close";
	
	private static final int PADDING = 10;
	private static final String TEXT_CLASSES_CONTROLLER = "View Classes";
	private static final String TEXT_SELECT_ALL = "View All";
	private static final String TEXT_SELECT_NONE = "View None";
	
	private Table mClassTable;
	private ClassDiagramEditPart mCurrentClassDiagram = null;

	public SearchDialog(Shell parentShell) {
		super(parentShell);
	}

	public Control createContents(Composite parent) {
		parent.setLayout(new GridLayout());

		//Everything in this should have fixed size.
		Composite fixedSize = new Composite(parent, SWT.PUSH);
		fixedSize.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING,
				true, false));
		fixedSize.setLayout(new FillLayout(SWT.VERTICAL));
		
		//Search input box.
		Text searchBox = new Text(fixedSize, SWT.SEARCH);

		//Search button and close button.
		Composite buttons_container = new Composite(fixedSize, 0);
		buttons_container.setLayout(new FillLayout(SWT.HORIZONTAL));

		Button search_button = new Button(buttons_container, SWT.PUSH);
		search_button.setText(SEARCH_BUTTON_TEXT);

		Button close_button = new Button(buttons_container, SWT.PUSH);
		close_button.setText(CLOSE_BUTTON_TEXT);

		//Everything in this should have dynamic size.
		Composite dynamicSize = new Composite(parent, SWT.PUSH);
		dynamicSize.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
				true, true));
		dynamicSize.setLayout(new FillLayout(SWT.VERTICAL));
		
		//Search results.
		createClassFilterListBoxController(dynamicSize);

		parent.pack();
		return parent;
	}
	
	/*
	 * 
	 * Class Filter List Box
{'fraction_non_alphanumeric': 0.09938720796629644, 'fraction_numerical': 0.0011489850631941786, 'mean_word_length': 5.408588957055215, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2966906', 'n_tokens_mistral': 1794, 'n_tokens_neox': 1686, 'n_words': 352}