org.netbeans.api.editor.guards
public final class GuardedSectionManager extends Object
Modifier and Type | Method and Description |
---|---|
InteriorSection |
createInteriorSection(Position pos,
String name)
Creates an empty interior section at the given position.
|
SimpleSection |
createSimpleSection(Position pos,
String name)
Creates an empty simple section at the given position.
|
InteriorSection |
findInteriorSection(String name)
Tries to find the interior section of the given name.
|
SimpleSection |
findSimpleSection(String name)
Tries to find the simple section of the given name.
|
Iterable<GuardedSection> |
getGuardedSections()
Gets all sections.
|
static GuardedSectionManager |
getInstance(StyledDocument doc)
Gets the manager instance.
|
public static GuardedSectionManager getInstance(StyledDocument doc)
doc
- a document containing guarded sectionsnull
.public SimpleSection findSimpleSection(String name)
name
- the name of the requested sectionnull
if there is no section
of the given namepublic InteriorSection findInteriorSection(String name)
name
- the name of the looked-for sectionnull
if there is no section
of the given namepublic SimpleSection createSimpleSection(Position pos, String name) throws IllegalArgumentException, BadLocationException
IllegalArgumentException
- if either the name has been already used, or
the position is inside another section or Java Element.BadLocationException
- if pos is outside of document's scope, or
the document does not permit creating the guarded section.public InteriorSection createInteriorSection(Position pos, String name) throws IllegalArgumentException, BadLocationException
IllegalArgumentException
- if either the name has been already used, or
the position is inside another section or Java Element.BadLocationException
- if pos is outside of document's scope, or
the document does not permit creating the guarded section.public Iterable<GuardedSection> getGuardedSections()
GuardedSection
sBuilt on March 18 2014. | Portions Copyright 1997-2014 Sun Microsystems, Inc. All rights reserved.