org.eclipse.net4j.util.ui.views
Class ContainerView

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.ui.part.WorkbenchPart
          extended by org.eclipse.ui.part.ViewPart
              extended by org.eclipse.net4j.util.ui.views.ContainerView
All Implemented Interfaces:
IAdaptable, IExecutableExtension, ISelectionProvider, IPersistable, IViewPart, IWorkbenchPart, IWorkbenchPart2, IWorkbenchPart3, ISetSelectionTarget, IWorkbenchPartOrientation
Direct Known Subclasses:
ContainerView.Default

public abstract class ContainerView
extends ViewPart
implements ISelectionProvider, ISetSelectionTarget


Nested Class Summary
static class ContainerView.Default<CONTAINER extends IContainer<?>>
           
protected static class ContainerView.MessageType
           
 
Field Summary
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
ContainerView()
           
 
Method Summary
 void addSelectionChangedListener(ISelectionChangedListener listener)
          Adds a listener for selection changes in this selection provider.
protected  void closeView()
           
protected  void contributeToActionBars()
           
protected  ContainerItemProvider<IContainer<Object>> createContainerItemProvider()
           
protected  IContentProvider createContentProvider()
           
protected  void createdUI()
           
protected  ILabelDecorator createLabelDecorator()
           
protected  IBaseLabelProvider createLabelProvider()
           
 void createPartControl(Composite parent)
          Creates the SWT controls for this workbench part.
protected  Control createUI(Composite parent)
           
protected  void doubleClicked(Object object)
           
protected  void fillContextMenu(IMenuManager manager, ITreeSelection selection)
           
protected  void fillLocalPullDown(IMenuManager manager)
           
protected  void fillLocalToolBar(IToolBarManager manager)
           
static ImageDescriptor getAddImageDescriptor()
           
protected abstract  IContainer<?> getContainer()
           
static ImageDescriptor getDeleteImageDescriptor()
           
protected  Display getDisplay()
           
protected  Color getElementBackground(Object element)
           
protected  Font getElementFont(Object element)
           
protected  Color getElementForeground(Object element)
           
protected  Image getElementImage(Object element)
           
protected  String getElementText(Object element)
           
protected  Action getRefreshAction()
           
static ImageDescriptor getRefreshImageDescriptor()
           
protected  IElementFilter getRootElementFilter()
           
 ISelection getSelection()
          Returns the current selection for this provider.
 Shell getShell()
           
 TreeViewer getViewer()
           
protected  void hookContextMenu()
           
protected  void hookDoubleClick()
           
protected  void initViewer()
           
 void refreshElement(Object element, boolean updateLabels)
           
protected  void refreshPressed()
           
 void refreshViewer(boolean updateLabels)
           
 void removeSelectionChangedListener(ISelectionChangedListener listener)
          Removes the given selection change listener from this selection provider.
 void resetInput()
           
 void revealElement(Object element)
           
protected  void selectionChanged(IActionBars bars, ITreeSelection selection)
           
 void selectReveal(ISelection selection)
          Reveals and selects the given element within this target view.
 void setFocus()
          Asks this part to take focus within the workbench.
 void setSelection(ISelection selection)
          Sets the current selection for this selection provider.
protected  boolean showMessage(ContainerView.MessageType type, String message)
           
protected  void showMessage(String message)
           
 void updateLabels(Object element)
           
 
Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, init, saveState, setContentDescription, setInitializationData, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, dispose, firePartPropertyChanged, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, dispose, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

ContainerView

public ContainerView()
Method Detail

getShell

public Shell getShell()

getViewer

public TreeViewer getViewer()

setFocus

public void setFocus()
Description copied from interface: org.eclipse.ui.IWorkbenchPart
Asks this part to take focus within the workbench. Parts must assign focus to one of the controls contained in the part's parent composite.

Clients should not call this method (the workbench calls this method at appropriate times). To have the workbench activate a part, use IWorkbenchPage.activate(IWorkbenchPart) instead.

Specified by:
setFocus in interface IWorkbenchPart
Specified by:
setFocus in class WorkbenchPart

resetInput

public void resetInput()

getSelection

public ISelection getSelection()
Description copied from interface: org.eclipse.jface.viewers.ISelectionProvider
Returns the current selection for this provider.

Specified by:
getSelection in interface ISelectionProvider
Returns:
the current selection
Since:
3.0

setSelection

public void setSelection(ISelection selection)
Description copied from interface: org.eclipse.jface.viewers.ISelectionProvider
Sets the current selection for this selection provider.

Specified by:
setSelection in interface ISelectionProvider
Parameters:
selection - the new selection
Since:
3.0

addSelectionChangedListener

public void addSelectionChangedListener(ISelectionChangedListener listener)
Description copied from interface: org.eclipse.jface.viewers.ISelectionProvider
Adds a listener for selection changes in this selection provider. Has no effect if an identical listener is already registered.

Specified by:
addSelectionChangedListener in interface ISelectionProvider
Parameters:
listener - a selection changed listener
Since:
3.0

removeSelectionChangedListener

public void removeSelectionChangedListener(ISelectionChangedListener listener)
Description copied from interface: org.eclipse.jface.viewers.ISelectionProvider
Removes the given selection change listener from this selection provider. Has no effect if an identical listener is not registered.

Specified by:
removeSelectionChangedListener in interface ISelectionProvider
Parameters:
listener - a selection changed listener
Since:
3.0

selectReveal

public void selectReveal(ISelection selection)
Description copied from interface: org.eclipse.ui.part.ISetSelectionTarget
Reveals and selects the given element within this target view.

Specified by:
selectReveal in interface ISetSelectionTarget
Parameters:
selection - the new element to select

createPartControl

public final void createPartControl(Composite parent)
Description copied from interface: org.eclipse.ui.IWorkbenchPart
Creates the SWT controls for this workbench part.

Clients should not call this method (the workbench calls this method when it needs to, which may be never).

For implementors this is a multi-step process:

  1. Create one or more controls within the parent.
  2. Set the parent layout as needed.
  3. Register any global actions with the site's IActionBars.
  4. Register any context menus with the site.
  5. Register a selection provider with the site, to make it available to the workbench's ISelectionService (optional).

Specified by:
createPartControl in interface IWorkbenchPart
Specified by:
createPartControl in class WorkbenchPart
Parameters:
parent - the parent control

createUI

protected Control createUI(Composite parent)

createdUI

protected void createdUI()
Since:
3.1

initViewer

protected void initViewer()
Since:
3.1

createContentProvider

protected IContentProvider createContentProvider()
Since:
3.0

createLabelProvider

protected IBaseLabelProvider createLabelProvider()
Since:
3.0

createLabelDecorator

protected ILabelDecorator createLabelDecorator()
Since:
3.0

createContainerItemProvider

protected ContainerItemProvider<IContainer<Object>> createContainerItemProvider()

getElementText

protected String getElementText(Object element)

getElementImage

protected Image getElementImage(Object element)

getElementForeground

protected Color getElementForeground(Object element)
Since:
3.0

getElementBackground

protected Color getElementBackground(Object element)
Since:
3.0

getElementFont

protected Font getElementFont(Object element)
Since:
3.0

getRootElementFilter

protected IElementFilter getRootElementFilter()

getContainer

protected abstract IContainer<?> getContainer()

hookDoubleClick

protected void hookDoubleClick()

hookContextMenu

protected void hookContextMenu()

contributeToActionBars

protected void contributeToActionBars()

fillLocalPullDown

protected void fillLocalPullDown(IMenuManager manager)

fillLocalToolBar

protected void fillLocalToolBar(IToolBarManager manager)

fillContextMenu

protected void fillContextMenu(IMenuManager manager,
                               ITreeSelection selection)

selectionChanged

protected void selectionChanged(IActionBars bars,
                                ITreeSelection selection)

doubleClicked

protected void doubleClicked(Object object)

refreshPressed

protected void refreshPressed()
Since:
3.1

closeView

protected void closeView()

showMessage

protected void showMessage(String message)

showMessage

protected boolean showMessage(ContainerView.MessageType type,
                              String message)

getRefreshAction

protected Action getRefreshAction()
Since:
3.1

getDisplay

protected Display getDisplay()

refreshViewer

public void refreshViewer(boolean updateLabels)

refreshElement

public void refreshElement(Object element,
                           boolean updateLabels)

updateLabels

public void updateLabels(Object element)

revealElement

public void revealElement(Object element)

getAddImageDescriptor

public static ImageDescriptor getAddImageDescriptor()

getDeleteImageDescriptor

public static ImageDescriptor getDeleteImageDescriptor()

getRefreshImageDescriptor

public static ImageDescriptor getRefreshImageDescriptor()


Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.