org.talend.designer.core.ui
Class MultiPageTalendEditor

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.ui.part.WorkbenchPart
          extended by org.eclipse.ui.part.EditorPart
              extended by org.eclipse.ui.part.MultiPageEditorPart
                  extended by org.talend.designer.core.ui.MultiPageTalendEditor
All Implemented Interfaces:
java.util.EventListener, org.eclipse.core.resources.IResourceChangeListener, org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IEditorPart, org.eclipse.ui.ISaveablePart, org.eclipse.ui.ISelectionListener, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.part.IWorkbenchPartOrientation

public class MultiPageTalendEditor
extends org.eclipse.ui.part.MultiPageEditorPart
implements org.eclipse.core.resources.IResourceChangeListener, org.eclipse.ui.ISelectionListener

This class is the main editor, the differents pages in it are:
1) TalendEditor
2) Editor on the generated code

This class uses the interface ISelectionListener, it allows to propage the Delete evenement to the designer.
$Id: MultiPageTalendEditor.java 2988 2007-04-09 06:33:34 +0000 (lun., 09 avr. 2007) nrousseau $


Field Summary
static java.lang.String ID
           
 
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
MultiPageTalendEditor()
           
 
Method Summary
 void codeSync()
           
protected  void createPages()
          Creates the pages of the multi-page editor.
 void dispose()
          The MultiPageEditorPart implementation of this IWorkbenchPart method disposes all nested editors.
 void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
          Saves the multi-page editor's document.
 void doSaveAs()
          Saves the multi-page editor's document as another file.
 java.lang.Object getAdapter(java.lang.Class adapter)
           
 TalendJavaEditor getCodeEditor()
          Getter for codeEditor.
 org.eclipse.gef.EditPart getOldSelection()
           
 Node getSelectedGraphicNode()
          DOC amaumont Comment method "getSelectedNode".
 java.lang.String getSelectedNodeName()
          Get the selected Node if any.
 TalendEditor getTalendEditor()
           
 void gotoMarker(org.eclipse.core.resources.IMarker marker)
           
 void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput editorInput)
          The MultiPageEditorExample implementation of this method checks that the input is an instance of IFileEditorInput.
 boolean isDirty()
           
 boolean isSaveAsAllowed()
           
protected  void pageChange(int newPageIndex)
          Calculates the contents of page 2 when the it is activated.
 void resourceChanged(org.eclipse.core.resources.IResourceChangeEvent event)
          Closes all project files on project close.
 void selectionChanged(org.eclipse.ui.IWorkbenchPart part, org.eclipse.jface.viewers.ISelection selection)
          Will allow to propage the Delete evenement in the designer.
 void setName()
          DOC smallet Comment method "setName".
 void setReadOnly(boolean readonly)
           
 void showCodePage()
           
 void showDesignerPage()
           
 
Methods inherited from class org.eclipse.ui.part.MultiPageEditorPart
addPage, addPage, addPage, addPage, createPageContainer, createPartControl, createSite, getActiveEditor, getActivePage, getContainer, getControl, getEditor, getPageCount, getPageImage, getPageText, handlePropertyChange, removePage, setActivePage, setControl, setFocus, setPageImage, setPageText
 
Methods inherited from class org.eclipse.ui.part.EditorPart
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInput, setInputWithNotify, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPropertyListener, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getSite, getTitle, getTitleImage, removePropertyListener, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
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, getSite, getTitle, getTitleImage, removePropertyListener
 

Field Detail

ID

public static final java.lang.String ID
See Also:
Constant Field Values
Constructor Detail

MultiPageTalendEditor

public MultiPageTalendEditor()
Method Detail

setReadOnly

public void setReadOnly(boolean readonly)

getTalendEditor

public TalendEditor getTalendEditor()

createPages

protected void createPages()
Creates the pages of the multi-page editor.

Specified by:
createPages in class org.eclipse.ui.part.MultiPageEditorPart

dispose

public void dispose()
The MultiPageEditorPart implementation of this IWorkbenchPart method disposes all nested editors. Subclasses may extend.

Specified by:
dispose in interface org.eclipse.ui.IWorkbenchPart
Overrides:
dispose in class org.eclipse.ui.part.MultiPageEditorPart

doSave

public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
Saves the multi-page editor's document.

Specified by:
doSave in interface org.eclipse.ui.ISaveablePart
Specified by:
doSave in class org.eclipse.ui.part.EditorPart

codeSync

public void codeSync()

doSaveAs

public void doSaveAs()
Saves the multi-page editor's document as another file. Also updates the text for page 0's tab, and updates this multi-page editor's input to correspond to the nested editor's.

Specified by:
doSaveAs in interface org.eclipse.ui.ISaveablePart
Specified by:
doSaveAs in class org.eclipse.ui.part.EditorPart

gotoMarker

public void gotoMarker(org.eclipse.core.resources.IMarker marker)

init

public void init(org.eclipse.ui.IEditorSite site,
                 org.eclipse.ui.IEditorInput editorInput)
          throws org.eclipse.ui.PartInitException
The MultiPageEditorExample implementation of this method checks that the input is an instance of IFileEditorInput.

Specified by:
init in interface org.eclipse.ui.IEditorPart
Overrides:
init in class org.eclipse.ui.part.MultiPageEditorPart
Throws:
org.eclipse.ui.PartInitException

isDirty

public boolean isDirty()
Specified by:
isDirty in interface org.eclipse.ui.ISaveablePart
Overrides:
isDirty in class org.eclipse.ui.part.MultiPageEditorPart

isSaveAsAllowed

public boolean isSaveAsAllowed()
Specified by:
isSaveAsAllowed in interface org.eclipse.ui.ISaveablePart
Specified by:
isSaveAsAllowed in class org.eclipse.ui.part.EditorPart

pageChange

protected void pageChange(int newPageIndex)
Calculates the contents of page 2 when the it is activated.

Overrides:
pageChange in class org.eclipse.ui.part.MultiPageEditorPart

showDesignerPage

public void showDesignerPage()

showCodePage

public void showCodePage()

setName

public void setName()
DOC smallet Comment method "setName".

Parameters:
label -

getSelectedNodeName

public java.lang.String getSelectedNodeName()
Get the selected Node if any.

Returns:
the component selected name or null if component is not found or is not activated

getSelectedGraphicNode

public Node getSelectedGraphicNode()
DOC amaumont Comment method "getSelectedNode".

Returns:

getOldSelection

public org.eclipse.gef.EditPart getOldSelection()

resourceChanged

public void resourceChanged(org.eclipse.core.resources.IResourceChangeEvent event)
Closes all project files on project close.

Specified by:
resourceChanged in interface org.eclipse.core.resources.IResourceChangeListener

getAdapter

public java.lang.Object getAdapter(java.lang.Class adapter)
Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable
Overrides:
getAdapter in class org.eclipse.ui.part.MultiPageEditorPart

selectionChanged

public void selectionChanged(org.eclipse.ui.IWorkbenchPart part,
                             org.eclipse.jface.viewers.ISelection selection)
Will allow to propage the Delete evenement in the designer.

Specified by:
selectionChanged in interface org.eclipse.ui.ISelectionListener

getCodeEditor

public TalendJavaEditor getCodeEditor()
Getter for codeEditor.

Returns:
the codeEditor