org.eclipse.wst.server.ui.editor
Class ServerEditorPart

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.wst.server.ui.editor.ServerEditorPart
All Implemented Interfaces:
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

public abstract class ServerEditorPart
extends org.eclipse.ui.part.EditorPart

An abstract server editor which implements the most common methods from IEditorPart. This class also provides each editor page with an error message which will be displayed on the status bar of the editor.

Since:
1.0

Field Summary
static int PROP_ERROR
          Property change id for the error message.
 
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
ServerEditorPart()
          Create a new server editor part.
 
Method Summary
 void dispose()
          Dispose of the editor.
 void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
           
 void doSaveAs()
           
 void execute(org.eclipse.core.commands.operations.IUndoableOperation operation)
          Executes the given operation and adds it to the operation history with the correct context.
 java.lang.String getErrorMessage()
          Return the error message for this page.
 org.eclipse.core.runtime.IStatus[] getSaveStatus()
          Returns error or status messages that will be displayed when the server resource is saved.
 IServerWorkingCopy getServer()
          Return the server that is being editted.
 void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input)
           
 void insertSections(org.eclipse.swt.widgets.Composite parent, java.lang.String id)
          Inserts editor sections into the given composite.
 boolean isDirty()
           
 boolean isSaveAsAllowed()
           
 void setErrorMessage(java.lang.String error)
          Set an error message for this page.
 void updateErrorMessage()
          Updates the error message shown in the editor.
 
Methods inherited from class org.eclipse.ui.part.EditorPart
getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setInitializationData
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, createPartControl, getAdapter, getContentDescription, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setFocus, setPartProperty, showBusy
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, createPartControl, getSite, getTitle, getTitleImage, removePropertyListener, setFocus
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

PROP_ERROR

public static final int PROP_ERROR
Property change id for the error message.

See Also:
Constant Field Values
Constructor Detail

ServerEditorPart

public ServerEditorPart()
Create a new server editor part.

Method Detail

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(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()

isDirty

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

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()

setErrorMessage

public void setErrorMessage(java.lang.String error)
Set an error message for this page.

Parameters:
error - java.lang.String

updateErrorMessage

public void updateErrorMessage()
Updates the error message shown in the editor.


getErrorMessage

public java.lang.String getErrorMessage()
Return the error message for this page.

Returns:
java.lang.String

getSaveStatus

public org.eclipse.core.runtime.IStatus[] getSaveStatus()
Returns error or status messages that will be displayed when the server resource is saved. If there are any error messages, the user will be unable to save the editor.

Returns:
org.eclipse.core.runtime.IStatus

init

public void init(org.eclipse.ui.IEditorSite site,
                 org.eclipse.ui.IEditorInput input)
Specified by:
init in interface org.eclipse.ui.IEditorPart
Specified by:
init in class org.eclipse.ui.part.EditorPart
See Also:
IEditorPart.init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)

execute

public void execute(org.eclipse.core.commands.operations.IUndoableOperation operation)
Executes the given operation and adds it to the operation history with the correct context.

Parameters:
operation - an operation ready to be executed

getServer

public IServerWorkingCopy getServer()
Return the server that is being editted.

Returns:
a server working copy

insertSections

public void insertSections(org.eclipse.swt.widgets.Composite parent,
                           java.lang.String id)
Inserts editor sections into the given composite.

Parameters:
parent - the composite to add the section(s) to
id - the section insertion id

dispose

public void dispose()
Dispose of the editor.

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