|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ViewPart net.refractions.udig.ui.SearchPart
public class SearchPart
A ViewPart with support for a background "search" process.
The part will automatically show the "progress" when the monitored Job(s) are running.
Nested Class Summary | |
---|---|
protected static class |
SearchPart.Orientation
|
static class |
SearchPart.ResultSet
|
Field Summary | |
---|---|
protected IAction |
cancel
Used to cancel current searchMonitor |
protected SearchPart.Orientation |
orientation
|
protected Composite |
parent
|
protected IMemento |
save
Save state here |
protected IProgressMonitor |
searchMonitor
Used to control search jobs. |
protected SashForm |
splitter
|
protected StructuredViewer |
viewer
Viewer for search results List/Tree/Table ... |
Constructor Summary | |
---|---|
protected |
SearchPart(IDialogSettings dialogSettings)
We need dialog settings for persistence |
Method Summary | |
---|---|
protected IStructuredContentProvider |
createContentProvider()
Default implementation will work for lists, please overide if you are into the whole tree thing. |
protected Composite |
createDetails(SashForm splitter)
Subclass should override to provide custom details display. |
protected IBaseLabelProvider |
createLabelProvider()
|
void |
createPartControl(Composite aParent)
Creates the SWT controls for this workbench part. |
protected ISelectionChangedListener |
createSelectionListener()
Default implementation calls showDetail( IStructuredSelection ). |
protected StructuredViewer |
createViewer(Composite parent)
Create viewer (default is a ListViewer please override if you want a Tree or Table Viewer. |
protected void |
fillActionBars()
Create toolbar with cancel. |
protected void |
fillViewMenu()
|
protected Composite |
getDetails()
Subclass can override to return its kind of details, example a PageBook. |
protected ISelection |
getSelection(java.util.List<java.lang.Object> input)
Called to determine what object(s) in the input should be the selection in the viewer. |
void |
init(IViewSite site,
IMemento memento)
|
protected void |
initDragAndDrop()
Subclass should override to support DnD. |
protected void |
makeActions()
|
protected void |
notifyChange(SearchPart.ResultSet set,
java.util.Collection<? extends java.lang.Object> newObjects)
Called each time data is added to the result set by the search. |
void |
quick(java.lang.String pattern)
|
void |
saveState(IMemento memento)
|
protected void |
saveViewSettings()
|
void |
search(java.lang.Object newFilter)
Search the catalog for text and update view contents |
protected void |
searchImplementation(java.lang.Object filter,
IProgressMonitor monitor,
SearchPart.ResultSet results)
|
void |
selectReveal(ISelection selection)
|
void |
setFocus()
|
protected void |
setOrientation(SearchPart.Orientation orientation)
called from ToggleOrientationAction (or compute). |
void |
setShowDetails(boolean show)
|
protected void |
showDetail(java.lang.Object selection)
Allows subclass to focus the detail on this selection |
protected boolean |
showSelection()
Returns true if the selection returned by #getNewSelection(List) should be shown in the viewer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected StructuredViewer viewer
protected IAction cancel
Usually available in the toolbar.
protected IProgressMonitor searchMonitor
Only one "batch" of search jobs is outstanding at anyone time.
protected SashForm splitter
protected IMemento save
protected Composite parent
protected SearchPart.Orientation orientation
Constructor Detail |
---|
protected SearchPart(IDialogSettings dialogSettings)
Method Detail |
---|
public void init(IViewSite site, IMemento memento) throws PartInitException
PartInitException
public void saveState(IMemento memento)
protected void setOrientation(SearchPart.Orientation orientation)
orientation
- Orientation.HORIZONTAL or Orientation.VERTICALpublic void setShowDetails(boolean show)
public void createPartControl(Composite aParent)
The details (from IWorkbenchPart.createPartControl( Composite ))
Multi-step process:
IActionService
.IActionService
.ISelectionService
(optional).
parent
- org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
protected void saveViewSettings()
protected Composite createDetails(SashForm splitter)
Many subclasses use PageBook with page selection based on the selection in the viewer.
splitter
-
protected Composite getDetails()
protected StructuredViewer createViewer(Composite parent)
Note the following will be called after creation:
page
-
protected ISelectionChangedListener createSelectionListener()
Override if you want to do something else.
protected void showDetail(java.lang.Object selection)
protected IStructuredContentProvider createContentProvider()
protected IBaseLabelProvider createLabelProvider()
protected void initDragAndDrop()
protected void makeActions()
protected void fillViewMenu()
protected void fillActionBars()
public void quick(java.lang.String pattern)
protected void notifyChange(SearchPart.ResultSet set, java.util.Collection<? extends java.lang.Object> newObjects)
set
- the results of the search at the current point.newObjects
- the objects that have been added this time.protected ISelection getSelection(java.util.List<java.lang.Object> input)
the
- complete list of objects in the viewer.
protected boolean showSelection()
#getNewSelection(List)
should be shown in the viewer.
#getNewSelection(List)
should be shown in the viewer.public void search(java.lang.Object newFilter)
pattern
- protected void searchImplementation(java.lang.Object filter, IProgressMonitor monitor, SearchPart.ResultSet results)
public void selectReveal(ISelection selection)
public void setFocus()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |