public class SearchFactory extends Object implements UIDependent
Modifier and Type | Class and Description |
---|---|
class |
SearchFactory.FindRemover |
private static class |
SearchFactory.LaFListener |
Modifier and Type | Field and Description |
---|---|
protected JXFindBar |
findBar
the shared find widget for incremental-find.
|
protected JXFindPanel |
findPanel
the shared find widget for batch-find.
|
private SearchFactory.FindRemover |
findRemover |
protected JComponent |
lastFindBarTarget
this is a temporary hack: need to remove the useSearchHighlighter property.
|
private Point |
lastFindDialogLocation |
private static SearchFactory |
searchFactory |
private boolean |
useFindBar |
Constructor and Description |
---|
SearchFactory() |
Modifier and Type | Method and Description |
---|---|
protected void |
configureSharedFindBar()
Configures the shared FindBar.
|
protected void |
configureSharedFindPanel()
Configures the shared FindPanel.
|
JXFindBar |
createFindBar()
Factory method to create a JXFindBar.
|
JXFindPanel |
createFindPanel()
Factory method to create a JXFindPanel.
|
private JXDialog |
getDialogForSharedFindPanel() |
private SearchFactory.FindRemover |
getFindRemover() |
static SearchFactory |
getInstance()
Returns the shared SearchFactory.
|
KeyStroke |
getSearchAccelerator()
Returns a common Keystroke for triggering
a search.
|
JXFindBar |
getSharedFindBar()
Returns the shared JXFindBar.
|
JXFindPanel |
getSharedFindPanel()
Returns the shared JXFindPanel.
|
protected Point |
hideSharedFindPanel(boolean dispose)
Hides the findPanel's toplevel window and returns its location.
|
protected void |
installFindRemover(Container target,
Container findWidget) |
boolean |
isUseFindBar(JComponent target,
Searchable searchable)
Returns decision about using a batch- vs. incremental-find for the
searchable.
|
protected void |
releaseFindBar()
Pre: findbar !
|
protected void |
removeFromParent(JComponent component)
convenience method to remove a component from its parent
and revalidate the parent
|
static void |
setInstance(SearchFactory factory)
Sets the shared SearchFactory.
|
void |
setUseFindBar(boolean incremental)
Sets the default search type to incremental or batch, for a
true/false boolean.
|
void |
showFindBar(JComponent target,
Searchable searchable)
Show a incremental-find widget targeted at the searchable.
|
void |
showFindDialog(JComponent target,
Searchable searchable)
Show a batch-find widget targeted at the given Searchable.
|
void |
showFindInput(JComponent target,
Searchable searchable)
Shows an appropriate find widget targeted at the searchable.
|
protected void |
stopSearching() |
void |
updateUI()
Updates all internal visuals after changing a UI-delegate.
|
private static SearchFactory searchFactory
protected JXFindPanel findPanel
protected JComponent lastFindBarTarget
private boolean useFindBar
private Point lastFindDialogLocation
private SearchFactory.FindRemover findRemover
public SearchFactory()
public static SearchFactory getInstance()
SearchFactory
public static void setInstance(SearchFactory factory)
factory
- public KeyStroke getSearchAccelerator()
PENDING: this should be done in the LF and the keyStroke looked up in the UIManager.
public boolean isUseFindBar(JComponent target, Searchable searchable)
target
- - the component associated with the searchablesearchable
- - the object to search.public void setUseFindBar(boolean incremental)
incremental
- a boolean to indicate the default search
type, true for incremental and false for batch.public void showFindInput(JComponent target, Searchable searchable)
isUseFindBar
.target
- - the component associated with the searchablesearchable
- - the object to search.isUseFindBar(JComponent, Searchable)
,
setUseFindBar(boolean)
public void showFindBar(JComponent target, Searchable searchable)
target
- - the component associated with the searchablesearchable
- - the object to search.public JXFindBar getSharedFindBar()
JXFindBar
public JXFindBar createFindBar()
JXFindBar
protected void installFindRemover(Container target, Container findWidget)
private SearchFactory.FindRemover getFindRemover()
protected void removeFromParent(JComponent component)
protected void stopSearching()
protected void releaseFindBar()
protected void configureSharedFindBar()
Here: registers a custom action to remove the findbar from its ancestor container. PRE: findBar != null.
public void showFindDialog(JComponent target, Searchable searchable)
target
- -
the component associated with the searchablesearchable
- -
the object to search.public JXFindPanel getSharedFindPanel()
JXFindPanel
public JXFindPanel createFindPanel()
JXFindPanel
protected void configureSharedFindPanel()
Here: no-op PRE: findPanel != null.
private JXDialog getDialogForSharedFindPanel()
protected Point hideSharedFindPanel(boolean dispose)
dispose
- boolean to indicate whether the findPanels toplevel
window should be disposed.public void updateUI()
updateUI
in interface UIDependent
JComponent.updateUI()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses