// Saving the editor pages
saveEditorPages();
try
{
IEditorInput input = getEditorInput();
String inputClassName = input.getClass().getName();
boolean success = false;
if ( input instanceof FileEditorInput )
// FileEditorInput class is used when the file is opened
// from a project in the workspace.
{
// Saving the ServerConfiguration to disk
saveConfiguration( ( FileEditorInput ) input, monitor );
success = true;
}
else if ( input instanceof IPathEditorInput )
{
// Saving the ServerConfiguration to disk
saveConfiguration( ( ( IPathEditorInput ) input ).getPath().toOSString() );
success = true;
}
else if ( inputClassName.equals( "org.eclipse.ui.internal.editors.text.JavaFileEditorInput" ) //$NON-NLS-1$
|| inputClassName.equals( "org.eclipse.ui.ide.FileStoreEditorInput" ) ) //$NON-NLS-1$
// The class 'org.eclipse.ui.internal.editors.text.JavaFileEditorInput'
// is used when opening a file from the menu File > Open... in Eclipse 3.2.x
// The class 'org.eclipse.ui.ide.FileStoreEditorInput' is used when
// opening a file from the menu File > Open... in Eclipse 3.3.x
{
// Saving the ServerConfiguration to disk
saveConfiguration( input.getToolTipText() );
success = true;
}
else if ( input instanceof NonExistingServerConfigurationInput )
{
// The 'ServerConfigurationEditorInput' class is used when a