g-Eclipse
Release 1.0.0

eu.geclipse.ui.views
Class GridModelViewPart

java.lang.Object
  extended by ViewPart
      extended by eu.geclipse.ui.views.GridModelViewPart
All Implemented Interfaces:
IGridModelListener, java.util.EventListener
Direct Known Subclasses:
TreeControlViewPart

public abstract class GridModelViewPart
extends ViewPart
implements IGridModelListener

Abstract superclass of all views that show GridModel related data. Views that extend this class mainly consist of a StructuredViewer and may contribute actions to context menus for instance. The root element of the viewer has to be an IGridElement that is returned by the getRootElement() method. Subclasses also have to specified the content and label providers that are used to render the data. These providers are specified by the createContentProvider() and createLabelProvider() methods.


Constructor Summary
GridModelViewPart()
           
 
Method Summary
 void createPartControl(Composite parent)
           
 void dispose()
           
 StructuredViewer getViewer()
          Get the StructuredViewer that is associated with this view.
 void gridModelChanged(IGridModelEvent event)
          The method is called everytime a change in the model occurred and the event processing is active.
 boolean isDragSource(IGridElement element)
          Determines if drag'n'drop should be made available for the specified element.
 void refreshViewer()
          Refresh the associated StructuredViewer.
 void refreshViewer(IGridElement element)
          Refresh the associated StructuredViewer.
 void setFocus()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridModelViewPart

public GridModelViewPart()
Method Detail

createPartControl

public void createPartControl(Composite parent)

dispose

public void dispose()

getViewer

public StructuredViewer getViewer()
Get the StructuredViewer that is associated with this view.

Returns:
The viewer that is responsible to show the content of this view.

gridModelChanged

public void gridModelChanged(IGridModelEvent event)
Description copied from interface: IGridModelListener
The method is called everytime a change in the model occurred and the event processing is active.

Specified by:
gridModelChanged in interface IGridModelListener
Parameters:
event - The event that occurred in the model.

isDragSource

public boolean isDragSource(IGridElement element)
Determines if drag'n'drop should be made available for the specified element.

Parameters:
element - The element for which drag'n'drop operations should be either allowed or forbidden.
Returns:
True if drag'n'drop should be enabled for the specified element, false otherwise.

refreshViewer

public void refreshViewer()
Refresh the associated StructuredViewer. Calls the StructuredViewer#refresh() method and ensures that this method is called in an UI thread.

See Also:
StructuredViewer#refresh()

refreshViewer

public void refreshViewer(IGridElement element)
Refresh the associated StructuredViewer. Calls the StructuredViewer#refresh(Object) method and ensures that this method is called in an UI thread.

Parameters:
element - The element that should be refreshed recursively.
See Also:
StructuredViewer#refresh(Object)

setFocus

public void setFocus()

g-Eclipse
Release 1.0.0