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


Java ReadOnlyStringWrapper类代码示例

本文整理汇总了Java中javafx.beans.property.ReadOnlyStringWrapper的典型用法代码示例。如果您正苦于以下问题:Java ReadOnlyStringWrapper类的具体用法?Java ReadOnlyStringWrapper怎么用?Java ReadOnlyStringWrapper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ReadOnlyStringWrapper类属于javafx.beans.property包,在下文中一共展示了ReadOnlyStringWrapper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SourceTreeTable

import javafx.beans.property.ReadOnlyStringWrapper; //导入依赖的package包/类
/**
 * Creates a new source tree table. It comes pre-populated with a key and a value column.
 */
public SourceTreeTable() {
  keyColumn.prefWidthProperty().bind(widthProperty().divide(2).subtract(2));
  valueColumn.prefWidthProperty().bind(widthProperty().divide(2).subtract(2));

  keyColumn.setCellValueFactory(
      f -> new ReadOnlyStringWrapper(getEntryForCellData(f).getViewName()));
  valueColumn.setCellValueFactory(
      f -> new ReadOnlyObjectWrapper(getEntryForCellData(f).getValueView()));
  Label placeholder = new Label();
  placeholder.textProperty().bind(EasyBind.monadic(sourceType)
      .map(SourceType::getName)
      .map(n -> "No data available. Is there a connection to " + n + "?")
      .orElse("No data available. Is the source connected?"));
  setPlaceholder(placeholder);

  getColumns().addAll(keyColumn, valueColumn);
}
 
开发者ID:wpilibsuite,项目名称:shuffleboard,代码行数:21,代码来源:SourceTreeTable.java

示例2: initialize

import javafx.beans.property.ReadOnlyStringWrapper; //导入依赖的package包/类
@FXML
private void initialize() {

	nameColumn.setCellValueFactory(cd -> cd.getValue().nameProperty());
	slotColumn.setCellValueFactory(cd ->
		new ReadOnlyStringWrapper(cd.getValue().slotProperty().get().toString()));

	astabColumn.setCellValueFactory(cd -> cd.getValue().statsProperty(ArmorStats.ASTAB).asObject());
	aslashColumn.setCellValueFactory(cd -> cd.getValue().statsProperty(ArmorStats.ASLASH).asObject());
	acrushColumn.setCellValueFactory(cd -> cd.getValue().statsProperty(ArmorStats.ACRUSH).asObject());
	arangeColumn.setCellValueFactory(cd -> cd.getValue().statsProperty(ArmorStats.ARANGE).asObject());
	amagicColumn.setCellValueFactory(cd -> cd.getValue().statsProperty(ArmorStats.AMAGIC).asObject());

	dstabColumn.setCellValueFactory(cd -> cd.getValue().statsProperty(ArmorStats.DSTAB).asObject());
	dslashColumn.setCellValueFactory(cd -> cd.getValue().statsProperty(ArmorStats.DSLASH).asObject());
	dcrushColumn.setCellValueFactory(cd -> cd.getValue().statsProperty(ArmorStats.DCRUSH).asObject());
	drangeColumn.setCellValueFactory(cd -> cd.getValue().statsProperty(ArmorStats.DRANGE).asObject());
	dmagicColumn.setCellValueFactory(cd -> cd.getValue().statsProperty(ArmorStats.DMAGIC).asObject());

	strColumn.setCellValueFactory(cd -> cd.getValue().statsProperty(ArmorStats.STR).asObject());
	rstrColumn.setCellValueFactory(cd -> cd.getValue().statsProperty(ArmorStats.RSTR).asObject());
	mdmgColumn.setCellValueFactory(cd -> cd.getValue().statsProperty(ArmorStats.MDMG).asObject());
	prayColumn.setCellValueFactory(cd -> cd.getValue().statsProperty(ArmorStats.PRAYER).asObject());


}
 
开发者ID:landonreams,项目名称:osrs-equipment-builder,代码行数:27,代码来源:ItemSelectorController.java

示例3: getColumns

import javafx.beans.property.ReadOnlyStringWrapper; //导入依赖的package包/类
/**
 * Returns the columns associated to this columnizer. They can directly be added to a {@link TableView}.
 * <p>
 * The visibility and width of the returned columns are bound to the column definitions of this Columnizer, so that
 * they are stored in the config.
 *
 * @return the columns associated to this columnizer
 */
@NotNull
public List<TableColumn<LogEntry, String>> getColumns() {
    List<TableColumn<LogEntry, String>> columns = new ArrayList<>();
    for (ColumnDefinition columnDefinition : columnDefinitions) {
        TableColumn<LogEntry, String> col = new TableColumn<>();
        // we need to keep the original text to avoid breaking the table visibility menu
        col.textProperty().bind(columnDefinition.headerLabelProperty());
        col.setGraphic(columnDefinition.createBoundHeaderLabel());
        col.setVisible(columnDefinition.isVisible());
        col.setPrefWidth(columnDefinition.getWidth());
        columnDefinition.visibleProperty().bindBidirectional(col.visibleProperty());
        columnDefinition.widthProperty().bind(col.widthProperty());
        col.setCellValueFactory(data -> {
            LogEntry log = data.getValue();
            String cellValue = log.getColumnValues().get(columnDefinition.getCapturingGroupName());
            return new ReadOnlyStringWrapper(cellValue);
        });
        columns.add(col);
    }
    return columns;
}
 
开发者ID:joffrey-bion,项目名称:fx-log,代码行数:30,代码来源:Columnizer.java

示例4: MasterView

import javafx.beans.property.ReadOnlyStringWrapper; //导入依赖的package包/类
public MasterView(ClientContext clientContext) {
    super(clientContext, Constants.MASTER_CONTROLLER_NAME);
    listView = new ListView<>();
    listView.setCellFactory(c -> new StockItemListCell());
    rootNode = new StackPane(listView);

    selectedStockIdent = new ReadOnlyStringWrapper();
    listView.getSelectionModel().selectedItemProperty().addListener((obs, oldVal, newVal) -> {
        if (newVal == null) {
            selectedStockIdent.set(null);
            getModel().setSelectedStockIdent(null);
        } else {
            selectedStockIdent.set(newVal.getStockIdent());
            getModel().setSelectedStockIdent(newVal.getStockIdent());
        }
    });
}
 
开发者ID:guigarage,项目名称:dolphin-platform-master-detail-example,代码行数:18,代码来源:MasterView.java

示例5: createMacros

import javafx.beans.property.ReadOnlyStringWrapper; //导入依赖的package包/类
private Tab createMacros(Macros orig_macros)
{
    final Macros macros = (orig_macros == null) ? new Macros() : orig_macros;
    // Use text field to allow copying the name and value
    // Table uses list of macro names as input
    // Name column just displays the macro name,..
    final TableColumn<String, String> name = new TableColumn<>(Messages.WidgetInfoDialog_Name);
    name.setCellFactory(TextFieldTableCell.forTableColumn());
    name.setCellValueFactory(param -> new ReadOnlyStringWrapper(param.getValue()));

    // .. value column fetches the macro value
    final TableColumn<String, String> value = new TableColumn<>(Messages.WidgetInfoDialog_Value);
    value.setCellFactory(TextFieldTableCell.forTableColumn());
    value.setCellValueFactory(param -> new ReadOnlyStringWrapper(macros.getValue(param.getValue())));

    final TableView<String> table =
        new TableView<>(FXCollections.observableArrayList(macros.getNames()));
    table.getColumns().add(name);
    table.getColumns().add(value);
    table.setEditable(true);
    table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);

    return new Tab(Messages.WidgetInfoDialog_TabMacros, table);
}
 
开发者ID:kasemir,项目名称:org.csstudio.display.builder,代码行数:25,代码来源:WidgetInfoDialog.java

示例6: getAuthenticatedConnection

import javafx.beans.property.ReadOnlyStringWrapper; //导入依赖的package包/类
@Test
public void getAuthenticatedConnection() throws IOException {
    webserver.requireLogin = true;
    AuthHandler handler = new AuthHandler(
            new ReadOnlyStringWrapper("localhost:"+webserver.port), 
            new ReadOnlyBooleanWrapper(false), 
            new ReadOnlyStringWrapper(TEST_USER), 
            new ReadOnlyStringWrapper(TEST_PASSWORD)
    );
    CloseableHttpClient client = handler.getAuthenticatedClient();
    assertNotNull(client);
    HttpUriRequest request = new HttpGet("http://localhost:"+webserver.port+"/testUri");
    client.execute(request);
    Header authHeader = webserver.lastRequest.getFirstHeader("Authorization");
    assertNotNull(authHeader);
    String compareToken = "Basic "+Base64.getEncoder().encodeToString((TEST_USER + ":" + TEST_PASSWORD).getBytes());
    assertEquals("Auth token should be expected format", authHeader.getValue(), compareToken);
}
 
开发者ID:Adobe-Consulting-Services,项目名称:curly,代码行数:19,代码来源:ConnectionManagerTest.java

示例7: addTableColumns

import javafx.beans.property.ReadOnlyStringWrapper; //导入依赖的package包/类
@Override
protected void addTableColumns(TableView<ArchiveEntry> table) {
    TableColumn<ArchiveEntry, String> ordinalColumn = new TableColumn<ArchiveEntry, String>(
            "Ordinal");
    ordinalColumn.setCellValueFactory(cellData -> {
        return new ReadOnlyStringWrapper(
                Integer.toString(cellData.getValue().ordinal()));
    });
    table.getColumns().add(ordinalColumn);
    TableColumn<ArchiveEntry, String> sizeColumn = new TableColumn<ArchiveEntry, String>(
            "Size(Bytes)");
    sizeColumn.setCellValueFactory(cellData -> {
        long size = cellData.getValue().size();
        return new ReadOnlyStringWrapper(
                size < 0 ? null : Long.toString(size));
    });
    table.getColumns().add(sizeColumn);
    TableColumn<ArchiveEntry, String> nameColumn = new TableColumn<ArchiveEntry, String>(
            "Name");
    nameColumn.setCellValueFactory(cellData -> {
        return new ReadOnlyStringWrapper(cellData.getValue().name());
    });
    table.getColumns().add(nameColumn);
}
 
开发者ID:uom-daris,项目名称:daris,代码行数:25,代码来源:ArchiveContentTableView.java

示例8: getAllMusicalWorks

import javafx.beans.property.ReadOnlyStringWrapper; //导入依赖的package包/类
public void getAllMusicalWorks() {
    tableAvailableMusicalWorks.setCellValueFactory(param -> new ReadOnlyStringWrapper(param.getValue()));
    tableSelectedMusicalWorks.setCellValueFactory(param -> new ReadOnlyStringWrapper(param.getValue()));

    List<MusicalWorkDTO> musicalWorks = MusicalWorkAdministratonManager.getAllMusicalWorks();

    for(MusicalWorkDTO mwDTO : musicalWorks) {
        tableAvailable.getItems().add(mwDTO.getName());
    }

    this.musicalWorks = musicalWorks;
}
 
开发者ID:ITB15-S4-GroupD,项目名称:Planchester,代码行数:13,代码来源:InstrumentationController.java

示例9: initialize

import javafx.beans.property.ReadOnlyStringWrapper; //导入依赖的package包/类
@FXML
public void initialize() {
    initializeMandatoryFields();

    selectedMusicalWorks.setCellValueFactory(param -> new ReadOnlyStringWrapper(param.getValue()));

    points.textProperty().addListener((observable, oldValue, newValue) -> {
        if (!newValue.matches("\\d*[\\,.]?\\d*?")) {
            points.setText(newValue.replaceAll("[^\\d*[\\,.]?\\d*?]", ""));
        }
    });
}
 
开发者ID:ITB15-S4-GroupD,项目名称:Planchester,代码行数:13,代码来源:CreateController.java

示例10: initialize

import javafx.beans.property.ReadOnlyStringWrapper; //导入依赖的package包/类
@Override
public void initialize(URL location, ResourceBundle resources) {
    menuBar.setUseSystemMenuBar(true);

    if (System.getProperty("os.name").toLowerCase().contains("mac")) {
        quitMenu.setVisible(false);
    }

    tableCombinationColumn.setCellValueFactory(param -> new ReadOnlyStringWrapper(String.join(", ", param.getValue().getKey())));
    tableNumberOfItems.setCellValueFactory(param -> new ReadOnlyObjectWrapper<>(param.getValue().getValue().size()));
    tableItems.setCellValueFactory(param -> new ReadOnlyStringWrapper(String.join(", ", param.getValue().getValue())));

    ContextMenu tableContextMenu = new ContextMenu();
    MenuItem copyMenuItem = new MenuItem("Copy items");
    copyMenuItem.setOnAction(event -> {
        String text = combinationTable.getSelectionModel().getSelectedItems().stream().flatMap(it -> it.getValue().stream()).collect(Collectors.joining("\n"));
        ClipboardContent content = new ClipboardContent();
        content.putString(text);
        Clipboard.getSystemClipboard().setContent(content);
    });
    tableContextMenu.getItems().add(copyMenuItem);
    combinationTable.setContextMenu(tableContextMenu);


    splitter.getDividers().get(0).positionProperty().addListener((observable, oldValue, newValue) -> {
        refreshVennFigure();
    });
    splitter2.getDividers().get(0).positionProperty().addListener((observable, oldValue, newValue) -> {
        refreshVennFigure();
    });
    splitter2.boundsInLocalProperty().addListener((observable, oldValue, newValue) -> {
        refreshVennFigure();
    });

    addGroup().setElements(Arrays.asList("A", "B", "C"));
    addGroup().setElements(Arrays.asList("B", "C", "D"));
    groupViewControllerList.get(0).getTitledPane().setExpanded(true);
    modified = false;
}
 
开发者ID:informationsea,项目名称:VennDraw,代码行数:40,代码来源:MainWindowController.java

示例11: initialize

import javafx.beans.property.ReadOnlyStringWrapper; //导入依赖的package包/类
@FXML
private void initialize() {
    // replaces CONSTRAINED_RESIZE_POLICY
    summaryCol.prefWidthProperty().bind(
        table.widthProperty()
        .subtract(timeCol.widthProperty())
        .subtract(levelCol.widthProperty())
        .subtract(fromCol.widthProperty())
    );

    table.itemsProperty().bind(MessageLogger.messagesProperty());

    final DateFormat df = DateFormat.getTimeInstance();
    timeCol.setCellValueFactory((r) ->
        new ReadOnlyStringWrapper(df.format(new Date(r.getValue().timestamp))));
    levelCol.setCellValueFactory((r) ->
        new ReadOnlyStringWrapper(r.getValue().level.toString()));
    fromCol.setCellValueFactory((r) ->
        new ReadOnlyStringWrapper(r.getValue().from));
    summaryCol.setCellValueFactory((r) ->
        new ReadOnlyStringWrapper(r.getValue().summary));

    table.getSelectionModel().selectedItemProperty().addListener((o, oldValue, newValue) -> {
        if (newValue != null) {
            detailsField.setText(newValue.summary + '\n' + newValue.details);
        } else {
            detailsField.setText("");
        }
    });

    logLevel.getItems().setAll(Message.Level.values());
    logLevel.getSelectionModel().select(MessageLogger.logLevelProperty().get());
    logLevel.getSelectionModel().selectedItemProperty().addListener(
        (o, oldValue, newValue) -> MessageLogger.logLevelProperty().set(newValue));
}
 
开发者ID:alvanson,项目名称:xltsearch,代码行数:36,代码来源:MessageDisplay.java

示例12: loadToDoLists

import javafx.beans.property.ReadOnlyStringWrapper; //导入依赖的package包/类
private void loadToDoLists() {
    toDoList = FXCollections.observableArrayList();
    toDoList.addAll(toDoDAO.getToDoList());

    toDoTitel.setCellValueFactory(cellData -> new ReadOnlyStringWrapper(((String) cellData.getValue().getTitle())));
    toDoCategory.setCellValueFactory(cellData -> new ReadOnlyStringWrapper(((String) cellData.getValue().getCategory())));
    toDoDescription.setCellValueFactory(cellData -> new ReadOnlyStringWrapper(((String) cellData.getValue().getDescription())));
    toDoDateCreated.setCellValueFactory(cellData -> new ReadOnlyStringWrapper(new SimpleDateFormat("yyyy-MM-dd").format(cellData.getValue().getDateCreated())));

    // toDoTable.setItems(null);
    toDoTable.setItems(toDoList);

}
 
开发者ID:MauernChu,项目名称:ProgrammingExam,代码行数:14,代码来源:ToDoListController.java

示例13: ObservableEntity

import javafx.beans.property.ReadOnlyStringWrapper; //导入依赖的package包/类
public ObservableEntity(Entity entity) {
    this.entity = entity;
    index = new ReadOnlyStringWrapper(String.valueOf(entity.getIndex()));
    name = new ReadOnlyStringWrapper(entity.getDtClass().getDtName());
    List<FieldPath> fieldPaths = entity.getDtClass().collectFieldPaths(entity.getState());
    for (FieldPath fieldPath : fieldPaths) {
        indices.add(fieldPath);
        properties.add(new ObservableEntityProperty(entity, fieldPath));
    }
}
 
开发者ID:spheenik,项目名称:clarity-analyzer,代码行数:11,代码来源:ObservableEntity.java

示例14: createTable

import javafx.beans.property.ReadOnlyStringWrapper; //导入依赖的package包/类
private Node createTable() {
    recentProjectsTable.setPrefWidth(TABLE_WIDTH);
    TableColumn<File, String> recentProjectsPathColumn = new TableColumn<>("Recent Projects");
    recentProjectsPathColumn.setCellValueFactory(cellData -> new ReadOnlyStringWrapper(cellData.getValue().getPath()));
    recentProjectsTable.getColumns().add(recentProjectsPathColumn);
    recentProjectsTable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
    return recentProjectsTable;
}
 
开发者ID:khasang,项目名称:Cachoeira,代码行数:9,代码来源:StartWindowView.java

示例15: getProperty

import javafx.beans.property.ReadOnlyStringWrapper; //导入依赖的package包/类
/**
 * Returns an Observable Property which contains the localized string for the given identifier.
 *
 * @param identifier the identifier
 * @return a property with the localized string
 */
public static ReadOnlyStringProperty getProperty(final String identifier) {
    ReadOnlyStringWrapper localizedProperty = new ReadOnlyStringWrapper();

    addObserverFor(identifier, (locale, text) -> localizedProperty.set(text));

    return localizedProperty.getReadOnlyProperty();
}
 
开发者ID:openbase,项目名称:bco.bcozy,代码行数:14,代码来源:LanguageSelection.java


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