Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8094950

[CSS] javafx.scene.CssStyleHelper calculateValue WARNING: Could not resolve (TableView with ComboBox cell)

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u20
    • Fix Version/s: 8u20
    • Component/s: javafx
    • Labels:
      None
    • Environment:

      8u20b11, MacBook Air 2012

      Description

      Description

      Editing a TableCell using a ComboBox cell editor generates CSS warning messages.

      Reproduction steps:

      1. Run the sample code.
      2. Click on a cell in the table to start editing it.
      3. Select a new value for the cell from the drop down combo.
      4. Warning messages will be printed to system.err.

      Warning message sample:

      May 05, 2014 11:25:57 PM javafx.scene.CssStyleHelper calculateValue
      WARNING: Could not resolve '-fx-text-background-color' while resolving lookups for '-fx-text-fill' from rule '*.list-cell' in stylesheet jar:file:/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/jre/lib/ext/jfxrt.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
      May 05, 2014 11:25:57 PM javafx.scene.CssStyleHelper calculateValue
      WARNING: Could not resolve '-fx-selection-bar' while resolving lookups for '-fx-background-color' from rule '*.combo-box-popup>*.list-view>*.virtual-flow>*.clipped-container>*.sheet>*.list-cell:hover:filled:selected' in stylesheet jar:file:/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/jre/lib/ext/jfxrt.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss

      Sample code:

      import javafx.application.Application;
      import javafx.beans.property.SimpleObjectProperty;
      import javafx.collections.*;
      import javafx.scene.Scene;
      import javafx.scene.control.*;
      import javafx.scene.control.cell.*;
      import javafx.stage.Stage;

      public class ComboTableStyleWarning extends Application {

          public enum Day { mon, tue, wed, thu, fri }

          private final ObservableList<WorkDay> data = FXCollections.observableArrayList(
                  new WorkDay(Day.mon),
                  new WorkDay(Day.fri),
                  new WorkDay(Day.thu)
          );

          public static void main(String[] args) {
              launch(args);
          }

          @Override
          public void start(Stage stage) {
              TableColumn<WorkDay, Day> dayCol = new TableColumn<>("Work Day");
              dayCol.setMinWidth(100);
              dayCol.setCellValueFactory(new PropertyValueFactory<>("day"));
              dayCol.setCellFactory(ComboBoxTableCell.<WorkDay, Day>forTableColumn(Day.values()));
              dayCol.setEditable(true);

              TableView<WorkDay> table = new TableView<>();
              table.setEditable(true);
              table.setItems(data);
              table.getColumns().addAll(dayCol);

              stage.setTitle("**Double-click a day to edit it**");
              stage.setScene(new Scene(table));
              stage.show();
          }
       
          public static class WorkDay {
       
              private final SimpleObjectProperty<Day> day;
       
              private WorkDay(Day day) {
                  this.day = new SimpleObjectProperty<>(day);
              }

              public Day getDay() {
                  return day.get();
              }

              public void setDay(Day day) {
                  this.day.set(day);
              }
          }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dgrieve David Grieve
                Reporter:
                josmithjfx John Smith (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: