|
org.netbeans.modules.editor.lib/1 1.14.0 3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.editor.EditorUI
public class EditorUI
Editor UI for the component. All the additional UI features like advanced scrolling, info about fonts, abbreviations, keyword matching are based on this class.
Field Summary | |
---|---|
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. |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
boolean |
addLayer(DrawLayer layer,
int visibility)
Deprecated. Please use Highlighting SPI instead, for details see Editor Library 2. |
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. |
DrawLayer |
findLayer(String layerName)
Deprecated. Please use Highlighting SPI instead, for details see Editor Library 2. |
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
|
Abbrev |
getAbbrev()
|
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 |
Object |
getProperty(Object key)
|
protected static Map<String,Coloring> |
getSharedColoringMap(Class kitClass)
Deprecated. Use Editor Settings API instead. |
int |
getSideBarWidth()
|
StatusBar |
getStatusBar()
|
Insets |
getTextMargin()
Get the begining of the area covered by text |
JToolBar |
getToolBarComponent()
Get the toolbar component appropriate for this editor. |
WordMatch |
getWordMatch()
|
boolean |
hasExtComponent()
Whether this ui uses extComponent or not. |
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)
|
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)
|
DrawLayer |
removeLayer(String layerName)
Deprecated. Please use Highlighting SPI instead, for details see Editor Library 2. |
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 |
settingsChange(SettingsChangeEvent evt)
|
protected void |
settingsChangeImpl(String settingName)
|
void |
stateChanged(ChangeEvent evt)
|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
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.Method Detail |
---|
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 settingsChange(SettingsChangeEvent evt)
settingsChange
in interface SettingsChangeListener
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
protected Map createColoringMap()
public int getLineHeight()
public int getLineAscent()
public Map<String,Coloring> getColoringMap()
FontColorSettings
class.public Coloring getDefaultColoring()
FontColorNames.DEFAULT_COLORING
and defined for the empty
mime path (ie. all languages).
public Coloring getColoring(String coloringName)
getColoringMap
to find a coloring by its name.
coloringName
- The name of the coloring to find.protected void update(Graphics g)
public final JTextComponent getComponent()
public final BaseDocument getDocument()
public Object getProperty(Object key)
public void putProperty(Object key, Object value)
public JComponent getExtComponent()
#getToolbarComponent()
.
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()
getExtComponent()
public Abbrev getAbbrev()
public WordMatch getWordMatch()
public StatusBar getStatusBar()
public DrawLayer findLayer(String layerName)
Using of DrawLayer
s has been deprecated.
public boolean addLayer(DrawLayer layer, int visibility)
Using of DrawLayer
s has been deprecated.
layer
- layer to insert into the chainpublic DrawLayer removeLayer(String layerName)
DrawLayer
s has been deprecated.
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)
public boolean updateVirtualWidth(int width)
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()
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)
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.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()
|
org.netbeans.modules.editor.lib/1 1.14.0 3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |