本文整理汇总了Java中org.controlsfx.control.textfield.TextFields.bindAutoCompletion方法的典型用法代码示例。如果您正苦于以下问题:Java TextFields.bindAutoCompletion方法的具体用法?Java TextFields.bindAutoCompletion怎么用?Java TextFields.bindAutoCompletion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.controlsfx.control.textfield.TextFields
的用法示例。
在下文中一共展示了TextFields.bindAutoCompletion方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: genTeamList
import org.controlsfx.control.textfield.TextFields; //导入方法依赖的package包/类
public void genTeamList(){
teamMenu.getItems().clear();
int resultSize = dbread.getSize("teams");
dbread.setQuery("SELECT teamnum,teamname FROM " + Main.getCurrentSchema() +".teams ORDER BY teamnum;");
dbread.executeQuery();
System.out.println(resultSize);
teamNames = new ArrayList<String>();
String newItem = null;
for(int i = 1; i <= resultSize; i++){
try {
dbread.rs.next();
newItem = dbread.rs.getString(1) + " - " + dbread.rs.getString(2);
} catch (SQLException e) {
// TODO Auto-generated catch block
System.out.println("FAILED TO ADD ELEMENT");
e.printStackTrace();
}
teamNames.add(newItem);
}
teamMenu.getItems().addAll(teamNames);
teamMenu.setEditable(true);
TextFields.bindAutoCompletion(teamMenu.getEditor(), teamMenu.getItems());
}
示例2: loadDrugList
import org.controlsfx.control.textfield.TextFields; //导入方法依赖的package包/类
@FXML
public void loadDrugList()
{
ArrayList<String> drugData = doc.getDrugGenericInfo();
ObservableList<String> possibleSuggestions = FXCollections.observableArrayList();
int drugDatalen = drugData.size();
for (int i = 0; i < drugDatalen; i++)
{
possibleSuggestions.add(drugData.get(i));
}
//TextFields.bindAutoCompletion(txtAuto,"test","temp","tempurature","table","tablet");
TextFields.bindAutoCompletion(txtAuto,possibleSuggestions);
}
示例3: bindSuggestions
import org.controlsfx.control.textfield.TextFields; //导入方法依赖的package包/类
@FXML private void bindSuggestions()
{
String type = (String)searchAppointmentCombo.getSelectionModel().getSelectedItem();
ArrayList<String> tmp = new ArrayList<String>();
switch(type)
{
case "Doctor":
TextFields.bindAutoCompletion(searchValue,docNames);
break;
case "Patient ID":
TextFields.bindAutoCompletion(searchValue,tmp);
break;
case "Appointment ID":
TextFields.bindAutoCompletion(searchValue,tmp);
break;
}
}
示例4: loadUserNames
import org.controlsfx.control.textfield.TextFields; //导入方法依赖的package包/类
public void loadUserNames()
{
ArrayList<ArrayList<String>> data = newSysUser.getUserNameAndID();
log = new HashMap<String,String>();
ArrayList<String> possibleSuggestions = new ArrayList<String>();
int size = data.size();
for(int i = 1; i < size; i++)
{
log.put(data.get(i).get(0)+" "+data.get(i).get(1),data.get(i).get(3)+" "+data.get(i).get(2));
possibleSuggestions.add(data.get(i).get(3) +" " + data.get(i).get(0)+" "+data.get(i).get(1));
}
TextFields.bindAutoCompletion(receivertxt,possibleSuggestions);
}
示例5: loadUsers
import org.controlsfx.control.textfield.TextFields; //导入方法依赖的package包/类
public void loadUsers()
{
ArrayList<ArrayList<String>> data = admin.getUserNameAndID();
log = new HashMap<String,String>();
ArrayList<String> possibleSuggestions = new ArrayList<String>();
int size = data.size();
for(int i = 1; i < size; i++)
{
log.put(data.get(i).get(0)+" "+data.get(i).get(1),data.get(i).get(3)+" "+data.get(i).get(2));
possibleSuggestions.add(data.get(i).get(3) +" " + data.get(i).get(0)+" "+data.get(i).get(1));
}
TextFields.bindAutoCompletion(userSearch,possibleSuggestions);
}
示例6: autocompleteMe
import org.controlsfx.control.textfield.TextFields; //导入方法依赖的package包/类
public static void autocompleteMe(TextField textfield, List<String> strings) {
TextFields.bindAutoCompletion(textfield, (x)->{
if (x.isCancelled() || x.getUserText().length() < 4)
return new ArrayList<>();
List<String> results = strings.stream()
.filter((y)->
y.length() > 4 &&
y.toLowerCase().contains(x.getUserText().toLowerCase()) &&
!y.equals(x.getUserText())
)
.collect(Collectors.toList());
if (results.size() > maxAutocompleteResults)
return new ArrayList<>();
return results;
});
}
示例7: updateSuggestionProvider
import org.controlsfx.control.textfield.TextFields; //导入方法依赖的package包/类
private void updateSuggestionProvider(){
if(autoCompletionBinding != null){
// Dispose the old binding
autoCompletionBinding.dispose();
}
if(getSkinnable().getSuggestionProvider() != null){
autoCompletionBinding = TextFields.bindAutoCompletion(tagEdit, getSkinnable().getSuggestionProvider());
autoCompletionBinding.setOnAutoCompleted(completionArgs -> {
if(completionArgs.getCompletion() != null)
appendTag(completionArgs.getCompletion());
tagEdit.setText("");
});
}
}
示例8: initialize
import org.controlsfx.control.textfield.TextFields; //导入方法依赖的package包/类
@Override
public void initialize(URL url, ResourceBundle rb) {
GuiData.getInstance().getStage().setOnCloseRequest(we -> close());
try {
file = new FatesTerrainFile(FileData.getInstance().getWorkingFile(), "rw");
for (TileBlock t : file.getTiles()) {
tileList.getItems().add(t.getTid());
}
} catch (IOException ex) {
ex.printStackTrace();
}
setupGrid();
populateForm();
tileList.getSelectionModel().selectedIndexProperty().addListener((observable, oldValue, newValue) ->
updateFields(newValue.intValue()));
scrollPane.widthProperty().addListener((observable, oldValue, newValue) ->
anchorPane.setPrefWidth(newValue.doubleValue()));
scrollPane.heightProperty().addListener((observable, oldValue, newValue) ->
anchorPane.setPrefHeight(newValue.doubleValue()));
AutoCompletionBinding<String> binding = TextFields.bindAutoCompletion(blockFields.get(0),
manager.getTiles().keySet());
binding.setOnAutoCompleted(event -> blockFields.get(0).setText(manager.getRealEntry(blockFields.get(0).getText())));
binding = TextFields.bindAutoCompletion(blockFields.get(1),
manager.getTiles().keySet());
binding.setOnAutoCompleted(event -> blockFields.get(1).setText(manager.getRealEntry(blockFields.get(1).getText())));
}
示例9: updateSongsAutoComplete
import org.controlsfx.control.textfield.TextFields; //导入方法依赖的package包/类
private void updateSongsAutoComplete() {
if(entry == null)
return;
Set<String> complete = new HashSet<>();
for(String name : contextCollections.getCheckModel().getCheckedItems()) {
SongCollection coll = entry.getStation().getCollections().get(name);
coll.getLocalListOfSongs().stream().forEach(x -> complete.add(x.getName()));
}
TextFields.bindAutoCompletion(songToAdd, complete);
}
示例10: loadTestList
import org.controlsfx.control.textfield.TextFields; //导入方法依赖的package包/类
public void loadTestList()
{
ArrayList<ArrayList<String>> testData = doc.getTestInfo();
ObservableList<String> possibleSuggestions = FXCollections.observableArrayList();
int drugDatalen = testData.size();
for (int i = 1; i < drugDatalen; i++)
{
possibleSuggestions.add(testData.get(i).get(1));
}
//TextFields.bindAutoCompletion(txtAuto,"test","temp","tempurature","table","tablet");
TextFields.bindAutoCompletion(txtAuto1,possibleSuggestions);
}
示例11: loadNameList
import org.controlsfx.control.textfield.TextFields; //导入方法依赖的package包/类
public void loadNameList()
{
ObservableList<String> possibleSuggestions = FXCollections.observableArrayList();
ArrayList<ArrayList<String>> data = doc.getAllNames();
System.out.println(data);
int size = data.size();
for(int i = 1; i < size; i++)
{
String firstName = data.get(i).get(1);
String lastName = data.get(i).get(2);
String age = "";
String id = data.get(i).get(0);
try{
SimpleDateFormat tmpdataformat = new SimpleDateFormat("yyyy-MM-dd");
Date birth = tmpdataformat.parse(data.get(i).get(3));
Calendar calendarBirth = Calendar.getInstance();
calendarBirth.setTime(birth);
Calendar calendarToday = Calendar.getInstance();
age = Integer.toString(calendarToday.get(Calendar.YEAR) - calendarBirth.get(Calendar.YEAR));
}catch(Exception e){e.printStackTrace();}
possibleSuggestions.add(age + " " + firstName + " " + lastName);
patientLog.put(age + " " + firstName + " " + lastName,id);
}
TextFields.bindAutoCompletion(patientSearchValue,possibleSuggestions);
}
示例12: loadNameList
import org.controlsfx.control.textfield.TextFields; //导入方法依赖的package包/类
public void loadNameList()
{
ObservableList<String> possibleSuggestions = FXCollections.observableArrayList();
ArrayList<ArrayList<String>> data = receptionist.getAllNames();
//System.out.println(data);
int size = data.size();
for(int i = 1; i < size; i++)
{
String firstName = data.get(i).get(1);
String lastName = data.get(i).get(2);
String age = "";
String id = data.get(i).get(0);
try{
SimpleDateFormat tmpdataformat = new SimpleDateFormat("yyyy-MM-dd");
Date birth = tmpdataformat.parse(data.get(i).get(3));
Calendar calendarBirth = Calendar.getInstance();
calendarBirth.setTime(birth);
Calendar calendarToday = Calendar.getInstance();
age = Integer.toString(calendarToday.get(Calendar.YEAR) - calendarBirth.get(Calendar.YEAR));
}catch(Exception e){e.printStackTrace();}
possibleSuggestions.add(age + " " + firstName + " " + lastName);
patientLog.put(age + " " + firstName + " " + lastName,id);
}
TextFields.bindAutoCompletion(patientSearchBox,possibleSuggestions);
}
示例13: loadNameList
import org.controlsfx.control.textfield.TextFields; //导入方法依赖的package包/类
public void loadNameList()
{
ObservableList<String> possibleSuggestions = FXCollections.observableArrayList();
ArrayList<ArrayList<String>> data = cashier.getAllNames();
//System.out.println(data);
int size = data.size();
for(int i = 1; i < size; i++)
{
String firstName = data.get(i).get(1);
String lastName = data.get(i).get(2);
String age = "";
String id = data.get(i).get(0);
try{
SimpleDateFormat tmpdataformat = new SimpleDateFormat("yyyy-MM-dd");
Date birth = tmpdataformat.parse(data.get(i).get(3));
Calendar calendarBirth = Calendar.getInstance();
calendarBirth.setTime(birth);
Calendar calendarToday = Calendar.getInstance();
age = Integer.toString(calendarToday.get(Calendar.YEAR) - calendarBirth.get(Calendar.YEAR));
}catch(Exception e){e.printStackTrace();}
possibleSuggestions.add(age + " " + firstName + " " + lastName);
patientLog.put(age + " " + firstName + " " + lastName,id);
}
TextFields.bindAutoCompletion(patientID,possibleSuggestions);
}
示例14: loadNameList
import org.controlsfx.control.textfield.TextFields; //导入方法依赖的package包/类
public void loadNameList()
{
ObservableList<String> possibleSuggestions = FXCollections.observableArrayList();
ArrayList<ArrayList<String>> data = pharmacist.getAllNames();
System.out.println(data);
int size = data.size();
for(int i = 1; i < size; i++)
{
String firstName = data.get(i).get(1);
String lastName = data.get(i).get(2);
String age = "";
String id = data.get(i).get(0);
try{
SimpleDateFormat tmpdataformat = new SimpleDateFormat("yyyy-MM-dd");
Date birth = tmpdataformat.parse(data.get(i).get(3));
Calendar calendarBirth = Calendar.getInstance();
calendarBirth.setTime(birth);
Calendar calendarToday = Calendar.getInstance();
age = Integer.toString(calendarToday.get(Calendar.YEAR) - calendarBirth.get(Calendar.YEAR));
}catch(Exception e){e.printStackTrace();}
possibleSuggestions.add(age + " " + firstName + " " + lastName + " " + id);
}
TextFields.bindAutoCompletion(patientSearchValue,possibleSuggestions);
}
示例15: initialize
import org.controlsfx.control.textfield.TextFields; //导入方法依赖的package包/类
/**
* M�todo inicial, que roda ao iniciar a tela
*/
@FXML
protected void initialize(){
btnUsuario.setText(usuario.getLogin());
menuPermissoes();
try{
List<String> lotes = paDao.getAllLoteAnalisado();
TextFields.bindAutoCompletion(lote, lotes);
formas = formaDao.getAll();
if(formas != null){
List<String> formasNomes = new ArrayList<String>();
for(Forma f: formas){
formasNomes.add(f.getDescricao());
}
comboForma.getItems().setAll(formasNomes);
}
// Set up the table data
coluna_ingrediente.setCellValueFactory(
new PropertyValueFactory<ProdutoIngrediente,String>("descricao_ingrediente")
);
coluna_quantidade.setCellValueFactory(
new PropertyValueFactory<ProdutoIngrediente,Double>("quantidade")
);
coluna_medida.setCellValueFactory(
new PropertyValueFactory<ProdutoIngrediente,String>("grama_quilo")
);
data = FXCollections.observableArrayList();
tabela_ingrediente.setItems(data);
}catch(Exception e){
e.printStackTrace();
popup.getError("Ocorreu um erro durante o processo, tente novamente!");
}
}