javafx.scene.control.TextField#setEditable ( )源码实例Demo

下面列出了javafx.scene.control.TextField#setEditable ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: bisq   文件: FormBuilder.java
public static Tuple3<Label, TextField, Button> addTopLabelTextFieldButton(GridPane gridPane,
                                                                          int rowIndex,
                                                                          String title,
                                                                          String buttonTitle,
                                                                          double top) {

    TextField textField = new BisqTextField();
    textField.setEditable(false);
    textField.setMouseTransparent(true);
    textField.setFocusTraversable(false);
    Button button = new AutoTooltipButton(buttonTitle);
    button.setDefaultButton(true);

    HBox hBox = new HBox();
    hBox.setSpacing(10);
    hBox.getChildren().addAll(textField, button);
    HBox.setHgrow(textField, Priority.ALWAYS);

    final Tuple2<Label, VBox> labelVBoxTuple2 = addTopLabelWithVBox(gridPane, rowIndex, title, hBox, top);

    return new Tuple3<>(labelVBoxTuple2.first, textField, button);
}
 
源代码2 项目: bisq   文件: FormBuilder.java
public static Tuple4<Label, TextField, Label, TextField> addCompactTopLabelTextFieldTopLabelTextField(GridPane gridPane,
                                                                                                      int rowIndex,
                                                                                                      String title1,
                                                                                                      String title2) {
    TextField textField1 = new BisqTextField();
    textField1.setEditable(false);
    textField1.setMouseTransparent(true);
    textField1.setFocusTraversable(false);

    final Tuple2<Label, VBox> topLabelWithVBox1 = getTopLabelWithVBox(title1, textField1);

    TextField textField2 = new BisqTextField();
    textField2.setEditable(false);
    textField2.setMouseTransparent(true);
    textField2.setFocusTraversable(false);

    final Tuple2<Label, VBox> topLabelWithVBox2 = getTopLabelWithVBox(title2, textField2);

    HBox hBox = new HBox();
    hBox.setSpacing(10);
    hBox.getChildren().addAll(topLabelWithVBox1.second, topLabelWithVBox2.second);
    GridPane.setRowIndex(hBox, rowIndex);
    gridPane.getChildren().add(hBox);

    return new Tuple4<>(topLabelWithVBox1.first, textField1, topLabelWithVBox2.first, textField2);
}
 
源代码3 项目: helloiot   文件: EditView.java
@Override
public Node constructContent() {
    
    boxview = new HBox();
    boxview.setSpacing(6.0);

    statusview = new TextField();
    statusview.setEditable(false);
    statusview.setFocusTraversable(false);
    statusview.getStyleClass().add("unitinputview");
    HBox.setHgrow(statusview, Priority.SOMETIMES);
    
    boxview.getChildren().add(statusview);

    initialize();
    return boxview;
}
 
源代码4 项目: JRemapper   文件: CodePane.java
/**
 * Update the current selected class.
 * 
 * @param c
 *            The newly selected class.
 */
private void updateSelection(CDec c) {
	selectedDec = c;
	info.getChildren().clear();
	info.add(new Label("Class name"), 0, 0);
	TextField name = new TextField();
	if (c.hasMappings()) {
		name.setText(c.map().getCurrentName());
	} else {
		name.setText(c.getFullName());
		name.setEditable(false);
	}
	if (c.isLocked())
		name.setDisable(true);
	info.add(name, 1, 0);
	name.addEventHandler(KeyEvent.KEY_PRESSED, (KeyEvent e) -> {
		if (KeyCode.ENTER == e.getCode()) {
			pass = -2;
			c.map().setCurrentName(name.getText());
			refreshCode();
			resetSelection();
			updateStyleAndRegions();
		}
	});
}
 
源代码5 项目: mzmine3   文件: NeutralMassComponent.java
public NeutralMassComponent() {

    add(new Label("m/z:"), 0, 0);

    ionMassField = new TextField();
    ionMassField.textProperty().addListener((observable, oldValue, newValue) -> {
      updateNeutralMass();
    });
    ionMassField.setPrefColumnCount(8);
    add(ionMassField, 1, 0);

    add(new Label("Charge:"), 2, 0);

    chargeField = new TextField();
    chargeField.textProperty().addListener((observable, oldValue, newValue) -> {
      updateNeutralMass();
    });
    chargeField.setPrefColumnCount(2);
    add(chargeField, 3, 0);

    add(new Label("Ionization type:"), 0, 1, 2, 1);
    ionTypeCombo =
        new ComboBox<IonizationType>(FXCollections.observableArrayList(IonizationType.values()));
    ionTypeCombo.setOnAction(e -> {
      updateNeutralMass();
    });
    add(ionTypeCombo, 2, 1, 2, 1);

    add(new Label("Calculated mass:"), 0, 2, 2, 1);

    neutralMassField = new TextField();
    neutralMassField.setPrefColumnCount(8);
    neutralMassField.setStyle("-fx-background-color: rgb(192, 224, 240);");
    neutralMassField.setEditable(false);
    add(neutralMassField, 2, 2, 2, 1);

  }
 
源代码6 项目: dm3270   文件: TransfersTab.java
private HBox getLine (Label label, TextField text, HBox hbox)
{
  HBox line = new HBox (10);

  line.getChildren ().addAll (label, text, hbox);
  label.setPrefWidth (LABEL_WIDTH);
  text.setPrefWidth (100);
  text.setFont (defaultFont);
  text.setEditable (true);
  text.setFocusTraversable (true);

  return line;
}
 
源代码7 项目: bisq   文件: JapanBankTransferForm.java
private void addBankAccountTypeDisplay() // {{{
{
    TradeCurrency singleTradeCurrency = japanBankAccount.getSingleTradeCurrency();
    String currency = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
    String accountTypeText = currency + " " + japanBankAccount.getBankAccountType();
    TextField accountTypeTextField = addCompactTopLabelTextField(gridPane, ++gridRow, JapanBankData.getString("account.type"), accountTypeText).second;
    accountTypeTextField.setEditable(false);
}
 
源代码8 项目: marathonv5   文件: CheckListFormNode.java
private VBox createNameField() {
    VBox nameFieldBox = new VBox();
    TextField nameField = new TextField();
    nameField.textProperty().addListener((observable, oldValue, newValue) -> {
        fireContentChanged();
        checkList.setName(nameField.getText());
    });
    nameField.setEditable(mode.isSelectable());
    nameFieldBox.getChildren().addAll(new Label("Name"), nameField);
    HBox.setHgrow(nameField, Priority.ALWAYS);
    VBox.setMargin(nameFieldBox, new Insets(5, 10, 0, 5));
    nameField.setText(checkList.getName());
    HBox.setHgrow(nameFieldBox, Priority.ALWAYS);
    return nameFieldBox;
}
 
源代码9 项目: phoebus   文件: PropertiesAction.java
private Node createContent()
{
    final GridPane layout = new GridPane();
    layout.setHgap(5);
    layout.setVgap(5);

    int row = 0;

    final TextField filename = new TextField(file.getAbsolutePath());
    filename.setEditable(false);
    GridPane.setHgrow(filename, Priority.ALWAYS);
    layout.add(new Label(Messages.PropDlgPath), 0, row);
    layout.add(filename, 1, row);

    final TextField date = new TextField(TimestampFormats.MILLI_FORMAT.format(Instant.ofEpochMilli(file.lastModified())));
    date.setEditable(false);
    date.setMinWidth(200);
    GridPane.setHgrow(date, Priority.ALWAYS);
    layout.add(new Label(Messages.PropDlgDate), 0, ++row);
    layout.add(date, 1, row);

    if (!file.isDirectory())
    {
        final TextField size = new TextField(file.length() + " " + Messages.PropDlgBytes);
        size.setEditable(false);
        GridPane.setHgrow(size, Priority.ALWAYS);
        layout.add(new Label(Messages.PropDlgSize), 0, ++row);
        layout.add(size, 1, row);
    }

    layout.add(new Label(Messages.PropDlgPermissions), 0, ++row);
    layout.add(writable, 1, row);
    layout.add(executable, 1, ++row);

    writable.setSelected(file.canWrite());
    executable.setSelected(file.canExecute());

    return layout;
}
 
源代码10 项目: xframium-java   文件: TransfersTab.java
private HBox getLine (RadioButton button, TextField text)
{
  HBox line = new HBox (10);
  line.getChildren ().addAll (button, text);
  button.setPrefWidth (LABEL_WIDTH);
  text.setPrefWidth (300);
  text.setFont (defaultFont);
  text.setEditable (false);
  text.setFocusTraversable (false);
  button.setUserData (text);

  return line;
}
 
源代码11 项目: xframium-java   文件: TransfersTab.java
private HBox getLine (Label label, TextField text, HBox hbox)
{
  HBox line = new HBox (10);

  line.getChildren ().addAll (label, text, hbox);
  label.setPrefWidth (LABEL_WIDTH);
  text.setPrefWidth (100);
  text.setFont (defaultFont);
  text.setEditable (true);
  text.setFocusTraversable (true);

  return line;
}
 
源代码12 项目: trex-stateless-gui   文件: PacketHex.java
/**
 *
 */
public TextFieldCell() {
    textField = new TextField();
    textField.addEventFilter(KeyEvent.KEY_TYPED, hex_Validation(50));
    textField.getStyleClass().add("hexTextFieldEditor");
    textField.setEditable(false);
    textField.setOnMouseClicked((MouseEvent mouseEvent) -> {
        if (mouseEvent.getButton().equals(MouseButton.PRIMARY) && mouseEvent.getClickCount() == 2) {
            handleMouseClickedEvent();
        }
    });
    this.setGraphic(textField);
}
 
源代码13 项目: bisq   文件: MutableOfferView.java
private void addPayInfoEntry(GridPane infoGridPane, int row, String labelText, String value) {
    Label label = new AutoTooltipLabel(labelText);
    TextField textField = new TextField(value);
    textField.setMinWidth(500);
    textField.setEditable(false);
    textField.setFocusTraversable(false);
    textField.setId("payment-info");
    GridPane.setConstraints(label, 0, row, 1, 1, HPos.RIGHT, VPos.CENTER);
    GridPane.setConstraints(textField, 1, row);
    infoGridPane.getChildren().addAll(label, textField);
}
 
源代码14 项目: bisq   文件: TakeOfferView.java
private void addPayInfoEntry(GridPane infoGridPane, int row, String labelText, String value) {
    Label label = new AutoTooltipLabel(labelText);
    TextField textField = new TextField(value);
    textField.setMinWidth(500);
    textField.setEditable(false);
    textField.setFocusTraversable(false);
    textField.setId("payment-info");
    GridPane.setConstraints(label, 0, row, 1, 1, HPos.RIGHT, VPos.CENTER);
    GridPane.setConstraints(textField, 1, row);
    infoGridPane.getChildren().addAll(label, textField);
}
 
源代码15 项目: constellation   文件: AttributeEditorPanel.java
private Node createAttributeValueNode(final Object[] values, final AttributeData attribute, final AttributeTitledPane parent, final boolean multiValue) {

        boolean noneSelected = values == null;
        boolean isNull = !noneSelected && (values[0] == null);
        parent.setAttribute(attribute);

        AbstractAttributeInteraction<?> interaction = AbstractAttributeInteraction.getInteraction(attribute.getDataType());

        final String displayText;
        final List<Node> displayNodes;
        if (multiValue) {
            displayText = "<Multiple Values>";
            displayNodes = Collections.emptyList();
        } else if (isNull) {
            displayText = NO_VALUE_TEXT;
            displayNodes = Collections.emptyList();
        } else if (noneSelected) {
            displayText = "<Nothing Selected>";
            displayNodes = Collections.emptyList();
        } else {
            displayText = interaction.getDisplayText(values[0]);
            displayNodes = interaction.getDisplayNodes(values[0], -1, CELL_ITEM_HEIGHT);
        }

        parent.setAttributeValue(displayText);
        final TextField attributeValueText = new TextField(displayText);
        attributeValueText.setEditable(false);
        if (noneSelected || isNull || multiValue) {
            attributeValueText.getStyleClass().add("undisplayedValue");
        }

        if (displayNodes.isEmpty()) {
            return attributeValueText;
        }

        GridPane gridPane = new GridPane();
        gridPane.setAlignment(Pos.CENTER_RIGHT);
        gridPane.setPadding(Insets.EMPTY);
        gridPane.setHgap(CELL_ITEM_SPACING);
        ColumnConstraints displayNodeConstraint = new ColumnConstraints(CELL_ITEM_HEIGHT);
        displayNodeConstraint.setHalignment(HPos.LEFT);
        ColumnConstraints displayTextConstraint = new ColumnConstraints();
        displayTextConstraint.setHalignment(HPos.RIGHT);
        displayTextConstraint.setHgrow(Priority.ALWAYS);
        displayTextConstraint.setFillWidth(true);

        for (int i = 0; i < displayNodes.size(); i++) {
            final Node displayNode = displayNodes.get(i);
            gridPane.add(displayNode, i, 0);
            gridPane.getColumnConstraints().add(displayNodeConstraint);
        }

        gridPane.add(attributeValueText, displayNodes.size(), 0);
        gridPane.getColumnConstraints().add(displayTextConstraint);

        return gridPane;
    }
 
源代码16 项目: paintera   文件: LockFileAlreadyExistsDialog.java
public static void showDialog(final LockFile.UnableToCreateLock exception)
{
	final Alert alert = new Alert(AlertType.ERROR);
	alert.setTitle("Paintera");
	alert.setHeaderText("Unable to create lock file.");

	final Label instructions = new Label(
			"If no other Paintera instance is accessing the same project please delete lock file and try to " +
					"restart Paintera.");
	instructions.setWrapText(true);

	final GridPane  content      = new GridPane();
	final Label     fileLabel    = new Label("Lock File");
	final Label     messageLabel = new Label("Message");
	final TextField fileField    = new TextField(exception.getLockFile().getAbsolutePath());
	final TextField messageField = new TextField(exception.getMessage());
	fileField.setTooltip(new Tooltip(fileField.getText()));
	messageField.setTooltip(new Tooltip(messageField.getText()));

	fileField.setEditable(false);
	messageField.setEditable(false);

	GridPane.setHgrow(fileField, Priority.ALWAYS);
	GridPane.setHgrow(messageField, Priority.ALWAYS);

	content.add(fileLabel, 0, 0);
	content.add(messageLabel, 0, 1);
	content.add(fileField, 1, 0);
	content.add(messageField, 1, 1);

	final VBox contentBox = new VBox(instructions, content);

	alert.getDialogPane().setContent(contentBox);

	final StringWriter stringWriter = new StringWriter();
	exception.printStackTrace(new PrintWriter(stringWriter));
	final String   exceptionText = stringWriter.toString();
	final TextArea textArea      = new TextArea(exceptionText);
	textArea.setEditable(false);
	textArea.setWrapText(true);

	LOG.trace("Exception text (length={}): {}", exceptionText.length(), exceptionText);

	textArea.setMaxWidth(Double.MAX_VALUE);
	textArea.setMaxHeight(Double.MAX_VALUE);
	GridPane.setVgrow(textArea, Priority.ALWAYS);
	GridPane.setHgrow(textArea, Priority.ALWAYS);

	//		final GridPane expandableContent = new GridPane();
	//		expandableContent.setMaxWidth( Double.MAX_VALUE );
	//
	//		expandableContent.add( child, columnIndex, rowIndex );

	alert.getDialogPane().setExpandableContent(textArea);

	//		alert.setResizable( true );
	alert.showAndWait();
}
 
源代码17 项目: bisq   文件: JapanBankTransferForm.java
private void addBankBranchDisplay() // {{{
{
    String branchText = japanBankAccount.getBankBranchCode() + " " + japanBankAccount.getBankBranchName();
    TextField branchTextField = addCompactTopLabelTextField(gridPane, ++gridRow, JapanBankData.getString("branch"), branchText).second;
    branchTextField.setEditable(false);
}
 
源代码18 项目: bisq   文件: JapanBankTransferForm.java
private void addBankDisplay() // {{{
{
    String bankText = japanBankAccount.getBankCode() + " " + japanBankAccount.getBankName();
    TextField bankTextField = addCompactTopLabelTextField(gridPane, ++gridRow, JapanBankData.getString("bank"), bankText).second;
    bankTextField.setEditable(false);
}
 
源代码19 项目: helloiot   文件: EditStatus.java
@Override
public Node constructContent() {
    
    StackPane stackpaneroot = new StackPane();
    
    boxview = new HBox();
    boxview.setSpacing(6.0);
    
    statusview = new TextField();
    statusview.setEditable(false);
    statusview.setFocusTraversable(false);
    statusview.getStyleClass().add("unitinputview");
    HBox.setHgrow(statusview, Priority.SOMETIMES);
    
    editaction = new Button();
    editaction.setFocusTraversable(false);
    editaction.setMnemonicParsing(false);
    editaction.getStyleClass().add("unitbutton");
    editaction.setOnAction(this::onEditEvent);
    
    boxview.getChildren().addAll(statusview, editaction);
    
    boxedit = new HBox();
    boxedit.setSpacing(6.0);
    boxedit.setVisible(false);
    
    statusedit = new TextField();
    statusedit.getStyleClass().add("unitinput");
    HBox.setHgrow(statusedit, Priority.SOMETIMES);
    ((TextField) statusedit).setOnAction(this::onEnterEvent);
    
    okaction = new Button();
    okaction.setFocusTraversable(false);
    okaction.setMnemonicParsing(false);
    okaction.getStyleClass().add("unitbutton");
    okaction.setOnAction(this::onOkEvent);
    
    cancelaction = new Button();
    cancelaction.setFocusTraversable(false);
    cancelaction.setMnemonicParsing(false);
    cancelaction.getStyleClass().add("unitbutton");
    cancelaction.setOnAction(this::onCancelEvent);
    
    boxedit.getChildren().addAll(statusedit, okaction, cancelaction);
    
    stackpaneroot.getChildren().addAll(boxview, boxedit);

    initialize();
    return stackpaneroot;
}
 
源代码20 项目: bisq   文件: JapanBankTransferForm.java
private void addBankAccountDisplay() // {{{
{
    String accountText = japanBankAccount.getBankAccountNumber() + " " + japanBankAccount.getBankAccountName();
    TextField accountTextField = addCompactTopLabelTextField(gridPane, ++gridRow, JapanBankData.getString("account"), accountText).second;
    accountTextField.setEditable(false);
}