}
if ( schemaName != null )
{
// Getting the SchemaPool
SchemaPool pool = SchemaPool.getInstance();
// Getting the right schema
Schema schema = pool.getSchema( schemaName );
if ( schema.type == Schema.SchemaType.coreSchema )
{
MessageBox messageBox = new MessageBox(
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.OK | SWT.ICON_ERROR );
messageBox
.setMessage( Messages.getString( "RemoveSchemaAction.The_schema" ) + schemaName + Messages.getString( "RemoveSchemaAction.Is_a_core_schema_It_cant_be_removed_from_the_pool" ) ); //$NON-NLS-1$ //$NON-NLS-2$
messageBox.open();
return;
}
if ( schema.hasBeenModified() || schema.hasPendingModification() )
{
MessageBox messageBox = new MessageBox(
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.OK | SWT.CANCEL
| SWT.ICON_QUESTION );
messageBox.setMessage( Messages
.getString( "RemoveSchemaAction.This_schema_has_been_modified_or_has_pending_modifications" ) ); //$NON-NLS-1$
if ( messageBox.open() == SWT.OK )
{
pool.removeSchema( schema );
}
}
else
pool.removeSchema( schema );
}
}