pl.edu.agh.cast.ui
Class AbstractConfigurableView

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 pl.edu.agh.cast.ui.AbstractConfigurableView
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IPersistable, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.IWorkbenchPart3, org.eclipse.ui.part.IWorkbenchPartOrientation
Direct Known Subclasses:
AbstractTableView, AbstractTreeView

public abstract class AbstractConfigurableView
extends org.eclipse.ui.part.ViewPart

This abstract class is to be implemented by classes which want to store their state accross system start-stop cycles. This class implements the basic persistency scheme using IMemento object, which is maitained by the Eclipse Platform.

Author:
Aleksander Pohl apohllo[at]o2.pl

Field Summary
protected  org.eclipse.ui.IMemento _configuration
          The configuration of the view stored in IMemento object.
protected static org.apache.log4j.Logger log
          Logger
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
AbstractConfigurableView()
           
 
Method Summary
protected abstract  void activate()
          Activate the view, e.g.
protected abstract  void contributeToActionBars()
          Fill action bars with view specific actions.
 org.eclipse.ui.IMemento getConfiguration()
          Returns the configuration of the view.
protected abstract  void hookContextMenu()
          Add actions and action groups to context menu.
protected abstract  void hookDoubleClickAction()
          Provide action for double click.
 void init(org.eclipse.ui.IViewSite site, org.eclipse.ui.IMemento memento)
          This init method restores the configuration of this view using the IMemento object.
protected abstract  void makeActions()
          Create actions which are used in this view.
 void saveState(org.eclipse.ui.IMemento memento)
          Save the configuration of the view in IMemento object.
 
Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, setContentDescription, setInitializationData, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, createPartControl, dispose, firePartPropertyChanged, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setFocus, 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, createPartControl, dispose, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setFocus
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

_configuration

protected org.eclipse.ui.IMemento _configuration
The configuration of the view stored in IMemento object.


log

protected static org.apache.log4j.Logger log
Logger

Constructor Detail

AbstractConfigurableView

public AbstractConfigurableView()
Method Detail

init

public void init(org.eclipse.ui.IViewSite site,
                 org.eclipse.ui.IMemento memento)
          throws org.eclipse.ui.PartInitException
This init method restores the configuration of this view using the IMemento object.

Specified by:
init in interface org.eclipse.ui.IViewPart
Overrides:
init in class org.eclipse.ui.part.ViewPart
Throws:
org.eclipse.ui.PartInitException

saveState

public void saveState(org.eclipse.ui.IMemento memento)
Save the configuration of the view in IMemento object.

Specified by:
saveState in interface org.eclipse.ui.IPersistable
Specified by:
saveState in interface org.eclipse.ui.IViewPart
Overrides:
saveState in class org.eclipse.ui.part.ViewPart
Parameters:
memento - The IMemento object, which is used to store the configuration of the view.

getConfiguration

public org.eclipse.ui.IMemento getConfiguration()
Returns the configuration of the view.

Returns:
IMemento The configuration of the view.

makeActions

protected abstract void makeActions()
Create actions which are used in this view.


hookContextMenu

protected abstract void hookContextMenu()
Add actions and action groups to context menu.


hookDoubleClickAction

protected abstract void hookDoubleClickAction()
Provide action for double click.


contributeToActionBars

protected abstract void contributeToActionBars()
Fill action bars with view specific actions.


activate

protected abstract void activate()
Activate the view, e.g. register listeners, etc.



Copyright © 2007-2008 AGH University of Science and Technology. All Rights Reserved.