本文整理匯總了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);
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
示例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());
}
示例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());
}
示例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());
}