下面列出了javafx.scene.control.TreeTableColumn.CellDataFeatures#javafx.beans.property.SimpleStringProperty 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* generates the root column showing label of line elements
*/
private void generateRootColumn() {
TreeTableColumn<
EditableTreeTableLineItem<Wrapper<E>>,
String> rootcolumn = new TreeTableColumn<EditableTreeTableLineItem<Wrapper<E>>, String>("Item");
rootcolumn.setCellValueFactory(new Callback<
CellDataFeatures<EditableTreeTableLineItem<Wrapper<E>>, String>, ObservableValue<String>>() {
@Override
public ObservableValue<String> call(CellDataFeatures<EditableTreeTableLineItem<Wrapper<E>>, String> param) {
return new SimpleStringProperty(param.getValue().getValue().getLabel());
}
});
treetableview.getColumns().add(rootcolumn);
}
@FXML private void renamePlayerOption() {
try {
PlayerOption option = playerList.getSelectionModel().getSelectedItem();
if (option != null) {
StringProperty id = new SimpleStringProperty(option.getId().get());
NameEditController.display(id, true);
if (id.get().contains(".")) {
BetonQuestEditor.showError("no-cross-conversation");
return;
}
option.getId().set(id.get());
BetonQuestEditor.getInstance().refresh();
}
} catch (Exception e) {
ExceptionController.display(e);
}
}
public ArchiveListPane()
{
archive_list = new TableView<>(FXCollections.observableArrayList(Preferences.archive_urls));
final TableColumn<ArchiveDataSource, String> arch_col = new TableColumn<>(Messages.ArchiveName);
arch_col.setCellValueFactory(cell -> new SimpleStringProperty(cell.getValue().getName()));
arch_col.setMinWidth(0);
archive_list.getColumns().add(arch_col);
final MenuItem item_info = new MenuItem(Messages.ArchiveServerInfo, Activator.getIcon("info_obj"));
item_info.setOnAction(event -> showArchiveInfo());
ContextMenu menu = new ContextMenu(item_info);
archive_list.setContextMenu(menu);
archive_list.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
archive_list.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
setCenter(archive_list);
}
public UserViewModel(String userName, String lastMessage, String time, String notificationsNumber, Image avatarImage) {
this.userName = userName;
this.lastMessage = new SimpleStringProperty(lastMessage);
this.time = new SimpleStringProperty(time);
this.notificationsNumber = new SimpleStringProperty(notificationsNumber);
this.avatarImage = avatarImage;
messagesList = FXCollections.observableArrayList();
}
public GlobalVariable(QuestPackage pack, String id) throws PackageNotFoundException {
if (pack == null) {
throw new PackageNotFoundException();
}
this.pack = pack;
this.id = new SimpleStringProperty(id.replace(" ", "_"));
}
public void setName(String name) {
if (name == null) {
this.name = null;
} else {
this.name = new SimpleStringProperty(name);
}
}
DrawingImpl() {
super();
title = new SimpleStringProperty("");
shapes = new SimpleListProperty<>(FXCollections.observableArrayList());
selection = ShapeFactory.INST.createGroup();
modified = false;
}
protected AbstractEditor(final EditOperation editOperation, final DefaultGetter<V> defaultGetter, final ValueValidator<V> validator, final String editedItemName, final V initialValue) {
this.editOperation = editOperation;
this.defaultGetter = defaultGetter;
this.validator = validator;
this.disableEditProperty = new SimpleBooleanProperty();
this.errorMessageProperty = new SimpleStringProperty();
this.editedItemName = editedItemName;
setCurrentValue(initialValue);
}
public HistoryStoreView(String email,String date, String link, String time, String domain, String title) {
this.email1 = new SimpleStringProperty(email);
this.date1 = new SimpleStringProperty(date);
this.link1 = new SimpleStringProperty(link);
this.time1 = new SimpleStringProperty(time);
this.domain1 = new SimpleStringProperty(domain);
this.title1 = new SimpleStringProperty(title);
}
protected WalletTransaction(final Network network, final Transaction transaction, final Coin balanceChange) {
this.network = network;
this.transaction = transaction;
this.balanceChange = balanceChange;
final MonetaryFormat monetaryFormatter = network.getParams().getMonetaryFormat();
dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
networkNameProperty = new SimpleStringProperty(NetworkResolver.getName(network.getParams()));
dateProperty = new SimpleStringProperty(dateFormat.format(transaction.getUpdateTime()));
amountProperty = new SimpleStringProperty(monetaryFormatter.format(balanceChange).toString());
memoProperty = new SimpleStringProperty(transaction.getMemo());
memoProperty.addListener(change -> {
transaction.setMemo(memoProperty.getValue());
});
}
public ReceptionTableModel(SimpleStringProperty receptionId, SimpleStringProperty name, SimpleStringProperty branch, SimpleStringProperty address, SimpleStringProperty email, SimpleIntegerProperty tel, SimpleStringProperty nic) {
this.receptionId = receptionId;
this.name = name;
this.branch = branch;
this.address = address;
this.email = email;
this.tel = tel;
this.nic = nic;
}
public RecordingDetailsController(Archivo mainApp) {
this.mainApp = mainApp;
this.recordingSelection = mainApp.getRecordingListController().getRecordingSelection();
imageCache = new HashMap<>();
showPoster = new SimpleBooleanProperty(false);
expectedRemovalText = new SimpleStringProperty();
}
public TimingLocationInput() {
this.IDProperty = new SimpleIntegerProperty();
this.timingLocationInputName = new SimpleStringProperty("Not Yet Set");
this.timingInputString = new SimpleStringProperty();
tailFileBooleanProperty = new SimpleBooleanProperty();
timingReaderInitialized = new SimpleBooleanProperty();
skewInput = new SimpleBooleanProperty();
//attributes = new ConcurrentHashMap <>();
skewDuration = Duration.ZERO;
skewInput.setValue(Boolean.FALSE);
}
public IndicatorParameter(String description, IndicatorParameterType type, String value){
Objects.requireNonNull(description,"Must be not null");
Objects.requireNonNull(type,"Must be not null");
Objects.requireNonNull(value,"Must be not null");
this.description = new SimpleStringProperty(description);
this.type = new SimpleObjectProperty<IndicatorParameterType>(type);
this.value = new SimpleStringProperty(value);
}
private ChatMessage(SupportType supportType,
String tradeId,
int traderId,
boolean senderIsTrader,
String message,
@Nullable List<Attachment> attachments,
NodeAddress senderNodeAddress,
long date,
boolean arrived,
boolean storedInMailbox,
String uid,
int messageVersion,
boolean acknowledged,
@Nullable String sendMessageError,
@Nullable String ackError,
boolean wasDisplayed) {
super(messageVersion, uid, supportType);
this.tradeId = tradeId;
this.traderId = traderId;
this.senderIsTrader = senderIsTrader;
this.message = message;
this.wasDisplayed = wasDisplayed;
Optional.ofNullable(attachments).ifPresent(e -> addAllAttachments(attachments));
this.senderNodeAddress = senderNodeAddress;
this.date = date;
arrivedProperty = new SimpleBooleanProperty(arrived);
storedInMailboxProperty = new SimpleBooleanProperty(storedInMailbox);
acknowledgedProperty = new SimpleBooleanProperty(acknowledged);
sendMessageErrorProperty = new SimpleStringProperty(sendMessageError);
ackErrorProperty = new SimpleStringProperty(ackError);
notifyChangeListener();
}
@Override
public void constructFromString(String str) {
String[] parts = str.split("\t");
if (parts.length == 6) {
int index = Integer.parseInt(parts[0]);
boolean paused = parts[1].equals("true");
Interval delay = new Interval(parts[2]);
HPacket packet = new HPacket(parts[3]);
HMessage.Direction direction = parts[4].equals(HMessage.Direction.TOSERVER.name()) ? HMessage.Direction.TOSERVER : HMessage.Direction.TOCLIENT;
String packetAsString = parts[5];
construct(index, paused, delay, packet, direction);
this.packetAsStringProperty = new SimpleStringProperty(packetAsString);
}
}
/**
* Constructor
*
* @param filter The library filter utility class
* @param items The items shown inside a toggle button group in the sidebar
* @param selectedListWidget The currently selected {@link ListWidgetType} by the user
*/
public LibrarySidebar(LibraryFilter filter, ObservableList<ShortcutCategoryDTO> items,
ObjectProperty<ListWidgetType> selectedListWidget) {
super(items, filter.searchTermProperty(), selectedListWidget);
this.applicationName = new SimpleStringProperty();
this.onCreateShortcut = new SimpleObjectProperty<>();
this.onScriptRun = new SimpleObjectProperty<>();
this.onOpenConsole = new SimpleObjectProperty<>();
this.filter = filter;
this.selectedShortcutCategory = filter.selectedShortcutCategoryProperty();
}
public BranchTableModel(SimpleStringProperty branchId, SimpleStringProperty registerId, SimpleStringProperty address, SimpleStringProperty email, SimpleIntegerProperty tel, SimpleStringProperty postalCode) {
this.branchId = branchId;
this.registerId = registerId;
this.address = address;
this.email = email;
this.tel = tel;
this.postalCode = postalCode;
}
public final LedBuilder styleClass(final String STYLE_CLASS) {
properties.put("styleClass", new SimpleStringProperty(STYLE_CLASS));
return this;
}
public SimpleStringProperty notificationsNumberProperty() {
return notificationsNumber;
}
public SimpleStringProperty postalCodeProperty() {
return postalCode;
}
public final SimpleGaugeBuilder unit(final String UNIT) {
properties.put("unit", new SimpleStringProperty(UNIT));
return this;
}
public final B unit(final String TEXT) {
properties.put("unit", new SimpleStringProperty(TEXT));
return (B)this;
}
public final B name(final String NAME) {
properties.put("name", new SimpleStringProperty(NAME));
return (B)this;
}
public final TButtonBuilder text(final String TEXT) {
properties.put("text", new SimpleStringProperty(TEXT));
return this;
}
public SimpleStringProperty vehicleNumberProperty() {
return vehicleNumber;
}
@SuppressWarnings("unchecked")
public final B unit(final String UNIT) {
properties.put("unit", new SimpleStringProperty(UNIT));
return (B)this;
}
private void createNotificationTable() {
// collector host
TableColumn<CollectorNotification, String> tcCollector = new TableColumn<>(
MonitorLocalizer.instance().getLangString("collector"));
tvNotifications.getColumns().add(tcCollector);
TableColumn<CollectorNotification, String> tcCollectorHost = new TableColumn<>(
MonitorLocalizer.instance().getLangString("host"));
tcCollectorHost.setPrefWidth(150);
tcCollectorHost.setCellValueFactory(cellDataFeatures -> {
return new SimpleStringProperty(cellDataFeatures.getValue().getCollectorHost());
});
tcCollector.getColumns().add(tcCollectorHost);
// collector IP
TableColumn<CollectorNotification, String> tcCollectorIp = new TableColumn<>(
MonitorLocalizer.instance().getLangString("ip.address"));
tcCollectorIp.setPrefWidth(150);
tcCollectorIp.setCellValueFactory(cellDataFeatures -> {
return new SimpleStringProperty(cellDataFeatures.getValue().getCollectorIpAddress());
});
tcCollector.getColumns().add(tcCollectorIp);
// timestamp
TableColumn<CollectorNotification, String> tcTimestamp = new TableColumn<>(
MonitorLocalizer.instance().getLangString("timestamp"));
tcTimestamp.setPrefWidth(250);
tcTimestamp.setCellValueFactory(cellDataFeatures -> {
String timestamp = cellDataFeatures.getValue().getTimestamp();
OffsetDateTime odt = DomainUtils.offsetDateTimeFromString(timestamp, DomainUtils.OFFSET_DATE_TIME_8601);
return new SimpleStringProperty(
DomainUtils.offsetDateTimeToString(odt, DomainUtils.OFFSET_DATE_TIME_PATTERN));
});
tvNotifications.getColumns().add(tcTimestamp);
// severity
TableColumn<CollectorNotification, Text> tcSeverity = new TableColumn<>(
MonitorLocalizer.instance().getLangString("severity"));
tcSeverity.setPrefWidth(100);
tcSeverity.setCellValueFactory(cellDataFeatures -> {
NotificationSeverity severity = cellDataFeatures.getValue().getSeverity();
Text text = new Text(severity.toString());
text.setFill(severity.getColor());
return new SimpleObjectProperty<Text>(text);
});
tvNotifications.getColumns().add(tcSeverity);
// message
TableColumn<CollectorNotification, String> tcText = new TableColumn<>(
MonitorLocalizer.instance().getLangString("message"));
tcText.setPrefWidth(600);
tcText.setCellValueFactory(cellDataFeatures -> {
return new SimpleStringProperty(cellDataFeatures.getValue().getText());
});
tvNotifications.getColumns().add(tcText);
}
public static SimpleStringProperty getProxyPass() {
return proxyPass;
}
public List<MemoryLine> parse(int[] values, BiConsumer<Integer, Integer> memoryListener) {
List<MemoryLine> lines = new ArrayList<>();
int address = 0;
MemoryLine currLine = null;
for(int value : values) {
if(currLine == null) {
currLine = new MemoryLine(address);
}
SimpleStringProperty prop = new SimpleStringProperty(parseValue(value));
if(memoryListener != null) {
MemoryLine currMemoryLine = currLine;
int currSize = currMemoryLine.values.size();
prop.addListener(
(observable, oldValue, newValue) ->
memoryListener.accept(currMemoryLine.address + currSize, parseValue(newValue)));
}
currLine.values.add(prop);
if(currLine.values.size() == 16) {
lines.add(currLine);
currLine = null;
address += 16;
}
}
while(address < (1 << addressBits)) {
if(currLine == null) {
currLine = new MemoryLine(address);
}
currLine.values.add(new SimpleStringProperty("0"));
if(currLine.values.size() == 16) {
lines.add(currLine);
currLine = null;
address += 16;
}
}
if(currLine != null) {
lines.add(currLine);
}
return lines;
}