Remote Systems
v6.4.1

com.ibm.etools.systems.core.ui.view.search
Class SystemSearchViewPart

java.lang.Object
  extended byViewPart
      extended bycom.ibm.etools.systems.core.ui.view.search.SystemSearchViewPart
All Implemented Interfaces:
EventListener, ISystemMessageLine, ISystemResourceChangeListener

public class SystemSearchViewPart
extends ViewPart
implements ISystemResourceChangeListener, ISystemMessageLine

This class defines the Remote Search view.

See Also:
Serialized Form

Nested Class Summary
 class SystemSearchViewPart.CancelAction
           
 class SystemSearchViewPart.SystemSearchDoubleClickListener
          Double click listener.
 
Field Summary
static String Copyright
           
 
Fields inherited from interface com.ibm.etools.systems.model.ISystemResourceChangeListener
copyright
 
Fields inherited from interface com.ibm.etools.systems.core.ui.messages.ISystemMessageLine
copyright
 
Constructor Summary
SystemSearchViewPart()
          Constructor for SystemSearchViewPart.
 
Method Summary
 void addSearchResult(IAdaptable resultSet)
          Add a search result set.
 void addSelectionChangedListener(ISelectionChangedListener listener)
           
 void clearErrorMessage()
          Clears the currently displayed error message and redisplayes the message which was active before the error message was set.
 void clearMessage()
          Clears the currently displayed message.
 void createPartControl(Composite parent)
           
 boolean deleteAllPages()
          Deletes all the pages in the view.
 boolean deleteCurrentPage()
          Deletes the current page.
 boolean deleteSelected()
          Delete the selected object in the view.
 void dispose()
           
 void fillContextMenu(IMenuManager menu)
          Fill context for the tree view pop-up menu.
 ISystemViewElementAdapter getAdapter(Object element)
          Get the adapter for the given object.
 StructuredViewer getCurrentViewer()
          Gets the current viewer, i.e. the viewer whose control is being currently displayed in the view.
 String getErrorMessage()
          Get the currently displayed error text.
 String getMessage()
          Get the currently displayed message.
 ISelection getSelection()
          Returns the current selection for this provider.
 Shell getShell()
          Get the shell.
 SystemMessage getSystemErrorMessage()
          Get the currently displayed error text.
 void init(IViewSite site, IMemento memento)
           
 void menuAboutToShow(IMenuManager menu)
          Called when the context menu is about to open.
 void removeSelectionChangedListener(ISelectionChangedListener listener)
          Removes the given selection change listener from this selection provider.
 boolean sameParent()
          This is called to ensure all elements in a multiple-selection have the same parent in the tree viewer.
 void saveState(IMemento memento)
           
 void selectionChanged(SelectionChangedEvent event)
           
 void setErrorMessage(String message)
          Display the given error message.
 void setErrorMessage(SystemMessage message)
          Display the given error message.
 void setErrorMessage(Throwable exc)
          Display the given error message.
 void setFocus()
           
 void setMessage(String message)
          Set the message text.
 void setMessage(SystemMessage message)
          If the message line currently displays an error, the message is stored and will be shown after a call to clearErrorMessage
 void setSelection(ISelection selection)
          Sets the current selection for this selection provider.
 void setViewPartTitle(String title)
          Set the title of this view part
 void showSearchResult(int index)
          Show search result with the given index.
 void systemResourceChanged(ISystemResourceChangeEvent event)
          This is the method in your class that will be called when a system resource changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values
Constructor Detail

SystemSearchViewPart

public SystemSearchViewPart()
Constructor for SystemSearchViewPart.

Method Detail

createPartControl

public void createPartControl(Composite parent)
See Also:
IWorkbenchPart

setFocus

public void setFocus()
See Also:
IWorkbenchPart

init

public void init(IViewSite site,
                 IMemento memento)
          throws PartInitException
Throws:
PartInitException
See Also:
IViewPart

saveState

public void saveState(IMemento memento)
See Also:
IViewPart

addSearchResult

public void addSearchResult(IAdaptable resultSet)
Add a search result set.


dispose

public void dispose()
See Also:
IWorkbenchPart

showSearchResult

public void showSearchResult(int index)
Show search result with the given index.


deleteSelected

public boolean deleteSelected()
Delete the selected object in the view.

Returns:
true if the selection has been deleted, false otherwise.

deleteAllPages

public boolean deleteAllPages()
Deletes all the pages in the view.

Returns:
true if all pages have been deleted, false otherwise.

deleteCurrentPage

public boolean deleteCurrentPage()
Deletes the current page.

Returns:
true if the current page has been deleted, false otherwise.

getAdapter

public ISystemViewElementAdapter getAdapter(Object element)
Get the adapter for the given object.

Returns:
the adapter for the object.

getShell

public Shell getShell()
Get the shell.

Specified by:
getShell in interface ISystemResourceChangeListener
Returns:
the shell

systemResourceChanged

public void systemResourceChanged(ISystemResourceChangeEvent event)
Description copied from interface: ISystemResourceChangeListener
This is the method in your class that will be called when a system resource changes.

Specified by:
systemResourceChanged in interface ISystemResourceChangeListener
See Also:
ISystemResourceChangeEvent

fillContextMenu

public void fillContextMenu(IMenuManager menu)
Fill context for the tree view pop-up menu.

Parameters:
menu - the menu manager.

sameParent

public boolean sameParent()
This is called to ensure all elements in a multiple-selection have the same parent in the tree viewer. If they don't we automatically disable all actions.

Designed to be as fast as possible by going directly to the SWT widgets


menuAboutToShow

public void menuAboutToShow(IMenuManager menu)
Called when the context menu is about to open. Calls fillContextMenu(IMenuManager)


addSelectionChangedListener

public void addSelectionChangedListener(ISelectionChangedListener listener)

getSelection

public ISelection getSelection()
Returns the current selection for this provider.

Returns:
the current selection

removeSelectionChangedListener

public void removeSelectionChangedListener(ISelectionChangedListener listener)
Removes the given selection change listener from this selection provider. Has no affect if an identical listener is not registered.

Parameters:
listener - a selection changed listener

setSelection

public void setSelection(ISelection selection)
Sets the current selection for this selection provider.

Parameters:
selection - the new selection

setViewPartTitle

public void setViewPartTitle(String title)
Set the title of this view part

Parameters:
title -

selectionChanged

public void selectionChanged(SelectionChangedEvent event)
See Also:
ISelectionChangedListener

getCurrentViewer

public StructuredViewer getCurrentViewer()
Gets the current viewer, i.e. the viewer whose control is being currently displayed in the view.

Returns:
the current viewer, or null if there is no current viewer.

clearErrorMessage

public void clearErrorMessage()
Clears the currently displayed error message and redisplayes the message which was active before the error message was set.

Specified by:
clearErrorMessage in interface ISystemMessageLine

clearMessage

public void clearMessage()
Clears the currently displayed message.

Specified by:
clearMessage in interface ISystemMessageLine

getErrorMessage

public String getErrorMessage()
Get the currently displayed error text.

Specified by:
getErrorMessage in interface ISystemMessageLine
Returns:
The error message. If no error message is displayed null is returned.

getMessage

public String getMessage()
Get the currently displayed message.

Specified by:
getMessage in interface ISystemMessageLine
Returns:
The message. If no message is displayed null is returned.

setErrorMessage

public void setErrorMessage(String message)
Display the given error message. A currently displayed message is saved and will be redisplayed when the error message is cleared.

Specified by:
setErrorMessage in interface ISystemMessageLine

getSystemErrorMessage

public SystemMessage getSystemErrorMessage()
Get the currently displayed error text.

Specified by:
getSystemErrorMessage in interface ISystemMessageLine
Returns:
The error message. If no error message is displayed null is returned.

setErrorMessage

public void setErrorMessage(SystemMessage message)
Display the given error message. A currently displayed message is saved and will be redisplayed when the error message is cleared.

Specified by:
setErrorMessage in interface ISystemMessageLine

setErrorMessage

public void setErrorMessage(Throwable exc)
Display the given error message. A currently displayed message is saved and will be redisplayed when the error message is cleared.

Specified by:
setErrorMessage in interface ISystemMessageLine

setMessage

public void setMessage(String message)
Set the message text. If the message line currently displays an error, the message is stored and will be shown after a call to clearErrorMessage

Specified by:
setMessage in interface ISystemMessageLine

setMessage

public void setMessage(SystemMessage message)
If the message line currently displays an error, the message is stored and will be shown after a call to clearErrorMessage

Specified by:
setMessage in interface ISystemMessageLine

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.