|
Nekit v 0.9 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.nekhem.nekit.ListContext
ListContext contains the code for managing bullet lists and numbered lists
| Field Summary | |
static java.lang.Object[] |
listTags
Convenience array for various pourposes |
| Constructor Summary | |
ListContext(NekitPane nekitPane,
NekitDocument nekitDoc)
Constructor Registers as a Context within NekitPane |
|
| Method Summary | |
void |
addList(java.lang.String type)
Build a completely new bullet list at the caret position |
void |
buttonsOk(java.lang.String whichOn)
Set the toggle buttons according to the parameter |
java.lang.String |
currentType()
The active type of list (is any) |
void |
fillToolBar(javax.swing.JToolBar tb,
javax.swing.Action[] actions,
java.lang.String[] labels,
java.lang.String[] iconNames)
Put the toggle buttons on the toolbar |
javax.swing.text.Element |
findContainingListElement(int start,
int end)
If the region from start to end is included in a single Element of type "UL" or "OL", return that element. |
boolean |
handleNewLine(int pos)
A new line into a bullet list means: "add another bullet here", unless there's already a single bullet on the line: in that case it means: "end bullets and start a normal paragraph" |
boolean |
isActive()
Is the caret in this Context? |
void |
newPosition()
The caret has been moved to a new Position |
void |
setAllOff()
Say that there's no list active |
void |
setBulletsOn()
activate the button of bullets |
void |
setNumbersOn()
Activate the button of numbers |
void |
setOff()
Transform the current bullet lines in normal lines |
void |
setOn(java.lang.String id)
Transform the current (selected) lines in a bullet/numbered list |
void |
splitList()
divide the bullet line in 2 at the caret position |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static java.lang.Object[] listTags
| Constructor Detail |
public ListContext(NekitPane nekitPane,
NekitDocument nekitDoc)
nekitPane - the current PanenekitDoc - the current Document| Method Detail |
public boolean handleNewLine(int pos)
handleNewLine in interface CaretContextpos - the caret position
public void fillToolBar(javax.swing.JToolBar tb,
javax.swing.Action[] actions,
java.lang.String[] labels,
java.lang.String[] iconNames)
tb - The toolbaractions - the two Actions (bullets and numbers)labels - the tooltips of the buttonsiconNames - the name of the corresponding iconspublic java.lang.String currentType()
public void newPosition()
CaretContext
newPosition in interface CaretContextpublic boolean isActive()
CaretContext
isActive in interface CaretContextpublic void setAllOff()
public void setNumbersOn()
public void setBulletsOn()
public void buttonsOk(java.lang.String whichOn)
whichOn - which type of list is on (bullets, numbers)public void setOn(java.lang.String id)
id - type of list ("bullets" / "numbers")public void setOff()
public javax.swing.text.Element findContainingListElement(int start,
int end)
start - start of the text regionend - end of the text region
public void splitList()
public void addList(java.lang.String type)
type - the type of list ("bullets", "numbers")
|
Nekit v 0.9 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||