当前位置: 首页>>代码示例>>Java>>正文


Java TextFields.bindAutoCompletion方法代码示例

本文整理汇总了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());
 }
 
开发者ID:X-Cats,项目名称:Scout2017,代码行数:24,代码来源:ScoutAnalyzerController.java

示例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);
}
 
开发者ID:heshanera,项目名称:HealthPlus,代码行数:17,代码来源:DoctorController.java

示例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;
    }    

}
 
开发者ID:heshanera,项目名称:HealthPlus,代码行数:19,代码来源:AllAppointmentsController.java

示例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);

}
 
开发者ID:heshanera,项目名称:HealthPlus,代码行数:19,代码来源:NewMessageController.java

示例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);
}
 
开发者ID:heshanera,项目名称:HealthPlus,代码行数:17,代码来源:AdminController.java

示例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;
    });
}
 
开发者ID:NonlinearFruit,项目名称:Retrospector,代码行数:20,代码来源:ControlFxTextFieldModifier.java

示例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("");
            });
		}
	}
 
开发者ID:Vidada-Project,项目名称:vidada-desktop,代码行数:18,代码来源:TagItPanelSkin.java

示例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())));
}
 
开发者ID:thane98,项目名称:FEFEditor,代码行数:31,代码来源:Terrain.java

示例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);
    }
 
开发者ID:rumangerst,项目名称:CSLMusicModStationCreator,代码行数:15,代码来源:ContextEntryEditor.java

示例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);
}
 
开发者ID:heshanera,项目名称:HealthPlus,代码行数:16,代码来源:DoctorController.java

示例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);
}
 
开发者ID:heshanera,项目名称:HealthPlus,代码行数:30,代码来源:DoctorController.java

示例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);
}
 
开发者ID:heshanera,项目名称:HealthPlus,代码行数:32,代码来源:ReceptionistController.java

示例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);
}
 
开发者ID:heshanera,项目名称:HealthPlus,代码行数:32,代码来源:CashierController.java

示例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);
}
 
开发者ID:heshanera,项目名称:HealthPlus,代码行数:29,代码来源:PharmacistController.java

示例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!");
	}
}
 
开发者ID:juan0101,项目名称:TG-BUYME,代码行数:40,代码来源:ProduzirFormaController.java


注:本文中的org.controlsfx.control.textfield.TextFields.bindAutoCompletion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。