當前位置: 首頁>>代碼示例>>Java>>正文


Java StringConverter.toString方法代碼示例

本文整理匯總了Java中javafx.util.StringConverter.toString方法的典型用法代碼示例。如果您正苦於以下問題:Java StringConverter.toString方法的具體用法?Java StringConverter.toString怎麽用?Java StringConverter.toString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.util.StringConverter的用法示例。


在下文中一共展示了StringConverter.toString方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getChoiceBoxItemText

import javafx.util.StringConverter; //導入方法依賴的package包/類
@SuppressWarnings("unchecked") private String getChoiceBoxItemText(@SuppressWarnings("rawtypes") ChoiceBox choiceBox,
        int index) {
    @SuppressWarnings("rawtypes")
    StringConverter converter = choiceBox.getConverter();
    String text = null;
    if (converter == null) {
        text = choiceBox.getItems().get(index).toString();
    } else {
        text = converter.toString(choiceBox.getItems().get(index));
    }
    return stripHTMLTags(text);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:13,代碼來源:JavaFXElementPropertyAccessor.java

示例2: _getValue

import javafx.util.StringConverter; //導入方法依賴的package包/類
@SuppressWarnings("unchecked") @Override public String _getValue() {
    @SuppressWarnings("rawtypes")
    ChoiceBoxTableCell cell = (ChoiceBoxTableCell) node;
    @SuppressWarnings("rawtypes")
    StringConverter converter = cell.getConverter();
    if (converter != null) {
        return converter.toString(cell.getItem());
    }
    return cell.getItem().toString();
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:11,代碼來源:JavaFXChoiceBoxTableCellElement.java

示例3: _getValue

import javafx.util.StringConverter; //導入方法依賴的package包/類
@SuppressWarnings("unchecked") @Override public String _getValue() {
    @SuppressWarnings("rawtypes")
    ChoiceBoxTreeTableCell cell = (ChoiceBoxTreeTableCell) node;
    @SuppressWarnings("rawtypes")
    StringConverter converter = cell.getConverter();
    if (converter != null) {
        return converter.toString(cell.getItem());
    }
    return cell.getItem().toString();
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:11,代碼來源:JavaFXChoiceBoxTreeTableCell.java

示例4: _getValue

import javafx.util.StringConverter; //導入方法依賴的package包/類
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override public String _getValue() {
    ChoiceBoxListCell cell = (ChoiceBoxListCell) node;
    StringConverter converter = cell.getConverter();
    if (converter != null) {
        return converter.toString(cell.getItem());
    }
    return cell.getItem().toString();
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:9,代碼來源:JavaFXChoiceBoxListCellElement.java

示例5: _getValue

import javafx.util.StringConverter; //導入方法依賴的package包/類
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override public String _getValue() {
    ChoiceBoxTreeCell cell = (ChoiceBoxTreeCell) getComponent();
    StringConverter converter = cell.getConverter();
    if (converter != null) {
        return converter.toString(cell.getItem());
    }
    return cell.getItem().toString();
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:9,代碼來源:JavaFXChoiceBoxTreeCellElement.java

示例6: _getValue

import javafx.util.StringConverter; //導入方法依賴的package包/類
@SuppressWarnings("unchecked") @Override public String _getValue() {
    TextFieldListCell<?> cell = (TextFieldListCell<?>) node;
    @SuppressWarnings("rawtypes")
    StringConverter converter = cell.getConverter();
    if (converter != null) {
        return converter.toString(cell.getItem());
    }
    return cell.getItem().toString();
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:10,代碼來源:RFXTextFieldListCell.java

示例7: _getValue

import javafx.util.StringConverter; //導入方法依賴的package包/類
@SuppressWarnings("unchecked") @Override public String _getValue() {
    TextFieldTableCell<?, ?> cell = (TextFieldTableCell<?, ?>) node;
    @SuppressWarnings("rawtypes")
    StringConverter converter = cell.getConverter();
    if (converter != null) {
        return converter.toString(cell.getItem());
    }
    return cell.getItem().toString();
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:10,代碼來源:RFXTextFieldTableCell.java

示例8: _getValue

import javafx.util.StringConverter; //導入方法依賴的package包/類
@SuppressWarnings("unchecked") @Override public String _getValue() {
    TextFieldTreeCell<?> cell = (TextFieldTreeCell<?>) node;
    @SuppressWarnings("rawtypes")
    StringConverter converter = cell.getConverter();
    if (converter != null) {
        return converter.toString(cell.getItem());
    }
    return cell.getItem().toString();
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:10,代碼來源:RFXTextFieldTreeCell.java

示例9: _getValue

import javafx.util.StringConverter; //導入方法依賴的package包/類
@SuppressWarnings("unchecked") @Override public String _getValue() {
    @SuppressWarnings("rawtypes")
    ChoiceBoxTreeCell cell = (ChoiceBoxTreeCell) node;
    @SuppressWarnings("rawtypes")
    StringConverter converter = cell.getConverter();
    if (converter != null) {
        return converter.toString(cell.getItem());
    }
    return cell.getItem().toString();
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:11,代碼來源:RFXChoiceBoxTreeCell.java

示例10: _getValue

import javafx.util.StringConverter; //導入方法依賴的package包/類
@SuppressWarnings("unchecked") @Override public String _getValue() {
    @SuppressWarnings("rawtypes")
    ChoiceBoxListCell cell = (ChoiceBoxListCell) node;
    @SuppressWarnings("rawtypes")
    StringConverter converter = cell.getConverter();
    if (converter != null) {
        return converter.toString(cell.getItem());
    }
    return cell.getItem().toString();
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:11,代碼來源:RFXChoiceBoxListCell.java

示例11: _getValue

import javafx.util.StringConverter; //導入方法依賴的package包/類
@SuppressWarnings("unchecked") @Override public String _getValue() {
    TextFieldTreeTableCell<?, ?> cell = (TextFieldTreeTableCell<?, ?>) node;
    @SuppressWarnings("rawtypes")
    StringConverter converter = cell.getConverter();
    if (converter != null) {
        return converter.toString(cell.getItem());
    }
    return cell.getItem().toString();
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:10,代碼來源:RFXTextFieldTreeTableCell.java

示例12: getEntryWithKey

import javafx.util.StringConverter; //導入方法依賴的package包/類
private <T> T getEntryWithKey(String letter, StringConverter<T> converter, ObservableList<T> items, Control control) {
	T result = null;

	// The converter is null by default for the ChoiceBox. The ComboBox has a default converter
	if (converter == null) {
		converter = new StringConverter<T>() {
			@Override
			public String toString(T t) {
				return t == null ? null : t.toString();
			}

			@Override
			public T fromString(String string) {
				return null;
			}
		};
	}

	String selectionPrefixString = (String) control.getProperties().get(SELECTION_PREFIX_STRING);
	if (selectionPrefixString == null) {
		selectionPrefixString = letter.toUpperCase();
	} else {
		selectionPrefixString += letter.toUpperCase();
	}
	control.getProperties().put(SELECTION_PREFIX_STRING, selectionPrefixString);

	for (T item : items) {
		String string = converter.toString(item);
		if (string != null && string.toUpperCase().startsWith(selectionPrefixString)) {
			result = item;
			break;
		}
	}

	ScheduledFuture<?> task = (ScheduledFuture<?>) control.getProperties().get(SELECTION_PREFIX_TASK);
	if (task != null) {
		task.cancel(false);
	}
	task = getExecutorService().schedule(
			() -> control.getProperties().put(SELECTION_PREFIX_STRING, ""), 500, TimeUnit.MILLISECONDS);
	control.getProperties().put(SELECTION_PREFIX_TASK, task);

	return result;
}
 
開發者ID:janmotl,項目名稱:linkifier,代碼行數:45,代碼來源:PrefixSelectionCustomizer.java

示例13: getItemText

import javafx.util.StringConverter; //導入方法依賴的package包/類
private static <T> String getItemText(Cell<T> cell, StringConverter<T> converter) {
    return converter == null
            ? cell.getItem() == null ? "" : cell.getItem().toString()
            : converter.toString(cell.getItem());
}
 
開發者ID:Naoghuman,項目名稱:ABC-List,代碼行數:6,代碼來源:CellUtils.java

示例14: getItemText

import javafx.util.StringConverter; //導入方法依賴的package包/類
private static <T> String getItemText(Cell<T> cell, StringConverter<T> converter) {
    return converter == null ?
            cell.getItem() == null ? "" : cell.getItem().toString() :
            converter.toString(cell.getItem());
}
 
開發者ID:VerifAPS,項目名稱:stvs,代碼行數:6,代碼來源:AdvancedCellUtils.java

示例15: getItemText

import javafx.util.StringConverter; //導入方法依賴的package包/類
private static <T> String getItemText(Cell<T> cell, StringConverter<T> converter) {
	return converter == null ? cell.getItem() == null ? "" : cell.getItem()
			.toString() : converter.toString(cell.getItem());
}
 
開發者ID:DeskChan,項目名稱:DeskChan,代碼行數:5,代碼來源:OptionsDialog.java


注:本文中的javafx.util.StringConverter.toString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。