|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.jidesoft.marker.MarkerArea
public class MarkerArea
MarkerArea
is an area next to a component with a vertical scroll bar 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 markers.
You can use MarkerEyePainter
to customize how to paint it. For example, if there are errors in the table, 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 telling user what the error is. MarkerStripePainter
is the painter class to
paint the stripe.
MarkerModel
. By default, we put the MarkerModel inside
an implementation of an interface called MarkerSupport
which provides some more information to display the
marker other than the MarkerModel. 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.
A typical usage of MarkerArea is to use it along with a component that has a vertical scroll bar, such as JTable,
JList, JTree and JTextArea. These components could be very tall which is the reason a vertical scroll bar is needed.
A MarkerArea
provides a way to see an overview of certain information, such as validation
errors/warnings, recent changes, modifications by users, without having to scroll up and down.
MarkerEye
,
MarkerStripe
,
MarkerModel
,
DefaultMarkerModel
,
Serialized FormNested 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 | |
---|---|
protected MarkerEye |
_eye
|
protected MarkerEyePainter |
_eyePainter
|
protected boolean |
_inspecting
|
protected MarkerSupport |
_markerSupport
|
protected int |
_minimumMode
|
protected int |
_mode
|
protected MarkerStripe |
_stripe
|
protected MarkerStripePainter |
_stripePainter
|
static Color |
DEFAULT_ERROR_COLOR
|
static Color |
DEFAULT_FINE_COLOR
|
static Color |
DEFAULT_INSPECTING_COLOR
|
static Color |
DEFAULT_WARNING_COLOR
|
static int |
MODE_ERROR
|
static int |
MODE_FINE
|
static int |
MODE_WARNING
|
static String |
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(MarkerSupport markerSupport)
|
Method Summary | |
---|---|
void |
applyMinimumMode()
|
void |
clearMarkerColors()
Clears all registered marker colors. |
protected MarkerEye |
createMarkerEye()
Creates a default MarkerEye. |
protected MarkerStripe |
createMarkerStripe()
Creates a default MarkerStripe. |
void |
dispose()
Disposes the MarkerArea. |
MarkerEyePainter |
getEyePainter()
|
Color |
getMarkerColor(int type)
Gets the color registered for the marker type. |
MarkerEye |
getMarkerEye()
Gets the MarkerEye. |
MarkerStripe |
getMarkerStripe()
Gets the MarkerStripe. |
MarkerSupport |
getMarkerSupport()
|
int |
getMode()
|
String |
getResourceString(String key)
Gets the resource string used by CodeEditor. |
MarkerStripePainter |
getStripePainter()
|
boolean |
isClickToSelect()
|
boolean |
isInspecting()
|
void |
markerChanged(MarkerEvent e)
This method is called when any marker change happened. |
void |
registerMarkerColor(int type,
Color color)
Resisters a color for a marker type. |
void |
requireMinimumMode(int minimum)
|
void |
setClickToSelect(boolean clickToSelect)
Sets the flag whether to select the elements when clicking on the marker. |
void |
setEyePainter(MarkerEyePainter eyePainter)
|
void |
setInspecting(boolean inspecting)
|
void |
setMarkerSupport(MarkerSupport markerSupport)
|
void |
setMode(int mode)
|
void |
setStripePainter(MarkerStripePainter stripePainter)
|
void |
unregisterMarkerColor(int type)
Unregisters the color from the marker type. |
void |
updateMarkerAreaHeight(int preferredHeight)
|
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MODE_FINE
public static final int MODE_WARNING
public static final int MODE_ERROR
public static final Color DEFAULT_FINE_COLOR
public static final Color DEFAULT_WARNING_COLOR
public static final Color DEFAULT_ERROR_COLOR
public static final Color DEFAULT_INSPECTING_COLOR
protected MarkerSupport _markerSupport
protected MarkerEye _eye
protected MarkerStripe _stripe
protected MarkerEyePainter _eyePainter
protected MarkerStripePainter _stripePainter
protected int _mode
protected int _minimumMode
protected boolean _inspecting
public static final String PROPERTY_CLICK_TO_SELECT
Constructor Detail |
---|
public MarkerArea(MarkerSupport markerSupport)
Method Detail |
---|
protected MarkerStripe createMarkerStripe()
protected MarkerEye createMarkerEye()
public MarkerStripe getMarkerStripe()
public MarkerEye getMarkerEye()
public MarkerEyePainter getEyePainter()
public void setEyePainter(MarkerEyePainter eyePainter)
public MarkerStripePainter getStripePainter()
public void setStripePainter(MarkerStripePainter stripePainter)
public MarkerSupport getMarkerSupport()
public void setMarkerSupport(MarkerSupport markerSupport)
public void markerChanged(MarkerEvent e)
MarkerListener
markerChanged
in interface MarkerListener
public boolean isInspecting()
public void setInspecting(boolean inspecting)
public int getMode()
public void setMode(int mode)
public void applyMinimumMode()
public void requireMinimumMode(int minimum)
public void updateMarkerAreaHeight(int preferredHeight)
public String getResourceString(String key)
key
- the resource key
public void registerMarkerColor(int type, Color color)
type
- a marker type.color
- color for the marker type. The marker type is defined in Marker
.public void unregisterMarkerColor(int type)
type
- the marker type.public void clearMarkerColors()
public Color getMarkerColor(int type)
type
- the marker type.
public boolean isClickToSelect()
public void setClickToSelect(boolean clickToSelect)
clickToSelect
- true or false.public void dispose()
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |