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

java.lang.Object
  extended byEditorPart
      extended byorg.eclipse.wst.server.ui.editor.ServerEditorPart

public abstract class ServerEditorPart
extends 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
See Also:
Serialized Form

Field Summary
static int PROP_ERROR
          Property change id for the error message.
 
Constructor Summary
ServerEditorPart()
          Create a new server editor part.
 
Method Summary
 void dispose()
          Dispose of the editor.
 void doSave(IProgressMonitor monitor)
           
 void doSaveAs()
           
 void execute(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.
 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(IEditorSite site, IEditorInput input)
           
 void insertSections(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 java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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(IProgressMonitor monitor)
See Also:
org.eclipse.ui.IEditorPart#doSave(IProgressMonitor)

doSaveAs

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

isDirty

public boolean isDirty()
See Also:
org.eclipse.ui.IEditorPart#isDirty()

isSaveAsAllowed

public boolean isSaveAsAllowed()
See Also:
org.eclipse.ui.IEditorPart#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 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(IEditorSite site,
                 IEditorInput input)
See Also:
org.eclipse.ui.IEditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)

execute

public void execute(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(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.