19 | *
20 | * PENDING JW:
21 | * let choiceBox support a list of separators independent of the actual data
22 | *
23 | * @author Jeanette Winzenburg, Berlin
24 | */
25 | public interface SeparatorMarker {
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/fx8-swingempire/src/java/de/swingempire/fx/scene/control/skin/patch/VirtualContainerBase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Created on 15.03.2016
3 | *
4 | */
5 | package de.swingempire.fx.scene.control.skin.patch;
6 |
7 | import javafx.scene.control.Control;
8 | import javafx.scene.control.IndexedCell;
9 |
10 | /**
11 | * The glue layer: must talk to either patch8 or patch9.
12 | *
13 | * @author Jeanette Winzenburg, Berlin
14 | */
15 | public abstract class VirtualContainerBase
15 | *
16 | * Allows the skin to hook into the event dispatch chain, provided
17 | * it is of type EventTarget (which is created by default for this view).
18 | *
19 | * @author Jeanette Winzenburg, Berlin
20 | */
21 | public class TableViewET
15 | *
16 | * Simply removing the responsibility of updating from FocusModel blows if
17 | * focus != selectedIndex.
18 | *
19 | * With this tagging interface, we move the responsibility completely
20 | * to the SelectionModel (aka: primary
21 | * controller): it has to update the focus internally.
22 | *
23 | *
24 | * Note: refactored to tagging (vs. providing a hook for rooting) looks fine so far.
25 | * PENDING JW: handle default focus
26 | *
27 | *
28 | * @author Jeanette Winzenburg, Berlin
29 | */
30 | public interface FocusModelSlave extends TableRow {
18 |
19 | /**
20 | * Overridden to allow the skin to hook into the event dispatch chain,
21 | * before calling super.
22 | */
23 | @Override
24 | public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) {
25 | if (getSkin() instanceof EventTarget) {
26 | ((EventTarget) getSkin()).buildEventDispatchChain(tail);
27 | }
28 | return super.buildEventDispatchChain(tail);
29 | }
30 |
31 | /**
32 | * Overridden to return a skin that implements EventTarget.
33 | */
34 | @Override
35 | protected Skin> createDefaultSkin() {
36 | return new TableRowETSkin<>(this);
37 | }
38 |
39 |
40 |
41 | public TableRowET() {
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/fx8-swingempire/src/demo/de/swingempire/fx/scene/control/comboboxx/EditableComboActionHandlerRT_35586.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Created on 02.10.2014
3 | *
4 | */
5 | package de.swingempire.fx.scene.control.comboboxx;
6 |
7 | import javafx.application.Application;
8 | import javafx.event.ActionEvent;
9 | import javafx.event.EventHandler;
10 | import javafx.scene.Scene;
11 | import javafx.scene.control.ComboBox;
12 | import javafx.stage.Stage;
13 |
14 | /**
15 | * https://javafx-jira.kenai.com/browse/RT-35586
16 | * actionHandler notified twice
17 | *
18 | * fixed in 8u20
19 | */
20 | public class EditableComboActionHandlerRT_35586 extends Application {
21 | public static void main(String[] args) {
22 | launch(args);
23 | }
24 |
25 | @Override
26 | public void start(Stage primaryStage) throws Exception {
27 | final ComboBox extends TableCellSkinBase> {
19 |
20 | private final TableCell tableCell;
21 | private final TableColumn tableColumn;
22 |
23 | public XTableCellSkin(TableCell tableCell) {
24 | super(tableCell, new XTableCellBehavior(tableCell));
25 |
26 | this.tableCell = tableCell;
27 | this.tableColumn = tableCell.getTableColumn();
28 |
29 | super.init(tableCell);
30 | }
31 |
32 | @Override protected BooleanProperty columnVisibleProperty() {
33 | return tableColumn.visibleProperty();
34 | }
35 |
36 | @Override protected ReadOnlyDoubleProperty columnWidthProperty() {
37 | return tableColumn.widthProperty();
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/fx8-swingempire/src/demo/de/swingempire/fx/control/ComboBoxSize.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Created on 31.08.2014
3 | *
4 | */
5 | package de.swingempire.fx.control;
6 |
7 | import javafx.application.Application;
8 | import javafx.collections.FXCollections;
9 | import javafx.collections.ObservableList;
10 | import javafx.scene.Parent;
11 | import javafx.scene.Scene;
12 | import javafx.scene.control.ComboBox;
13 | import javafx.stage.Stage;
14 |
15 | /**
16 | * combo sizing not fully configurable
17 | * http://stackoverflow.com/q/24852429/203657
18 | * @author Jeanette Winzenburg, Berlin
19 | */
20 | public class ComboBoxSize extends Application {
21 |
22 | /**
23 | * @return
24 | */
25 | private Parent getContent() {
26 | ObservableList extends TableView {
22 |
23 | /**
24 | * Overridden to allow the skin hook into the dispatch chain before
25 | * calling super, if the skin is of type EventTarget.
26 | */
27 | @Override
28 | public EventDispatchChain buildEventDispatchChain(
29 | EventDispatchChain tail) {
30 | if (getSkin() instanceof EventTarget) {
31 | ((EventTarget) getSkin()).buildEventDispatchChain(tail);
32 | }
33 | return super.buildEventDispatchChain(tail);
34 | }
35 |
36 |
37 | /**
38 | * Overridden to create and return a TableViewSkin
39 | * which implements EventTarget.
40 | */
41 | @Override
42 | protected Skin> createDefaultSkin() {
43 | return new TableViewETSkin<>(this);
44 | }
45 |
46 | //---------- boiler-plate: super's constructors
47 | public TableViewET() {
48 | this(null);
49 | }
50 |
51 | public TableViewET(ObservableList items) {
52 | super(items);
53 | setRowFactory(p -> new TableRowET<>());
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/fx8-swingempire/src/java/de/swingempire/fx/scene/control/choiceboxx/ChoiceBoxRT38724.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Created on 23.09.2014
3 | *
4 | */
5 | package de.swingempire.fx.scene.control.choiceboxx;
6 |
7 | import javafx.beans.value.ChangeListener;
8 | import javafx.collections.ObservableList;
9 | import javafx.scene.control.ChoiceBox;
10 | import javafx.scene.control.SingleSelectionModel;
11 | import javafx.scene.control.Skin;
12 |
13 | /**
14 | * Quick fix for RT-38724: update value on change of selectionModel.
15 | *
16 | * Has two parts:
17 | *
18 | *
22 | *
23 | * @author Jeanette Winzenburg, Berlin
24 | */
25 | public class ChoiceBoxRT38724select(index) during its own update.
13 | * FocusModel can't know whether or not that had happened, so the net effect
14 | * occasionally is doubling of the update. extends TableViewSkin implements EventTarget {
23 |
24 | EventHandlerManager eventHandlerManager = new EventHandlerManager(this);
25 | @Override
26 | public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) {
27 | TablePosition focused = getFocusedCell();
28 | if (focused != null) {
29 | TableColumn column = focused.getTableColumn();
30 | if (column != null) {
31 | column.buildEventDispatchChain(tail);
32 | // PENDING delegate without nesting
33 | int row = focused.getRow();
34 | if (row > -1) {
35 | IndexedCell rowCell = flow.getCell(row);
36 | rowCell.buildEventDispatchChain(tail);
37 | }
38 | }
39 | }
40 | // return tail.prepend(eventHandlerManager);
41 | return tail;
42 | }
43 |
44 | //---------------- boiler-plate constructor
45 |
46 | public TableViewETSkin(TableView tableView) {
47 | super(tableView);
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/fx8-swingempire/src/demo/de/swingempire/fx/scene/control/et/ContextMenuKeyboard.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Created on 03.03.2015
3 | *
4 | */
5 | package de.swingempire.fx.scene.control.et;
6 |
7 |
8 | import javafx.application.Application;
9 | import javafx.scene.Parent;
10 | import javafx.scene.Scene;
11 | import javafx.scene.control.Button;
12 | import javafx.scene.control.ContextMenu;
13 | import javafx.scene.control.MenuItem;
14 | import javafx.scene.layout.HBox;
15 | import javafx.stage.Stage;
16 |
17 | /**
18 | * ContextMenu:
19 | * user interaction broken when activated by keyboard.
20 | * https://javafx-jira.kenai.com/browse/RT-40175
21 | *
22 | * To reproduce, compile, run and activate contextMenu by keyboard (shift-f10 on win)
23 | *
24 | * variant A:
25 | * - press DOWN
26 | * - expected: next menu item highlighted
27 | * - actual: system menu of window opens
28 | *
29 | * variant B:
30 | * - press ESC
31 | * - expected: contextMenu hidden
32 | * - actual: nothing happens (needs a second ESC to hide)
33 | *
34 | * variant C
35 | * - move mouse over menu
36 | * - expected: menu item below mouse is highlighted
37 | * - actual: no visual change
38 | */
39 | public class ContextMenuKeyboard extends Application {
40 |
41 | private Parent getContent() {
42 | Button button = new Button("simple button with contextMenu");
43 | button.setContextMenu(new ContextMenu(new MenuItem("one"), new MenuItem("two")));
44 | Parent pane = new HBox(button);
45 | return pane;
46 | }
47 |
48 | @Override
49 | public void start(Stage primaryStage) throws Exception {
50 | Scene scene = new Scene(getContent());
51 | primaryStage.setScene(scene);
52 | primaryStage.show();
53 | }
54 |
55 | public static void main(String[] args) {
56 | launch(args);
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/fx8-swingempire/src/java/de/swingempire/fx/scene/control/et/TableRowETSkin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Created on 20.02.2015
3 | *
4 | */
5 | package de.swingempire.fx.scene.control.et;
6 |
7 | import java.lang.ref.Reference;
8 |
9 | import javafx.event.EventDispatchChain;
10 | import javafx.event.EventTarget;
11 | import javafx.scene.control.Cell;
12 | import javafx.scene.control.TableCell;
13 | import javafx.scene.control.TableColumn;
14 | import javafx.scene.control.TablePosition;
15 | import javafx.scene.control.TableRow;
16 | import javafx.scene.control.TableView;
17 |
18 | import com.sun.javafx.event.EventHandlerManager;
19 | import com.sun.javafx.scene.control.skin.TableRowSkin;
20 |
21 | /**
22 | * @author Jeanette Winzenburg, Berlin
23 | */
24 | public class TableRowETSkin