public class ArticlesModel
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static short |
HELPFORMAT_JAVAFX
The JavaFX help format.
|
static short |
HELPFORMAT_SWING
The Swing help format.
|
static short |
HELPFORMAT_UNDEFINED
The undefined help format.
|
Constructor and Description |
---|
ArticlesModel(java.net.URL baseURL)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addArticle(Article article)
Add an article.
|
void |
addHelpRef(java.lang.String helpID,
Article article,
java.lang.String title)
Add a HelpRef.
|
void |
addStyleSheetTheme(java.lang.String id,
java.net.URL styleSheetTheme)
Add a styleSheet theme.
|
Chapter |
createRootChapter(Localization localization)
Create a root chapter for the model.
|
Article |
getArticle(java.lang.String id)
Return an article of a specified ID.
|
Article |
getArticle(java.net.URL url)
Return an article of a specified URL.
|
java.util.Map<java.lang.String,Article> |
getArticles()
Return the articles.
|
java.net.URL |
getBaseURL()
Return the base URL.
|
java.net.URL |
getCurrentStyleSheetTheme()
Return the current stylesheet theme.
|
java.net.URL |
getFullTextSearchURL()
Return the URL of the fullTextSearch json file.
|
Article |
getGlossary()
Return the glossary (can be null).
|
short |
getHelpFormat()
Return the help format.
|
HelpRef |
getHelpRef(java.lang.String helpID)
Return a HelpRef.
|
java.util.Map<java.lang.String,HelpRef> |
getHelpRefs()
Return the HelpRef.
|
Article |
getIndex()
Return the index article.
|
Chapter |
getRootChapter()
Return the root chapter.
|
int |
getSearchLimit()
Return the search limit.
|
java.net.URL |
getStyleSheet()
Return the URL of the styleSheet.
|
java.net.URL |
getStyleSheetTheme()
Return the URL of the styleSheet theme.
|
java.util.Set<java.lang.String> |
getStyleSheetThemes()
Return the set of styleSheet themes ids.
|
boolean |
hasArticle(java.lang.String id)
Return true if there is an article of a specified ID.
|
boolean |
hasChapters()
Return true if the model has chapters.
|
boolean |
hasFullTextSearch()
Return true if there is a fullTextSearch json file.
|
boolean |
hasGlossary()
Return true if there is a glossary.
|
boolean |
hasHelpRef(java.lang.String helpID)
Return true if there is a HelpRef for a specified id.
|
boolean |
hasSearchLimit()
Return true if the search is limited.
|
boolean |
hasStyleSheetTheme()
Return true if there is a stylesheet theme.
|
boolean |
isArticle(java.net.URL url)
Return true if an URL correspond to an article.
|
boolean |
isFullTextSearchCompressed()
Return true if the full text search index must be compressed (the level is greater or equal to 2).
|
java.net.URL |
resetStyleSheetTheme()
Reset the stylesheet theme.
|
java.util.List<Article> |
search(java.lang.String term)
Search for the list of articles containing a search term.
|
void |
setFullTextSearch(java.net.URL url)
Set the URL of the fullTextSearch json file.
|
void |
setFullTextSearchCompressed(boolean compressed)
Return true if the full text search index must be compressed (the level is greater or equal to 2).
|
void |
setGlossary(Article glossary)
Set the glossary.
|
void |
setHelpFormat(short helpFormat)
Set the help format.
|
void |
setIndex(Article article)
Set the index article.
|
void |
setSearchLimit(int searchLimit)
Set the search limit.
|
void |
setStyleSheet(java.net.URL styleSheet)
Set the URL of the styleSheet.
|
boolean |
setStyleSheetTheme(java.lang.String id)
Set the current stylesheet theme to a specified theme id.
|
void |
setStyleSheetThemeURL(java.net.URL styleSheetTheme)
Set the URL of the styleSheet theme.
|
public static final short HELPFORMAT_UNDEFINED
public static final short HELPFORMAT_SWING
public static final short HELPFORMAT_JAVAFX
public ArticlesModel(java.net.URL baseURL)
baseURL
- the base URL (represents the URL for the zip file which contains the help content)public Chapter createRootChapter(Localization localization)
localization
- the localizationpublic boolean hasChapters()
public Chapter getRootChapter()
public java.net.URL getBaseURL()
public void setStyleSheet(java.net.URL styleSheet)
styleSheet
- the URL of the styleSheetpublic void setStyleSheetThemeURL(java.net.URL styleSheetTheme)
styleSheetTheme
- the URL of the styleSheet themepublic boolean hasStyleSheetTheme()
public void addStyleSheetTheme(java.lang.String id, java.net.URL styleSheetTheme)
id
- the theme idstyleSheetTheme
- the URL of the styleSheet themepublic java.util.Set<java.lang.String> getStyleSheetThemes()
public java.net.URL resetStyleSheetTheme()
public java.net.URL getCurrentStyleSheetTheme()
public boolean setStyleSheetTheme(java.lang.String id)
id
- the theme idpublic void setFullTextSearch(java.net.URL url)
url
- the URL of the fullTextSearch json filepublic void setHelpFormat(short helpFormat)
HELPFORMAT_UNDEFINED
for an undefined help content formatHELPFORMAT_SWING
for a help content optimized for SwingHELPFORMAT_JAVAFX
for a help content optimized for JavaFXhelpFormat
- the help formatpublic short getHelpFormat()
public void setSearchLimit(int searchLimit)
searchLimit
- the search limitpublic int getSearchLimit()
public boolean hasSearchLimit()
public java.util.List<Article> search(java.lang.String term)
term
- the search termpublic void setIndex(Article article)
article
- the index articlepublic void setGlossary(Article glossary)
glossary
- the glossarypublic boolean hasGlossary()
public Article getGlossary()
public Article getIndex()
public java.net.URL getStyleSheet()
public java.net.URL getStyleSheetTheme()
public boolean hasFullTextSearch()
public void setFullTextSearchCompressed(boolean compressed)
compressed
- true if the full text search index must be compressedpublic boolean isFullTextSearchCompressed()
public java.net.URL getFullTextSearchURL()
public java.util.Map<java.lang.String,Article> getArticles()
public Article getArticle(java.lang.String id)
id
- the article IDpublic boolean hasArticle(java.lang.String id)
id
- the article IDpublic boolean isArticle(java.net.URL url)
url
- the urlpublic Article getArticle(java.net.URL url)
url
- the article URLpublic void addArticle(Article article)
article
- the articlepublic void addHelpRef(java.lang.String helpID, Article article, java.lang.String title)
helpID
- the HelpRef idarticle
- the articletitle
- the title (can be null)public boolean hasHelpRef(java.lang.String helpID)
helpID
- the HelpRef idpublic HelpRef getHelpRef(java.lang.String helpID)
helpID
- the HelpRef idpublic java.util.Map<java.lang.String,HelpRef> getHelpRefs()
Copyright © 2016-2024 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence