public class EditorUI extends Object implements ChangeListener, PropertyChangeListener, MouseListener
Modifier and Type | Field and Description |
---|---|
static String |
COMPONENT_PROPERTY |
static Insets |
defaultLineNumberMargin
Default margin on the left and right side of the line number
|
static String |
LINE_HEIGHT_CHANGED_PROP |
static String |
OVERWRITE_MODE_PROPERTY |
static int |
SCROLL_DEFAULT
Default scrolling type is used for the standard
setDot() call.
|
static int |
SCROLL_FIND
Scrolling type for find operations, that can
request additional configurable area in each
direction, so the context around is visible too.
|
static int |
SCROLL_MOVE
Scrolling type used for regular caret moves.
|
static int |
SCROLL_SMALLEST
Scrolling type where the smallest covering
for the requested rectangle is used.
|
static String |
TAB_SIZE_CHANGED_PROP |
Constructor and Description |
---|
EditorUI()
Construct extended UI for the use with a text component
|
EditorUI(BaseDocument printDoc)
Construct extended UI for printing the given document
|
EditorUI(BaseDocument printDoc,
boolean usePrintColoringMap,
boolean lineNumberEnabled)
Construct extended UI for printing the given document
and specify which set of colors should be used.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener l) |
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener l) |
void |
adjustCaret(int percentFromWindowTop)
Set the dot according to the currently visible screen window.
|
void |
adjustWindow(int caretPercentFromWindowTop) |
void |
caretMoveDot(int offset,
Rectangle scrollRect,
int scrollPolicy)
Deprecated.
|
void |
caretSetDot(int offset,
Rectangle scrollRect,
int scrollPolicy)
Deprecated.
|
protected Map |
createColoringMap()
Deprecated.
Use Editor Settings or Editor Settings Storage API instead.
This method is never called.
|
protected JComponent |
createExtComponent() |
protected JToolBar |
createToolBarComponent()
Construct the toolbar component appropriate for this editor.
|
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue) |
Abbrev |
getAbbrev()
Deprecated.
Use Editor Code Templates API instead.
|
Coloring |
getColoring(String coloringName)
Deprecated.
Use Editor Settings API instead.
|
Map<String,Coloring> |
getColoringMap()
Deprecated.
Use Editor Settings API instead.
|
JTextComponent |
getComponent() |
Object |
getComponentLock()
Get the lock assuring the component will not be changed
by installUI() or uninstallUI().
|
Coloring |
getDefaultColoring()
Deprecated.
Use Editor Settings API instead.
|
BaseDocument |
getDocument()
Get the document to work on.
|
JComponent |
getExtComponent()
Get extended editor component.
|
Rectangle |
getExtentBounds() |
Rectangle |
getExtentBounds(Rectangle r)
Get position of the component extent.
|
GlyphGutter |
getGlyphGutter() |
int |
getLineAscent() |
int |
getLineHeight() |
int |
getLineNumberDigitWidth()
Returns width of the one digit
|
Insets |
getLineNumberMargin()
Returns the line number margin
|
static Frame |
getParentFrame(Component c)
Finds the frame - parent of editor component
|
PopupManager |
getPopupManager() |
JPopupMenu |
getPopupMenu() |
Object |
getProperty(Object key) |
protected static Map<String,Coloring> |
getSharedColoringMap(Class kitClass)
Deprecated.
Use Editor Settings API instead.
|
int |
getSideBarWidth() |
StatusBar |
getStatusBar() |
StickyWindowSupport |
getStickyWindowSupport() |
Insets |
getTextMargin()
Get the begining of the area covered by text
|
JToolBar |
getToolBarComponent()
Get the toolbar component appropriate for this editor.
|
ToolTipSupport |
getToolTipSupport() |
WordMatch |
getWordMatch() |
boolean |
hasExtComponent()
Whether this ui uses extComponent or not.
|
void |
hidePopupMenu() |
protected void |
initGlyphCorner(JScrollPane scroller) |
protected void |
installUI(JTextComponent c)
Called when the BaseTextUI is being installed
into the component.
|
boolean |
isGlyphGutterVisible()
Is glyph gutter created and visible for the document or not
|
boolean |
isLineNumberEnabled() |
protected void |
modelChanged(BaseDocument oldDoc,
BaseDocument newDoc) |
void |
mouseClicked(MouseEvent evt) |
void |
mouseEntered(MouseEvent evt) |
void |
mouseExited(MouseEvent evt) |
void |
mousePressed(MouseEvent evt) |
void |
mouseReleased(MouseEvent evt) |
protected void |
paint(Graphics g)
This method is called by textui to do the paint.
|
void |
propertyChange(PropertyChangeEvent evt) |
void |
putProperty(Object key,
Object value) |
void |
removePropertyChangeListener(PropertyChangeListener l) |
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener l) |
void |
repaint(int startY) |
void |
repaint(int startY,
int height) |
void |
repaintBlock(int startPos,
int endPos)
Repaint the block between the given positions.
|
void |
repaintOffset(int pos) |
void |
scrollRectToVisible(Rectangle r,
int scrollPolicy)
Deprecated.
use
JComponent.scrollRectToVisible() instead of this method. |
protected void |
setGlyphGutter(GlyphGutter gutter) |
void |
setLineNumberEnabled(boolean lineNumberEnabled) |
void |
setPopupMenu(JPopupMenu popupMenu) |
protected void |
settingsChangeImpl(String settingName) |
void |
showPopupMenu(int x,
int y) |
void |
stateChanged(ChangeEvent evt) |
protected int |
textLimitWidth() |
protected void |
uninstallUI(JTextComponent c)
Called when the BaseTextUI is being uninstalled
from the component.
|
protected void |
update(Graphics g) |
void |
updateLineNumberWidth(int maxDigitCount)
Update the width that will be occupied by the line number.
|
protected void |
updateScrollPaneCornerColor() |
void |
updateTextMargin() |
boolean |
updateVirtualHeight(int height)
Deprecated.
virtual size is no longer used and effects of this method are ignored
|
boolean |
updateVirtualWidth(int width)
Deprecated.
virtual size is no longer used and effects of this method are ignored
|
public static final String OVERWRITE_MODE_PROPERTY
public static final String COMPONENT_PROPERTY
public static final int SCROLL_DEFAULT
public static final int SCROLL_MOVE
public static final int SCROLL_SMALLEST
public static final int SCROLL_FIND
public static final Insets defaultLineNumberMargin
public static final String LINE_HEIGHT_CHANGED_PROP
public static final String TAB_SIZE_CHANGED_PROP
public EditorUI()
public EditorUI(BaseDocument printDoc)
public EditorUI(BaseDocument printDoc, boolean usePrintColoringMap, boolean lineNumberEnabled)
printDoc
- document that should be printed.usePrintColoringMap
- Ignored.
of the regular ones.lineNumberEnabled
- if set to false the line numbers will not be printed.
If set to true the visibility of line numbers depends on lineNumberVisibleSetting.@Deprecated protected static Map<String,Coloring> getSharedColoringMap(Class kitClass)
kitClass
- The kit class for which the colorings should be loaded.FontColorSettings
class.protected void installUI(JTextComponent c)
protected void uninstallUI(JTextComponent c)
public Object getComponentLock()
public void addPropertyChangeListener(PropertyChangeListener l)
public void addPropertyChangeListener(String propertyName, PropertyChangeListener l)
public void removePropertyChangeListener(PropertyChangeListener l)
public void removePropertyChangeListener(String propertyName, PropertyChangeListener l)
protected final void firePropertyChange(String propertyName, Object oldValue, Object newValue)
protected void settingsChangeImpl(String settingName)
public void stateChanged(ChangeEvent evt)
stateChanged
in interface ChangeListener
protected void modelChanged(BaseDocument oldDoc, BaseDocument newDoc)
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
@Deprecated protected Map createColoringMap()
public int getLineHeight()
public int getLineAscent()
@Deprecated public Map<String,Coloring> getColoringMap()
FontColorSettings
class.@Deprecated public Coloring getDefaultColoring()
FontColorNames.DEFAULT_COLORING
and defined for the empty
mime path (ie. all languages).@Deprecated public Coloring getColoring(String coloringName)
getColoringMap
to find a coloring by its name.coloringName
- The name of the coloring to find.null
if there is no coloring with the
requested name.protected void update(Graphics g)
public final JTextComponent getComponent()
public final BaseDocument getDocument()
public JComponent getExtComponent()
EditorUI.getToolBarComponent()
.
EditorUI.hasExtComponent()
public JToolBar getToolBarComponent()
protected JToolBar createToolBarComponent()
protected void initGlyphCorner(JScrollPane scroller)
protected void setGlyphGutter(GlyphGutter gutter)
public final int getSideBarWidth()
protected JComponent createExtComponent()
public boolean hasExtComponent()
EditorUI.getExtComponent()
@Deprecated public Abbrev getAbbrev()
public WordMatch getWordMatch()
public StatusBar getStatusBar()
public void repaint(int startY)
public void repaint(int startY, int height)
public void repaintOffset(int pos) throws BadLocationException
BadLocationException
public void repaintBlock(int startPos, int endPos) throws BadLocationException
BadLocationException
public static Frame getParentFrame(Component c)
@Deprecated public boolean updateVirtualWidth(int width)
@Deprecated public boolean updateVirtualHeight(int height)
public boolean isLineNumberEnabled()
public void setLineNumberEnabled(boolean lineNumberEnabled)
public void updateLineNumberWidth(int maxDigitCount)
maxDigitCount
- maximum digit count that can the line number have.
if it's lower or equal to zero it will be computed automatically.public void updateTextMargin()
public Rectangle getExtentBounds()
public Rectangle getExtentBounds(Rectangle r)
public Insets getTextMargin()
@Deprecated public void scrollRectToVisible(Rectangle r, int scrollPolicy)
JComponent.scrollRectToVisible()
instead of this method.r
- rectangle to which the editor window should be scrolled.scrollPolicy
- the way how scrolling should be done.
One of EditorUI.SCROLL_*
constants.public void adjustWindow(int caretPercentFromWindowTop)
public void adjustCaret(int percentFromWindowTop)
@Deprecated public void caretSetDot(int offset, Rectangle scrollRect, int scrollPolicy)
offset
- position where the caret should be placedscrollRect
- rectangle that should become visible. It can be null
when no scrolling should be done.scrollPolicy
- policy to be used when scrolling.@Deprecated public void caretMoveDot(int offset, Rectangle scrollRect, int scrollPolicy)
offset
- position where the caret should be placedscrollRect
- rectangle that should become visible. It can be null
when no scrolling should be done.scrollPolicy
- policy to be used when scrolling.protected void paint(Graphics g)
public Insets getLineNumberMargin()
public int getLineNumberDigitWidth()
public boolean isGlyphGutterVisible()
public final GlyphGutter getGlyphGutter()
protected void updateScrollPaneCornerColor()
protected int textLimitWidth()
public void mouseClicked(MouseEvent evt)
mouseClicked
in interface MouseListener
public void mousePressed(MouseEvent evt)
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent evt)
mouseReleased
in interface MouseListener
public void mouseEntered(MouseEvent evt)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent evt)
mouseExited
in interface MouseListener
public ToolTipSupport getToolTipSupport()
public StickyWindowSupport getStickyWindowSupport()
StickyWindowSupport
public PopupManager getPopupManager()
public void showPopupMenu(int x, int y)
public void hidePopupMenu()
public JPopupMenu getPopupMenu()
public void setPopupMenu(JPopupMenu popupMenu)