JIDE 3.5.15

com.jidesoft.editor.marker
Class MarkerArea

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.jidesoft.marker.MarkerArea
                      extended by com.jidesoft.editor.marker.MarkerArea
All Implemented Interfaces:
MarkerListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class MarkerArea
extends MarkerArea

MarkerArea is an area next to code editor to display markers for error, warning, or whatever information in the code you would like to display. There are two parts in a MarkerArea. The top is an area called MarkerEye. It displays the current status of the code editor. You can use MarkerEyePainter to customize how to paint it. For example, if there are errors in the code, you can display a red box to indicate something is wrong. Or display a yellow box if there are just warnings. If everything is OK, display a green box. You can even display an icon if you want using MarkerEyePainter. The second part is called MarkerStripe. It displays stripes to indicate those errors or warnings or any other information. Each stripe is associated with a range of code and a tooltip for the message. For example, an error stripe usually has a tooltip of why there is an error. MarkerStripePainter is the painter class to paint the stripe.

The whole MarkerArea is driven by a model class called MarkerModel. Each code editor has a MarkerModel that stores all the markers. You can use code to add or remove markers to this model. MarkerArea will display them immediately when something is changed.

See Also:
MarkerEye, MarkerStripe, MarkerModel, DefaultMarkerModel, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class com.jidesoft.marker.MarkerArea
_eye, _eyePainter, _inspecting, _markerSupport, _minimumMode, _mode, _stripe, _stripePainter, DEFAULT_ERROR_COLOR, DEFAULT_FINE_COLOR, DEFAULT_INSPECTING_COLOR, DEFAULT_WARNING_COLOR, MODE_ERROR, MODE_FINE, MODE_WARNING, PROPERTY_CLICK_TO_SELECT
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MarkerArea(CodeEditor codeEditor)
           
 
Method Summary
protected  MarkerEye createMarkerEye()
          Creates a default MarkerEye.
protected  MarkerStripe createMarkerStripe()
          Creates a default MarkerStripe.
 void dispose()
          Disposes the MarkerArea.
 CodeEditor getCodeEditor()
           
 Color getColor(int type)
          Deprecated. Please use MarkerArea.getMarkerColor(int). From JIDE 3.2 release, this method will no longer use the SyntaxStyle to figure out the color automatically because there is no clear one-to-one mapping between the style and the marker type. If you would like to register more colors for the marker, please use MarkerArea.registerMarkerColor(int, java.awt.Color). By default, we only register the color or error and warning.
 int getVisualLineCount()
           
 void setCodeEditor(CodeEditor codeEditor)
           
 void setStripePainter(MarkerStripePainter stripePainter)
           
 void updateMarkerAreaHeight(int preferredHeight)
          Update the height of the marker area according to the visibility of horizontal scroll bar in CodeEditor.
 
Methods inherited from class com.jidesoft.marker.MarkerArea
applyMinimumMode, clearMarkerColors, getEyePainter, getMarkerColor, getMarkerEye, getMarkerStripe, getMarkerSupport, getMode, getResourceString, getStripePainter, isClickToSelect, isInspecting, markerChanged, registerMarkerColor, requireMinimumMode, setClickToSelect, setEyePainter, setInspecting, setMarkerSupport, setMode, unregisterMarkerColor
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MarkerArea

public MarkerArea(CodeEditor codeEditor)
Method Detail

createMarkerStripe

protected MarkerStripe createMarkerStripe()
Creates a default MarkerStripe. Subclass can override this method to create your own MarkerStripe subclass.

Overrides:
createMarkerStripe in class MarkerArea
Returns:
the MarkerStripe.

createMarkerEye

protected MarkerEye createMarkerEye()
Creates a default MarkerEye. Subclass can override this method to create your own MarkerEye subclass.

Overrides:
createMarkerEye in class MarkerArea
Returns:
the MarkerEye.

setStripePainter

public void setStripePainter(MarkerStripePainter stripePainter)
Overrides:
setStripePainter in class MarkerArea

getCodeEditor

public CodeEditor getCodeEditor()

setCodeEditor

public void setCodeEditor(CodeEditor codeEditor)

getVisualLineCount

public int getVisualLineCount()

dispose

public void dispose()
Description copied from class: MarkerArea
Disposes the MarkerArea.

Overrides:
dispose in class MarkerArea

getColor

@Deprecated
public Color getColor(int type)
Deprecated. Please use MarkerArea.getMarkerColor(int). From JIDE 3.2 release, this method will no longer use the SyntaxStyle to figure out the color automatically because there is no clear one-to-one mapping between the style and the marker type. If you would like to register more colors for the marker, please use MarkerArea.registerMarkerColor(int, java.awt.Color). By default, we only register the color or error and warning.


updateMarkerAreaHeight

public void updateMarkerAreaHeight(int preferredHeight)
Update the height of the marker area according to the visibility of horizontal scroll bar in CodeEditor.

In most cases, you don't have to invoke this method. This method is to make the height of the marker area in line with the CodeEditor.

Overrides:
updateMarkerAreaHeight in class MarkerArea

JIDE 3.5.15