/* * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package com.sun.javafx.scene.control.behavior; import javafx.scene.control.FocusModel; import javafx.scene.control.ListCell; import javafx.scene.control.ListView; import javafx.scene.control.MultipleSelectionModel; import java.util.Collections; public class ListCellBehavior extends CellBehaviorBase> { /*************************************************************************** * * * Constructors * * * **************************************************************************/ public ListCellBehavior(ListCell control) { super(control, Collections.emptyList()); } /*************************************************************************** * * * Public API * * * **************************************************************************/ @Override protected MultipleSelectionModel getSelectionModel() { return getCellContainer().getSelectionModel(); } @Override protected FocusModel getFocusModel() { return getCellContainer().getFocusModel(); } @Override protected ListView getCellContainer() { return getControl().getListView(); } @Override protected void edit(ListCell cell) { int index = cell == null ? -1 : cell.getIndex(); getCellContainer().edit(index); } }