|
What this is
Other links
The source code/*
* Sun Public License Notice
*
* The contents of this file are subject to the Sun Public License
* Version 1.0 (the "License"). You may not use this file except in
* compliance with the License. A copy of the License is available at
* http://www.sun.com/
*
* The Original Code is NetBeans. The Initial Developer of the Original
* Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
* Microsystems, Inc. All Rights Reserved.
*/
package org.openide.text;
import javax.swing.JEditorPane;
import javax.swing.text.*;
/** performance trick - 18% of time saved during open of an editor
*
* @author Ales Novak
*/
final class QuietEditorPane extends JEditorPane {
final static int FIRE = 0x1;
final static int PAINT = 0x2;
final static int ALL = FIRE | PAINT;
// #21120. Caret was null while serializing CloneableEditor.
/** Saves last position of caret when, doing it's UI reinstallation. */
private int lastPosition = -1;
/** is firing of events enabled? */
int working = FIRE; // [Mila] firing since begining, otherwise doesn't work well
public void setWorking(int x) {
working = x;
}
public void firePropertyChange(String s, Object val1, Object val2) {
if ((working & FIRE) != 0) {
super.firePropertyChange(s, val1, val2);
}
}
/** Overrides superclass method, to keep old caret position.
* While is reinstallation of UI in progress, there
* is a gap between the uninstallUI
* and intstallUI when caret set to
|
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.