<commit_before>package org.javarosa.patient.select.activity;

import java.util.Vector;

import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Graphics;

import org.javarosa.core.api.IView;

import de.enough.polish.ui.Container;
import de.enough.polish.ui.FramedForm;
import de.enough.polish.ui.Item;
import de.enough.polish.ui.ItemStateListener;
import de.enough.polish.ui.StringItem;
import de.enough.polish.ui.TextField;

public class PatientSelectView extends FramedForm implements IView, ItemStateListener, CommandListener {
	//#if javarosa.patientselect.formfactor == nokia-s40
	private static final int MAX_ROWS_ON_SCREEN = 5;
	private static final int SCROLL_INCREMENT = 3;	
	//#else
	private static final int MAX_ROWS_ON_SCREEN = 11;
	private static final int SCROLL_INCREMENT = 5;	
	//#endif
	
	public static final int NEW_DISALLOWED = 0;
	public static final int NEW_IN_LIST = 1;
	public static final int NEW_IN_MENU = 2;
	
	private static final int INDEX_NEW = -1;
	
	//behavior configuration options
	public boolean sortByName = true; //if false, sort by ID
	public boolean wrapAround = false; //TODO: support this
	public int newMode = NEW_IN_LIST;
	
	private PatientSelectActivity controller;
	public String entityType;
	
	private TextField tf;
	private Command exitCmd;
	private Command sortCmd;
    private Command newCmd;
	
	private int firstIndex;
	private int selectedIndex;
		
	private Vector rowIDs; //index into data corresponding to current matches
	<commit_msg>[r1926] [no message]<commit_after>package org.javarosa.patient.select.activity;

import java.util.Vector;

import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Graphics;

import org.javarosa.core.api.IView;

import de.enough.polish.ui.Container;
import de.enough.polish.ui.FramedForm;
import de.enough.polish.ui.Item;
import de.enough.polish.ui.ItemStateListener;
import de.enough.polish.ui.StringItem;
import de.enough.polish.ui.TextField;

public class PatientSelectView extends FramedForm implements IView, ItemStateListener, CommandListener {
	//#if javarosa.patientselect.formfactor == nokia-s40
	private static final int MAX_ROWS_ON_SCREEN = 6;
	private static final int SCROLL_INCREMENT = 4;	
	//#else
	private static final int MAX_ROWS_ON_SCREEN = 11;
	private static final int SCROLL_INCREMENT = 5;	
	//#endif
	
	public static final int NEW_DISALLOWED = 0;
	public static final int NEW_IN_LIST = 1;
	public static final int NEW_IN_MENU = 2;
	
	private static final int INDEX_NEW = -1;
	
	//behavior configuration options
	public boolean sortByName = true; //if false, sort by ID
	public boolean wrapAround = false; //TODO: support this
	public int newMode = NEW_IN_LIST;
	
	private PatientSelectActivity controller;
	public String entityType;
	
	private TextField tf;
	private Command exitCmd;
	private Command sortCmd;
    private Command newCmd;
	
	private int firstIndex;
	private int selectedIndex;
		
	private Vector rowIDs; //index into data corresponding to current matches
	
{'fraction_non_alphanumeric': 0.07736826073713067, 'fraction_numerical': 0.007919585744745659, 'mean_word_length': 4.8958707360861755, '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': '1094992', 'n_tokens_mistral': 1108, 'n_tokens_neox': 1027, 'n_words': 296}