< prev index next >

modules/javafx.controls/src/main/java/javafx/scene/control/TextInputControl.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 564,574 **** // we don't need to create a new undo record. In all other cases // we do. int endOfUndoChange = undoChange == undoChangeHead ? -1 : undoChange.start + undoChange.newText.length(); String newText = getText(change.start, change.start + change.text.length() - adjustmentAmount); if (createNewUndoRecord || nonEmptySelection || endOfUndoChange == -1 || forceNewUndoRecord || ! (endOfUndoChange != change.start && endOfUndoChange != change.end) || change.start - change.end > 1) { undoChange = undoChange.add(change.start, oldText, newText); } else if (change.start != change.end && change.text.isEmpty()) { // I know I am deleting, and am located at the end of the range of the current undo record if (undoChange.newText.length() > 0) { undoChange.newText = undoChange.newText.substring(0, change.start - undoChange.start); --- 564,574 ---- // we don't need to create a new undo record. In all other cases // we do. int endOfUndoChange = undoChange == undoChangeHead ? -1 : undoChange.start + undoChange.newText.length(); String newText = getText(change.start, change.start + change.text.length() - adjustmentAmount); if (createNewUndoRecord || nonEmptySelection || endOfUndoChange == -1 || forceNewUndoRecord || ! (endOfUndoChange != change.start && endOfUndoChange != change.end) || change.end - change.start > 1) { undoChange = undoChange.add(change.start, oldText, newText); } else if (change.start != change.end && change.text.isEmpty()) { // I know I am deleting, and am located at the end of the range of the current undo record if (undoChange.newText.length() > 0) { undoChange.newText = undoChange.newText.substring(0, change.start - undoChange.start);
< prev index next >