EGF Engine
Release 0.1.0

org.eclipse.egf.pattern.ui.editor
Class PatternEditor

java.lang.Object
  extended by SharedHeaderFormEditor
      extended by org.eclipse.egf.pattern.ui.editor.PatternEditor

public class PatternEditor
extends SharedHeaderFormEditor

Pattern editor.


Field Summary
static String ID
          Editor id.
 
Constructor Summary
PatternEditor()
           
 
Method Summary
 int addPage(IFormPage page_p)
           
protected  void addPages()
           
 void addPatternModificationListener(IPatternModificationListener listener_p)
          Add a modification listener to this editor.
protected  void createHeaderContents(IManagedForm headerForm_p)
           
 void dispose()
           
 void doSave(IProgressMonitor monitor_p)
           
 void doSaveAs()
           
 Object getAdapter(Class adapter_p)
           
 IPatternModificationListener[] getModificationListeners()
          Get modification listeners.
protected  AbstractPatternPage[] getPages()
          Get declared pages.
 PatternHandler.PatternData getPatternData(IEditorInput editorInput_p)
          Get pattern data.
protected  String getPatternDisplayableName(PatternHandler.PatternData patternData_p)
          Get pattern displayable name.
 PatternHandler getPatternHandler()
          Get pattern handler.
protected  boolean handlePatternValidation(AbstractPatternPage[] patternPages_p)
          Handle pattern validation.
 void init(IEditorSite site_p, IEditorInput input_p)
           
 boolean isSaveAsAllowed()
           
 void removePatternModificationListener(IPatternModificationListener listener_p)
          Remove a modification listener.
 void selectionChanged(IWorkbenchPart part_p, ISelection selection_p)
           
 void sendNotification(IPatternModificationNotification notification_p)
          Send given notification to all registered listeners.
protected  ScrolledForm updateHeaderContents()
          Update header contents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
Editor id.

Constructor Detail

PatternEditor

public PatternEditor()
Method Detail

dispose

public void dispose()
See Also:
org.eclipse.ui.forms.editor.SharedHeaderFormEditor#dispose()

addPatternModificationListener

public void addPatternModificationListener(IPatternModificationListener listener_p)
Add a modification listener to this editor.

Parameters:
listener_p -

removePatternModificationListener

public void removePatternModificationListener(IPatternModificationListener listener_p)
Remove a modification listener.

Parameters:
listener_p -

getModificationListeners

public IPatternModificationListener[] getModificationListeners()
Get modification listeners.

Returns:

sendNotification

public void sendNotification(IPatternModificationNotification notification_p)
Send given notification to all registered listeners.

Parameters:
notification_p -

getPatternData

public PatternHandler.PatternData getPatternData(IEditorInput editorInput_p)
Get pattern data.

Parameters:
editorInput_p - If null, try and resolve it locally.
Returns:

getPatternHandler

public PatternHandler getPatternHandler()
Get pattern handler.

Returns:

getPatternDisplayableName

protected String getPatternDisplayableName(PatternHandler.PatternData patternData_p)
Get pattern displayable name.

Parameters:
patternData_p -
Returns:

init

public void init(IEditorSite site_p,
                 IEditorInput input_p)
          throws PartInitException
Throws:
PartInitException
See Also:
org.eclipse.ui.forms.editor.FormEditor#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)

addPage

public int addPage(IFormPage page_p)
            throws PartInitException
Throws:
PartInitException
See Also:
org.eclipse.ui.forms.editor.FormEditor#addPage(org.eclipse.ui.forms.editor.IFormPage)

addPages

protected void addPages()
See Also:
org.eclipse.ui.forms.editor.FormEditor#addPages()

getPages

protected AbstractPatternPage[] getPages()
Get declared pages.
The order of returned pages has nothing to do with the order of the pages in the editor.

Returns:
A not null, but possibly empty, array of AbstractPatternPage.

doSave

public void doSave(IProgressMonitor monitor_p)
See Also:
org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)

handlePatternValidation

protected boolean handlePatternValidation(AbstractPatternPage[] patternPages_p)
Handle pattern validation.
That includes looking for syntax errors on pages fields.

Parameters:
patternPages_p -
Returns:
true if validation was successful, false otherwise.

doSaveAs

public void doSaveAs()
See Also:
org.eclipse.ui.part.EditorPart#doSaveAs()

isSaveAsAllowed

public boolean isSaveAsAllowed()
See Also:
org.eclipse.ui.part.EditorPart#isSaveAsAllowed()

updateHeaderContents

protected ScrolledForm updateHeaderContents()
Update header contents.

Returns:
the containing scrolled form.

createHeaderContents

protected void createHeaderContents(IManagedForm headerForm_p)
See Also:
org.eclipse.ui.forms.editor.SharedHeaderFormEditor#createHeaderContents(org.eclipse.ui.forms.IManagedForm)

getAdapter

public Object getAdapter(Class adapter_p)
See Also:
org.eclipse.ui.part.MultiPageEditorPart#getAdapter(java.lang.Class)

selectionChanged

public void selectionChanged(IWorkbenchPart part_p,
                             ISelection selection_p)
See Also:
org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)

EGF Engine
Release 0.1.0

Copyright (c) Thales Corporate Services S.A.S, 2009.

This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.