com.ibm.jdg2e.view.marker
Class MarkerView

java.lang.Object
  extended byorg.eclipse.ui.part.WorkbenchPart
      extended byorg.eclipse.ui.part.ViewPart
          extended bycom.ibm.jdg2e.view.marker.MarkerView
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2

public class MarkerView
extends org.eclipse.ui.part.ViewPart

This view example uses the workspace as its input but only for markers of a specific type. The marker type that will be displayed has been defined as part of the com.ibm.jdg2e.resources.extensions project. A TableViewer is used to create the user interface.

This demonstrates some of the workspace-specific processing requirements for a view based on JFace viewers, including the user of a resource change listener to identify when there have been changes to the input.


Nested Class Summary
(package private) static class MarkerView.NameSorter
          Added to viewer to force alphabetical sort as-is (no other logic required).
 
Field Summary
(package private) static java.lang.String[] COLUMN_NAMES
          Columns for the table viewer
(package private) static java.lang.String[] MARKER_ATTRIBUTES
          Attributes that will be obtained from the marker
(package private) static java.lang.String MARKER_ID
          Identifier for the marker defined by extension in the com.ibm.jdg2e.resources.extensions project.
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
MarkerView()
          The constructor.
 
Method Summary
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
          Define user interface for the view.
(package private)  org.eclipse.jface.viewers.TableViewer multiColumnViewer(org.eclipse.swt.widgets.Composite parent)
          Creates a TableViewer that has a table with multiple columns.
(package private)  void openEditor(org.eclipse.jface.viewers.ISelection selection)
          Opens the file referenced by the marker in the appropriate editor.
 void setFocus()
          Passing the focus request to the viewer's control.
(package private)  void setupHelp()
          Markers are displayed in the viewer in this view.
 
Methods inherited from class org.eclipse.ui.part.ViewPart
getViewSite, init, init, saveState, setContentDescription, setInitializationData, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPropertyListener, dispose, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getPartName, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
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
 

Field Detail

COLUMN_NAMES

static final java.lang.String[] COLUMN_NAMES
Columns for the table viewer


MARKER_ATTRIBUTES

static final java.lang.String[] MARKER_ATTRIBUTES
Attributes that will be obtained from the marker


MARKER_ID

static final java.lang.String MARKER_ID
Identifier for the marker defined by extension in the com.ibm.jdg2e.resources.extensions project.

See Also:
Constant Field Values
Constructor Detail

MarkerView

public MarkerView()
The constructor.

Method Detail

createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)
Define user interface for the view. This view uses a viewer based implementation of a multi-column table.

See Also:
IWorkbenchPart.createPartControl(org.eclipse.swt.widgets.Composite)

multiColumnViewer

org.eclipse.jface.viewers.TableViewer multiColumnViewer(org.eclipse.swt.widgets.Composite parent)
Creates a TableViewer that has a table with multiple columns.

Parameters:
parent -
Returns:
- a TableViewer with columns.

openEditor

void openEditor(org.eclipse.jface.viewers.ISelection selection)
Opens the file referenced by the marker in the appropriate editor.

Logic extracted from similar Eclipse actions. Some of the Eclipse actions are a bit more robust in their implementation. See org.eclipse.ui.views.markers.internal.ActionOpenMarker for a more detailed example.

Parameters:
selection - - the marker that will be used to open an editor.

setFocus

public void setFocus()
Passing the focus request to the viewer's control.

See Also:
IWorkbenchPart.setFocus()

setupHelp

void setupHelp()
Markers are displayed in the viewer in this view. As markers can have help, and the type of marker being displayed does have help defined (in the com.ibm.jdg2e.resources.extensions project).

The marker help API is used to find and display any help defined for the marker being displayed.