com.aptana.ide.editor.css
Class MultiPageCSSEditor

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 com.aptana.ide.editor.css.MultiPageCSSEditor
All Implemented Interfaces:
ISaveEventListener, IUnifiedEditor, org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IEditorPart, org.eclipse.ui.ISaveablePart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.IWorkbenchPart3, org.eclipse.ui.part.IWorkbenchPartOrientation, org.eclipse.ui.texteditor.ITextEditor

public class MultiPageCSSEditor
extends org.eclipse.ui.part.MultiPageEditorPart
implements org.eclipse.ui.texteditor.ITextEditor, IUnifiedEditor

The tabbed style CSS editor.


Field Summary
static java.lang.String DEFAULT_CSS_PREVIEW
          DEFAULT_CSS_PREVIEW
protected  java.io.File prevTempFile
          prevTempFile
 
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
MultiPageCSSEditor()
          Creates a new multi page css editor
 
Method Summary
 void addFileServiceChangeListener(IFileServiceChangeListener listener)
          Adds a file service change listener to this editor
 void addSaveAsListener(ISaveAsEvent listener)
          addSaveAsListener
 void addSaveListener(ISaveEvent listener)
          addSaveListener
 void close(boolean save)
          close
protected  void createPages()
           
protected  org.eclipse.ui.IEditorSite createSite(org.eclipse.ui.IEditorPart editor)
           
 void dispose()
           
 void doRevertToSaved()
           
 void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
           
 void doSaveAs()
           
 org.eclipse.jface.action.IAction getAction(java.lang.String actionId)
           
 java.lang.Object getAdapter(java.lang.Class adapter)
           
 IUnifiedEditorContributor getBaseContributor()
          Gets the contributor for this editor
 org.eclipse.jface.text.source.SourceViewerConfiguration getConfiguration()
          getConfiguration
 IContextAwareness getContextAwareness()
          getContextAwareness
 java.lang.String getDefaultFileExtension()
          Gets the default file extension associated with this editor
 org.eclipse.ui.texteditor.IDocumentProvider getDocumentProvider()
          getDocumentProvider
 org.eclipse.ui.IEditorPart getEditor()
          getEditor
 EditorFileContext getFileContext()
          getFileContext
 org.eclipse.jface.text.IRegion getHighlightRange()
           
 UnifiedOutlinePage getOutlinePage()
          getOutlinePage
 PairMatch getPairMatch(int offset)
          getPairMatch
 java.lang.String getParentDirectoryHint()
          The directory we'd like to save this file into if possible
 org.eclipse.jface.viewers.ISelectionProvider getSelectionProvider()
           
 java.lang.String getURL()
          Gets the url of this editor
 org.eclipse.jface.text.source.ISourceViewer getViewer()
          getViewer
 void gotoMarker(org.eclipse.core.resources.IMarker marker)
          gotoMarker
 void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput editorInput)
           
 boolean isEditable()
           
 boolean isSaveAsAllowed()
           
protected  void pageChange(int newPageIndex)
           
 void removeActionActivationCode(java.lang.String actionId)
           
 void removeFileServiceChangeListener(IFileServiceChangeListener listener)
          Removes a file service change listener from this editor
 void removeSaveAsListener(ISaveAsEvent listener)
          removeSaveAsListener
 void removeSaveListener(ISaveEvent listener)
          removeSaveAsListener
 void resetHighlightRange()
           
 void savePreviewsPages()
          Saves the preview pages
 void selectAndReveal(int offset, int length)
          selectAndReveal
 void setAction(java.lang.String actionID, org.eclipse.jface.action.IAction action)
           
 void setActionActivationCode(java.lang.String actionId, char activationCharacter, int activationKeyCode, int activationStateMask)
           
 void setHighlightRange(int offset, int length, boolean moveCursor)
           
 void setOffset(int offset)
          Change to the source editor, and move caret to the specified offset.
 void setParentDirectoryHint(java.lang.String hint)
          The directory we'd like to save this file into if possible
 void setPreviewPageText(int index, java.lang.String title)
           
 void showHighlightRangeOnly(boolean showHighlightRangeOnly)
           
 boolean showsHighlightRangeOnly()
           
 void showWhitespace(boolean state)
          showWhitespace
 
Methods inherited from class org.eclipse.ui.part.MultiPageEditorPart
addPage, addPage, addPage, addPage, createPageContainer, createPartControl, findEditors, getActiveEditor, getActivePage, getContainer, getControl, getEditor, getPageCount, getPageImage, getPageText, handlePropertyChange, isDirty, removePage, setActiveEditor, 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
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, 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.IEditorPart
getEditorInput, getEditorSite
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, createPartControl, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setFocus
 
Methods inherited from interface org.eclipse.ui.ISaveablePart
isDirty, isSaveOnCloseNeeded
 
Methods inherited from interface com.aptana.ide.editors.unified.IUnifiedEditor
getEditorInput, getSite
 

Field Detail

DEFAULT_CSS_PREVIEW

public static final java.lang.String DEFAULT_CSS_PREVIEW
DEFAULT_CSS_PREVIEW

See Also:
Constant Field Values

prevTempFile

protected java.io.File prevTempFile
prevTempFile

Constructor Detail

MultiPageCSSEditor

public MultiPageCSSEditor()
Creates a new multi page css editor

Method Detail

createSite

protected org.eclipse.ui.IEditorSite createSite(org.eclipse.ui.IEditorPart editor)
Overrides:
createSite in class org.eclipse.ui.part.MultiPageEditorPart
See Also:
MultiPageEditorPart.createSite(org.eclipse.ui.IEditorPart)

createPages

protected void createPages()
Specified by:
createPages in class org.eclipse.ui.part.MultiPageEditorPart
See Also:
MultiPageEditorPart.createPages()

setPreviewPageText

public void setPreviewPageText(int index,
                               java.lang.String title)
Parameters:
index -
title -

dispose

public void dispose()
Specified by:
dispose in interface org.eclipse.ui.IWorkbenchPart
Overrides:
dispose in class org.eclipse.ui.part.MultiPageEditorPart
See Also:
IWorkbenchPart.dispose()

doSave

public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
Specified by:
doSave in interface org.eclipse.ui.ISaveablePart
Specified by:
doSave in class org.eclipse.ui.part.EditorPart
See Also:
ISaveablePart.doSave(org.eclipse.core.runtime.IProgressMonitor)

doSaveAs

public void doSaveAs()
Specified by:
doSaveAs in interface org.eclipse.ui.ISaveablePart
Specified by:
doSaveAs in class org.eclipse.ui.part.EditorPart
See Also:
ISaveablePart.doSaveAs()

gotoMarker

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

Parameters:
marker -

init

public void init(org.eclipse.ui.IEditorSite site,
                 org.eclipse.ui.IEditorInput editorInput)
          throws org.eclipse.ui.PartInitException
Specified by:
init in interface org.eclipse.ui.IEditorPart
Overrides:
init in class org.eclipse.ui.part.MultiPageEditorPart
Throws:
org.eclipse.ui.PartInitException
See Also:
IEditorPart.init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)

isSaveAsAllowed

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

setOffset

public void setOffset(int offset)
Change to the source editor, and move caret to the specified offset.

Parameters:
offset -

pageChange

protected void pageChange(int newPageIndex)
Overrides:
pageChange in class org.eclipse.ui.part.MultiPageEditorPart
See Also:
MultiPageEditorPart.pageChange(int)

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
See Also:
IAdaptable.getAdapter(java.lang.Class)

getURL

public java.lang.String getURL()
Gets the url of this editor

Returns:
- url

savePreviewsPages

public void savePreviewsPages()
Saves the preview pages


addFileServiceChangeListener

public void addFileServiceChangeListener(IFileServiceChangeListener listener)
Description copied from interface: IUnifiedEditor
Adds a file service change listener to this editor

Specified by:
addFileServiceChangeListener in interface IUnifiedEditor
See Also:
IUnifiedEditor.addFileServiceChangeListener(com.aptana.ide.editors.unified.IFileServiceChangeListener)

close

public void close(boolean save)
Description copied from interface: IUnifiedEditor
close

Specified by:
close in interface IUnifiedEditor
Specified by:
close in interface org.eclipse.ui.texteditor.ITextEditor
See Also:
IUnifiedEditor.close(boolean)

getBaseContributor

public IUnifiedEditorContributor getBaseContributor()
Description copied from interface: IUnifiedEditor
Gets the contributor for this editor

Specified by:
getBaseContributor in interface IUnifiedEditor
Returns:
- base contributor
See Also:
IUnifiedEditor.getBaseContributor()

getConfiguration

public org.eclipse.jface.text.source.SourceViewerConfiguration getConfiguration()
Description copied from interface: IUnifiedEditor
getConfiguration

Specified by:
getConfiguration in interface IUnifiedEditor
Returns:
ISourceViewer
See Also:
IUnifiedEditor.getConfiguration()

getContextAwareness

public IContextAwareness getContextAwareness()
Description copied from interface: IUnifiedEditor
getContextAwareness

Specified by:
getContextAwareness in interface IUnifiedEditor
Returns:
IContextAwareness
See Also:
IUnifiedEditor.getContextAwareness()

getDefaultFileExtension

public java.lang.String getDefaultFileExtension()
Description copied from interface: IUnifiedEditor
Gets the default file extension associated with this editor

Specified by:
getDefaultFileExtension in interface IUnifiedEditor
Returns:
- file extension string
See Also:
IUnifiedEditor.getDefaultFileExtension()

getDocumentProvider

public org.eclipse.ui.texteditor.IDocumentProvider getDocumentProvider()
Description copied from interface: IUnifiedEditor
getDocumentProvider

Specified by:
getDocumentProvider in interface IUnifiedEditor
Specified by:
getDocumentProvider in interface org.eclipse.ui.texteditor.ITextEditor
Returns:
IDocumentProvider
See Also:
IUnifiedEditor.getDocumentProvider()

getEditor

public org.eclipse.ui.IEditorPart getEditor()
Description copied from interface: IUnifiedEditor
getEditor

Specified by:
getEditor in interface IUnifiedEditor
Returns:
IEditorPart
See Also:
IUnifiedEditor.getEditor()

getFileContext

public EditorFileContext getFileContext()
Description copied from interface: IUnifiedEditor
getFileContext

Specified by:
getFileContext in interface IUnifiedEditor
Returns:
EditorFileContext
See Also:
IUnifiedEditor.getFileContext()

getOutlinePage

public UnifiedOutlinePage getOutlinePage()
Description copied from interface: IUnifiedEditor
getOutlinePage

Specified by:
getOutlinePage in interface IUnifiedEditor
Returns:
UnifiedOutlinePage
See Also:
IUnifiedEditor.getOutlinePage()

getPairMatch

public PairMatch getPairMatch(int offset)
Description copied from interface: IUnifiedEditor
getPairMatch

Specified by:
getPairMatch in interface IUnifiedEditor
Returns:
PairMatch
See Also:
IUnifiedEditor.getPairMatch(int)

getParentDirectoryHint

public java.lang.String getParentDirectoryHint()
Description copied from interface: IUnifiedEditor
The directory we'd like to save this file into if possible

Specified by:
getParentDirectoryHint in interface IUnifiedEditor
Returns:
String
See Also:
IUnifiedEditor.getParentDirectoryHint()

getViewer

public org.eclipse.jface.text.source.ISourceViewer getViewer()
Description copied from interface: IUnifiedEditor
getViewer

Specified by:
getViewer in interface IUnifiedEditor
Returns:
ISourceViewer
See Also:
IUnifiedEditor.getViewer()

removeFileServiceChangeListener

public void removeFileServiceChangeListener(IFileServiceChangeListener listener)
Description copied from interface: IUnifiedEditor
Removes a file service change listener from this editor

Specified by:
removeFileServiceChangeListener in interface IUnifiedEditor
See Also:
IUnifiedEditor.removeFileServiceChangeListener(com.aptana.ide.editors.unified.IFileServiceChangeListener)

selectAndReveal

public void selectAndReveal(int offset,
                            int length)
Description copied from interface: IUnifiedEditor
selectAndReveal

Specified by:
selectAndReveal in interface IUnifiedEditor
Specified by:
selectAndReveal in interface org.eclipse.ui.texteditor.ITextEditor
See Also:
IUnifiedEditor.selectAndReveal(int, int)

setParentDirectoryHint

public void setParentDirectoryHint(java.lang.String hint)
Description copied from interface: IUnifiedEditor
The directory we'd like to save this file into if possible

Specified by:
setParentDirectoryHint in interface IUnifiedEditor
See Also:
IUnifiedEditor.setParentDirectoryHint(java.lang.String)

showWhitespace

public void showWhitespace(boolean state)
Description copied from interface: IUnifiedEditor
showWhitespace

Specified by:
showWhitespace in interface IUnifiedEditor
See Also:
IUnifiedEditor.showWhitespace(boolean)

addSaveAsListener

public void addSaveAsListener(ISaveAsEvent listener)
Description copied from interface: ISaveEventListener
addSaveAsListener

Specified by:
addSaveAsListener in interface ISaveEventListener
See Also:
ISaveEventListener.addSaveAsListener(com.aptana.ide.core.ui.editors.ISaveAsEvent)

addSaveListener

public void addSaveListener(ISaveEvent listener)
Description copied from interface: ISaveEventListener
addSaveListener

Specified by:
addSaveListener in interface ISaveEventListener
See Also:
ISaveEventListener.addSaveListener(com.aptana.ide.core.ui.editors.ISaveEvent)

removeSaveAsListener

public void removeSaveAsListener(ISaveAsEvent listener)
Description copied from interface: ISaveEventListener
removeSaveAsListener

Specified by:
removeSaveAsListener in interface ISaveEventListener
See Also:
ISaveEventListener.removeSaveAsListener(com.aptana.ide.core.ui.editors.ISaveAsEvent)

removeSaveListener

public void removeSaveListener(ISaveEvent listener)
Description copied from interface: ISaveEventListener
removeSaveAsListener

Specified by:
removeSaveListener in interface ISaveEventListener
See Also:
ISaveEventListener.removeSaveListener(com.aptana.ide.core.ui.editors.ISaveEvent)

doRevertToSaved

public void doRevertToSaved()
Specified by:
doRevertToSaved in interface org.eclipse.ui.texteditor.ITextEditor
See Also:
ITextEditor.doRevertToSaved()

getAction

public org.eclipse.jface.action.IAction getAction(java.lang.String actionId)
Specified by:
getAction in interface org.eclipse.ui.texteditor.ITextEditor
See Also:
ITextEditor.getAction(java.lang.String)

getHighlightRange

public org.eclipse.jface.text.IRegion getHighlightRange()
Specified by:
getHighlightRange in interface org.eclipse.ui.texteditor.ITextEditor
See Also:
ITextEditor.getHighlightRange()

getSelectionProvider

public org.eclipse.jface.viewers.ISelectionProvider getSelectionProvider()
Specified by:
getSelectionProvider in interface org.eclipse.ui.texteditor.ITextEditor
See Also:
ITextEditor.getSelectionProvider()

isEditable

public boolean isEditable()
Specified by:
isEditable in interface org.eclipse.ui.texteditor.ITextEditor
See Also:
ITextEditor.isEditable()

removeActionActivationCode

public void removeActionActivationCode(java.lang.String actionId)
Specified by:
removeActionActivationCode in interface org.eclipse.ui.texteditor.ITextEditor
See Also:
ITextEditor.removeActionActivationCode(java.lang.String)

resetHighlightRange

public void resetHighlightRange()
Specified by:
resetHighlightRange in interface org.eclipse.ui.texteditor.ITextEditor
See Also:
ITextEditor.resetHighlightRange()

setAction

public void setAction(java.lang.String actionID,
                      org.eclipse.jface.action.IAction action)
Specified by:
setAction in interface org.eclipse.ui.texteditor.ITextEditor
See Also:
ITextEditor.setAction(java.lang.String, org.eclipse.jface.action.IAction)

setActionActivationCode

public void setActionActivationCode(java.lang.String actionId,
                                    char activationCharacter,
                                    int activationKeyCode,
                                    int activationStateMask)
Specified by:
setActionActivationCode in interface org.eclipse.ui.texteditor.ITextEditor
See Also:
ITextEditor.setActionActivationCode(java.lang.String, char, int, int)

setHighlightRange

public void setHighlightRange(int offset,
                              int length,
                              boolean moveCursor)
Specified by:
setHighlightRange in interface org.eclipse.ui.texteditor.ITextEditor
See Also:
ITextEditor.setHighlightRange(int, int, boolean)

showHighlightRangeOnly

public void showHighlightRangeOnly(boolean showHighlightRangeOnly)
Specified by:
showHighlightRangeOnly in interface org.eclipse.ui.texteditor.ITextEditor
See Also:
ITextEditor.showHighlightRangeOnly(boolean)

showsHighlightRangeOnly

public boolean showsHighlightRangeOnly()
Specified by:
showsHighlightRangeOnly in interface org.eclipse.ui.texteditor.ITextEditor
See Also:
ITextEditor.showsHighlightRangeOnly()