org.eclipse.gmt.weaver.editors.weaving
Class GenericWeavingPanel

java.lang.Object
  extended by org.eclipse.gmt.weaver.editors.weaving.GenericWeavingPanel
All Implemented Interfaces:
IWeaverMenuAdapter, IWeavingPanel, org.eclipse.jface.action.IMenuListener, org.eclipse.swt.widgets.Listener, org.eclipse.ui.IPropertyListener
Direct Known Subclasses:
DefaultWeavingPanel, TransformationWeavingPanel

public abstract class GenericWeavingPanel
extends java.lang.Object
implements IWeavingPanel

Since:
AMW2006

Field Summary
protected  org.eclipse.swt.widgets.ToolBar actionBar
           
protected  org.eclipse.swt.widgets.Composite container
           
protected  org.eclipse.swt.custom.ViewForm control
           
protected  org.eclipse.jface.viewers.ISelection editorSelection
           
protected  GlobalWeaverEditor globalEditor
           
protected  org.eclipse.jface.action.MenuManager menuManager
           
protected  org.eclipse.swt.events.MouseListener mouseListener
           
protected  org.eclipse.swt.graphics.Image pullDownImage
           
protected  org.eclipse.swt.widgets.ToolBar systemBar
           
protected  org.eclipse.swt.custom.CLabel titleLabel
           
protected  org.eclipse.jface.action.ToolBarManager toolBarManager
           
protected  org.eclipse.jface.viewers.Viewer viewer
           
 
Constructor Summary
GenericWeavingPanel()
          Constructs a view panel for a view part.
 
Method Summary
 void addWeaverSelectionChangedListener(IWSelectionChangedListener listener)
          adds a new selection listener.
 void createActions(org.eclipse.emf.ecore.EObject eObj)
          creates a list with sub menu actions associated with this eObj
protected  void createContextMenu()
          Creates context menu
 void createControl(org.eclipse.swt.widgets.Composite parent)
          Create the control
protected  void createTitleBar()
          Creates a title bar for the pane which includes the view icon and title to the far left, and the close X icon to the far right.
 org.eclipse.jface.viewers.Viewer createViewer(org.eclipse.swt.widgets.Composite parent)
          Create the viewer
 void createWLinkEndActions(org.eclipse.emf.ecore.EObject wLinkEnd)
          Creates the actions with the weaving elements for the current WLinkEnd object
 void dispose()
          Dispose the panel
protected  void doMaximize()
          Maximizes panel
 org.eclipse.swt.widgets.Control getControl()
          Gets the control.
 org.eclipse.jface.viewers.ISelection getEditorSelection()
           
 GlobalWeaverEditor getGlobalEditor()
           
 java.util.List getListeners()
           
 org.eclipse.jface.action.MenuManager getMenuManager()
          Returns the menu manager
 java.util.List getResourceActions()
           
 java.util.List getResourceActionsDescription()
           
 org.eclipse.swt.custom.CLabel getTitleLabel()
           
 org.eclipse.jface.action.ToolBarManager getToolBarManager()
          Returns the toolbar manager
 org.eclipse.jface.viewers.Viewer getViewer()
          Get the viewer
protected  org.eclipse.swt.custom.ViewForm getViewForm()
          Gets the view form.
 WeavingPanelDndManager getWeavingDndManager()
           
 java.util.Collection getWLinkEndActions()
           
 void handleEvent(org.eclipse.swt.widgets.Event event)
           
 void hookFocus(org.eclipse.swt.widgets.Control ctrl)
          Hook focus on a control.
 void init(GlobalWeaverEditor editor)
          Initialize the panel with the reference of the Global Editor
protected  void makeContributions(org.eclipse.jface.action.IMenuManager menuManager, org.eclipse.jface.action.IToolBarManager toolBarManager, org.eclipse.jface.action.IStatusLineManager statusLineManager)
          Makes contributions
 void menuAboutToShow(org.eclipse.jface.action.IMenuManager manager)
           
protected  void populateManager(org.eclipse.jface.action.IContributionManager manager, java.util.Collection actions, java.lang.String contributionID)
          Adds elements to the menu
 void populateMenuAboutToShow(org.eclipse.jface.action.IMenuManager parentMenu)
          populates the menu with the private actions into the parent menu specified
 void propertyChanged(java.lang.Object source, int propId)
          Indicates that a property has changed.
 void removeWeaverSelectionChangedListener(IWSelectionChangedListener listener)
          removes the selection listener
protected  void requestActivation()
          Notify the workbook page that the part pane has been activated by the user.
 void setEditorSelection(org.eclipse.jface.viewers.ISelection editorSelection)
           
 void setFocus()
          Sets focus to this part.
 void setGlobalEditor(GlobalWeaverEditor globalEditor)
           
 void setInput(org.eclipse.emf.ecore.resource.ResourceSet input)
          Sets the ressource set
 void setListeners(java.util.List listeners)
           
 void setResourceActions(java.util.List resourceActions)
           
 void setResourceActionsDescription(java.util.List resourceActionsDescription)
           
 void setSelectionChanged(java.util.List ids, java.util.List modelURIs, org.eclipse.emf.ecore.EObject currentSelection)
          set selection changed and pass a list of uris and the current selected obj
 void setTitle(java.lang.Object object)
          Sets the panel title for ContentViewer
 void setTitle(java.lang.String title, org.eclipse.swt.graphics.Image image)
          Set the panel title
 void setTitleLabel(org.eclipse.swt.custom.CLabel titleLabel)
           
 void setViewersSelection(org.eclipse.jface.viewers.ISelection aSelection)
          Verifies if the current selection is a WLink or WLinkEnd to select correct elements in the woven models
 void setWAssociationEndSelection(org.eclipse.emf.ecore.EObject selected, boolean selectCurrentObject, java.util.List selectedIDs, java.util.List modelURIs)
          Sets selection behavior for WAssociationEnd elements
 void setWAssociationSelection(org.eclipse.emf.ecore.EObject selected, java.util.List selectedIDs, java.util.List modelURIs)
          Sets selection behavior for WAssociation elements
 void setWeavingDndManager(WeavingPanelDndManager weavingDndManager)
           
 void setWLinkEndActions(java.util.Collection linkEndActions)
           
 void setWLinkEndSelection(java.util.List wLinkEnds, java.util.List selectedList, java.util.List modelURIs)
          Gets the WElementRefs uri associated with this WLinkEnd
 void setWLinkSelection(org.eclipse.emf.ecore.EObject selected, java.util.List selectedList, java.util.List modelURIs)
          Sets selection behavior for WLinks elements
 void showFocus(boolean inFocus)
          Indicates focus in part.
 java.lang.String toString()
           
 void updateActionBars()
          Updates action bars
 void updateTitles()
          Updates the title attributes.
 void wSelectionChanged(org.eclipse.jface.viewers.ISelection selection)
          Selection changed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

viewer

protected org.eclipse.jface.viewers.Viewer viewer

container

protected org.eclipse.swt.widgets.Composite container

titleLabel

protected org.eclipse.swt.custom.CLabel titleLabel

actionBar

protected org.eclipse.swt.widgets.ToolBar actionBar

toolBarManager

protected org.eclipse.jface.action.ToolBarManager toolBarManager

menuManager

protected org.eclipse.jface.action.MenuManager menuManager

pullDownImage

protected org.eclipse.swt.graphics.Image pullDownImage

systemBar

protected org.eclipse.swt.widgets.ToolBar systemBar

control

protected org.eclipse.swt.custom.ViewForm control

globalEditor

protected GlobalWeaverEditor globalEditor

editorSelection

protected org.eclipse.jface.viewers.ISelection editorSelection

mouseListener

protected org.eclipse.swt.events.MouseListener mouseListener
Constructor Detail

GenericWeavingPanel

public GenericWeavingPanel()
Constructs a view panel for a view part.

Method Detail

init

public void init(GlobalWeaverEditor editor)
Description copied from interface: IWeavingPanel
Initialize the panel with the reference of the Global Editor

Specified by:
init in interface IWeavingPanel

createViewer

public org.eclipse.jface.viewers.Viewer createViewer(org.eclipse.swt.widgets.Composite parent)
Description copied from interface: IWeavingPanel
Create the viewer

Specified by:
createViewer in interface IWeavingPanel

createControl

public void createControl(org.eclipse.swt.widgets.Composite parent)
Description copied from interface: IWeavingPanel
Create the control

Specified by:
createControl in interface IWeavingPanel

wSelectionChanged

public void wSelectionChanged(org.eclipse.jface.viewers.ISelection selection)
Selection changed

Parameters:
selection -

setViewersSelection

public void setViewersSelection(org.eclipse.jface.viewers.ISelection aSelection)
Verifies if the current selection is a WLink or WLinkEnd to select correct elements in the woven models

Specified by:
setViewersSelection in interface IWeavingPanel
Parameters:
aSelection -

setWAssociationSelection

public void setWAssociationSelection(org.eclipse.emf.ecore.EObject selected,
                                     java.util.List selectedIDs,
                                     java.util.List modelURIs)
Sets selection behavior for WAssociation elements

Parameters:
selected - the selected wAssociation
selectedURIs - a list with all selected objects. (The selection must be done in one pass otherwise it will not work correctly)

setWAssociationEndSelection

public void setWAssociationEndSelection(org.eclipse.emf.ecore.EObject selected,
                                        boolean selectCurrentObject,
                                        java.util.List selectedIDs,
                                        java.util.List modelURIs)
Sets selection behavior for WAssociationEnd elements

Parameters:
selected - the selected wAssociationEnd
selectCurrentObject - if the current association end will be also selecte
selectedURIs - a list with all selected objects. (The selection must be done in one pass otherwise it will not work correctly)

setWLinkSelection

public void setWLinkSelection(org.eclipse.emf.ecore.EObject selected,
                              java.util.List selectedList,
                              java.util.List modelURIs)
Sets selection behavior for WLinks elements

Parameters:
selected -
selectedList -

setWLinkEndSelection

public void setWLinkEndSelection(java.util.List wLinkEnds,
                                 java.util.List selectedList,
                                 java.util.List modelURIs)
Gets the WElementRefs uri associated with this WLinkEnd

Parameters:
wLinkEnd -
selectedList -

makeContributions

protected void makeContributions(org.eclipse.jface.action.IMenuManager menuManager,
                                 org.eclipse.jface.action.IToolBarManager toolBarManager,
                                 org.eclipse.jface.action.IStatusLineManager statusLineManager)
Makes contributions

Parameters:
menuManager -
toolBarManager -
statusLineManager -

menuAboutToShow

public void menuAboutToShow(org.eclipse.jface.action.IMenuManager manager)
Specified by:
menuAboutToShow in interface org.eclipse.jface.action.IMenuListener

populateMenuAboutToShow

public void populateMenuAboutToShow(org.eclipse.jface.action.IMenuManager parentMenu)
Description copied from interface: IWeaverMenuAdapter
populates the menu with the private actions into the parent menu specified

Specified by:
populateMenuAboutToShow in interface IWeaverMenuAdapter

createContextMenu

protected void createContextMenu()
Creates context menu


addWeaverSelectionChangedListener

public void addWeaverSelectionChangedListener(IWSelectionChangedListener listener)
Description copied from interface: IWeavingPanel
adds a new selection listener.

Specified by:
addWeaverSelectionChangedListener in interface IWeavingPanel

removeWeaverSelectionChangedListener

public void removeWeaverSelectionChangedListener(IWSelectionChangedListener listener)
Description copied from interface: IWeavingPanel
removes the selection listener

Specified by:
removeWeaverSelectionChangedListener in interface IWeavingPanel

setSelectionChanged

public void setSelectionChanged(java.util.List ids,
                                java.util.List modelURIs,
                                org.eclipse.emf.ecore.EObject currentSelection)
set selection changed and pass a list of uris and the current selected obj

Parameters:
ids -
currentSelection -

getViewer

public org.eclipse.jface.viewers.Viewer getViewer()
Description copied from interface: IWeavingPanel
Get the viewer

Specified by:
getViewer in interface IWeavingPanel
Returns:

setInput

public void setInput(org.eclipse.emf.ecore.resource.ResourceSet input)
Sets the ressource set

Specified by:
setInput in interface IWeavingPanel
Parameters:
input -

getControl

public org.eclipse.swt.widgets.Control getControl()
Gets the control.


getViewForm

protected org.eclipse.swt.custom.ViewForm getViewForm()
Gets the view form.


handleEvent

public void handleEvent(org.eclipse.swt.widgets.Event event)
Specified by:
handleEvent in interface org.eclipse.swt.widgets.Listener
See Also:
Listener

hookFocus

public void hookFocus(org.eclipse.swt.widgets.Control ctrl)
Hook focus on a control.


requestActivation

protected void requestActivation()
Notify the workbook page that the part pane has been activated by the user.


setFocus

public void setFocus()
Sets focus to this part.


createTitleBar

protected void createTitleBar()
Creates a title bar for the pane which includes the view icon and title to the far left, and the close X icon to the far right. The middle part is reserved for the view part to add a menu and tools.


doMaximize

protected void doMaximize()
Maximizes panel


dispose

public void dispose()
Description copied from interface: IWeavingPanel
Dispose the panel

Specified by:
dispose in interface IWeavingPanel

getMenuManager

public org.eclipse.jface.action.MenuManager getMenuManager()
Returns the menu manager

Returns:

getToolBarManager

public org.eclipse.jface.action.ToolBarManager getToolBarManager()
Returns the toolbar manager

Returns:

propertyChanged

public void propertyChanged(java.lang.Object source,
                            int propId)
Indicates that a property has changed.

Specified by:
propertyChanged in interface org.eclipse.ui.IPropertyListener
Parameters:
source - the object whose property has changed
propId - the id of the property which has changed; property ids are generally defined as constants on the source class

showFocus

public void showFocus(boolean inFocus)
Indicates focus in part.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

updateActionBars

public void updateActionBars()
Updates action bars


updateTitles

public void updateTitles()
Updates the title attributes.


setTitle

public void setTitle(java.lang.Object object)
Description copied from interface: IWeavingPanel
Sets the panel title for ContentViewer

Specified by:
setTitle in interface IWeavingPanel

setTitle

public void setTitle(java.lang.String title,
                     org.eclipse.swt.graphics.Image image)
Description copied from interface: IWeavingPanel
Set the panel title

Specified by:
setTitle in interface IWeavingPanel

createActions

public void createActions(org.eclipse.emf.ecore.EObject eObj)
Description copied from interface: IWeaverMenuAdapter
creates a list with sub menu actions associated with this eObj

Specified by:
createActions in interface IWeaverMenuAdapter

createWLinkEndActions

public void createWLinkEndActions(org.eclipse.emf.ecore.EObject wLinkEnd)
Creates the actions with the weaving elements for the current WLinkEnd object

Parameters:
wLinkEnd -

populateManager

protected void populateManager(org.eclipse.jface.action.IContributionManager manager,
                               java.util.Collection actions,
                               java.lang.String contributionID)
Adds elements to the menu

Parameters:
manager -
actions -
contributionID -

getGlobalEditor

public GlobalWeaverEditor getGlobalEditor()
Specified by:
getGlobalEditor in interface IWeavingPanel
Returns:
Returns the globalEditor.

setGlobalEditor

public void setGlobalEditor(GlobalWeaverEditor globalEditor)
Parameters:
globalEditor - The globalEditor to set.

getListeners

public java.util.List getListeners()
Returns:
Returns the listeners.

setListeners

public void setListeners(java.util.List listeners)
Parameters:
listeners - The listeners to set.

getResourceActions

public java.util.List getResourceActions()
Returns:
Returns the resourceActions.

setResourceActions

public void setResourceActions(java.util.List resourceActions)
Parameters:
resourceActions - The resourceActions to set.

getResourceActionsDescription

public java.util.List getResourceActionsDescription()
Returns:
Returns the resourceActionsDescription.

setResourceActionsDescription

public void setResourceActionsDescription(java.util.List resourceActionsDescription)
Parameters:
resourceActionsDescription - The resourceActionsDescription to set.

getWeavingDndManager

public WeavingPanelDndManager getWeavingDndManager()
Returns:
Returns the weavingDndManager.

setWeavingDndManager

public void setWeavingDndManager(WeavingPanelDndManager weavingDndManager)
Parameters:
weavingDndManager - The weavingDndManager to set.

getWLinkEndActions

public java.util.Collection getWLinkEndActions()
Returns:
Returns the wLinkEndActions.

setWLinkEndActions

public void setWLinkEndActions(java.util.Collection linkEndActions)
Parameters:
linkEndActions - The wLinkEndActions to set.

getEditorSelection

public org.eclipse.jface.viewers.ISelection getEditorSelection()
Returns:
Returns the editorSelection.

setEditorSelection

public void setEditorSelection(org.eclipse.jface.viewers.ISelection editorSelection)
Parameters:
editorSelection - The editorSelection to set.

getTitleLabel

public org.eclipse.swt.custom.CLabel getTitleLabel()
Returns:
Returns the titleLabel.

setTitleLabel

public void setTitleLabel(org.eclipse.swt.custom.CLabel titleLabel)
Parameters:
titleLabel - The titleLabel to set.