org.mockcentral.editor.components
Class MockCentralPluginNodeGroupView

java.lang.Object
  extended by org.mockcentral.editor.components.MockCentralPluginNodeView
      extended by org.mockcentral.editor.components.MockCentralPluginNodeGroupView
All Implemented Interfaces:
org.eclipse.jface.viewers.IDoubleClickListener, org.mockcentral.editor.nodes.IMockCentralGroupNodeModelObserver, org.mockcentral.editor.nodes.IMockCentralNodeView, org.mockcentral.editor.nodes.problem.INodeProblemListener, org.mockcentral.editor.viewers.IMockCentralNodeGroupViewer
Direct Known Subclasses:
EditExpectationGroupPage, EditFixtureGroupPage, EditMockObjectGroupPage

public abstract class MockCentralPluginNodeGroupView
extends MockCentralPluginNodeView
implements org.mockcentral.editor.viewers.IMockCentralNodeGroupViewer, org.eclipse.jface.viewers.IDoubleClickListener, org.mockcentral.editor.nodes.IMockCentralGroupNodeModelObserver

Base for the view classes used to edit MockCentralNode data which display a group of child nodes. These editors are embedded in the ScrolledPageBook on the EditorFormPage.

Author:
David Hutchinson

Field Summary
protected  java.lang.String allChildrenSectionTitleKey
          A key for looking up the String to be used for the title of the Section containing the TableViewer that displays the children.
protected  java.lang.String newButtonTipTextKey
          A key for looking up the String to be used for the tooltip text for the 'new' Button.
protected  java.lang.String pageTitleKey
          A key for looking up the String to be used for the title of the page.
protected  java.lang.String sortButtonTipTextKey
          A key for looking up the String to be used for the tooltip text for the 'sort' Button.
protected  TableViewerAdapter tableViewerAdapter
          the TableViewerAdapter containing the viewer for the group of MockCentralNode children.
 
Fields inherited from class org.mockcentral.editor.components.MockCentralPluginNodeView
imagesMap, page, toolkit
 
Constructor Summary
MockCentralPluginNodeGroupView(org.eclipse.ui.forms.widgets.FormToolkit toolkit, org.eclipse.swt.widgets.Composite page)
          Creates a new instance.
 
Method Summary
 void addNewChildren(java.util.List<org.mockcentral.editor.nodes.MockCentralNode> children)
          Creates and executes a new AddMultipleNodesOperation with the supplied list of MockCentralNode instances.
 void childrenChanged()
           
protected  void createPageContent(org.eclipse.ui.forms.widgets.FormToolkit toolkit)
          Creates the content of the page.
 void dispose()
          Disposes of resources as necessary.
 void doubleClick(org.eclipse.jface.viewers.DoubleClickEvent event)
           
protected  void fillContextMenu(org.eclipse.jface.action.IMenuManager manager)
          Adds dynamic content to the context menu.
 org.mockcentral.editor.nodes.IMockCentralClipboard getClipboard()
           
 java.lang.String getInputDescription()
           
 org.mockcentral.editor.nodes.MockCentralGroupNodeModel getNodeGroupModel()
           
 java.lang.Object getSelectedNode()
           
 int getSelectedNodeIndex()
           
 TableViewerAdapter getTableViewerAdapter()
          Returns the TableViewerAdapter.
 void setNodeModel(org.mockcentral.editor.nodes.MockCentralNodeModel o)
           
abstract  void showCreateNewChildDialog()
          Displays a Dialog for creating a new entry for the group of MockCentralNode instances.
 
Methods inherited from class org.mockcentral.editor.components.MockCentralPluginNodeView
createButton, createLabel, getImagesMap, getOperationHistory, getUndoContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mockcentral.editor.nodes.problem.INodeProblemListener
updateNodeProblems
 

Field Detail

pageTitleKey

protected java.lang.String pageTitleKey
A key for looking up the String to be used for the title of the page.


allChildrenSectionTitleKey

protected java.lang.String allChildrenSectionTitleKey
A key for looking up the String to be used for the title of the Section containing the TableViewer that displays the children.


newButtonTipTextKey

protected java.lang.String newButtonTipTextKey
A key for looking up the String to be used for the tooltip text for the 'new' Button.


sortButtonTipTextKey

protected java.lang.String sortButtonTipTextKey
A key for looking up the String to be used for the tooltip text for the 'sort' Button.


tableViewerAdapter

protected TableViewerAdapter tableViewerAdapter
the TableViewerAdapter containing the viewer for the group of MockCentralNode children.

Constructor Detail

MockCentralPluginNodeGroupView

public MockCentralPluginNodeGroupView(org.eclipse.ui.forms.widgets.FormToolkit toolkit,
                                      org.eclipse.swt.widgets.Composite page)
Creates a new instance.

Parameters:
toolkit - the FormToolkit.
page - the enclosing Composite.
Method Detail

dispose

public void dispose()
Disposes of resources as necessary.

Overrides:
dispose in class MockCentralPluginNodeView

getInputDescription

public java.lang.String getInputDescription()
Specified by:
getInputDescription in interface org.mockcentral.editor.nodes.IMockCentralNodeView

setNodeModel

public void setNodeModel(org.mockcentral.editor.nodes.MockCentralNodeModel o)
Specified by:
setNodeModel in interface org.mockcentral.editor.nodes.IMockCentralNodeView

childrenChanged

public void childrenChanged()
Specified by:
childrenChanged in interface org.mockcentral.editor.nodes.IMockCentralGroupNodeModelObserver

doubleClick

public void doubleClick(org.eclipse.jface.viewers.DoubleClickEvent event)
Specified by:
doubleClick in interface org.eclipse.jface.viewers.IDoubleClickListener

showCreateNewChildDialog

public abstract void showCreateNewChildDialog()
Displays a Dialog for creating a new entry for the group of MockCentralNode instances.

Specified by:
showCreateNewChildDialog in interface org.mockcentral.editor.viewers.IMockCentralNodeGroupViewer

getSelectedNode

public java.lang.Object getSelectedNode()
Specified by:
getSelectedNode in interface org.mockcentral.editor.viewers.IMockCentralNodeGroupViewer

getSelectedNodeIndex

public int getSelectedNodeIndex()
Specified by:
getSelectedNodeIndex in interface org.mockcentral.editor.viewers.IMockCentralNodeGroupViewer

getNodeGroupModel

public org.mockcentral.editor.nodes.MockCentralGroupNodeModel getNodeGroupModel()
Specified by:
getNodeGroupModel in interface org.mockcentral.editor.viewers.IMockCentralNodeGroupViewer

getTableViewerAdapter

public TableViewerAdapter getTableViewerAdapter()
Returns the TableViewerAdapter.

Returns:
the TableViewerAdapter.

getClipboard

public org.mockcentral.editor.nodes.IMockCentralClipboard getClipboard()
Specified by:
getClipboard in interface org.mockcentral.editor.viewers.IMockCentralNodeGroupViewer

createPageContent

protected void createPageContent(org.eclipse.ui.forms.widgets.FormToolkit toolkit)
Creates the content of the page.

Parameters:
toolkit - the FormToolkit.

addNewChildren

public void addNewChildren(java.util.List<org.mockcentral.editor.nodes.MockCentralNode> children)
Creates and executes a new AddMultipleNodesOperation with the supplied list of MockCentralNode instances.

Specified by:
addNewChildren in interface org.mockcentral.editor.viewers.IMockCentralNodeGroupViewer
Parameters:
children - a list of MockCentralNode instances.

fillContextMenu

protected void fillContextMenu(org.eclipse.jface.action.IMenuManager manager)
Adds dynamic content to the context menu.

Parameters:
manager - the IMenuManager providing the menu.