1 20 21 package org.apache.directory.ldapstudio.schemas.view.editors.schema; 22 23 24 import org.apache.directory.ldapstudio.schemas.Activator; 25 import org.apache.directory.ldapstudio.schemas.model.Schema; 26 import org.apache.log4j.Logger; 27 import org.eclipse.core.runtime.IProgressMonitor; 28 import org.eclipse.ui.IEditorInput; 29 import org.eclipse.ui.IEditorSite; 30 import org.eclipse.ui.PartInitException; 31 import org.eclipse.ui.forms.editor.FormEditor; 32 33 34 40 public class SchemaEditor extends FormEditor 41 { 42 43 private static Logger logger = Logger.getLogger( SchemaEditor.class ); 44 45 46 public static final String ID = Activator.PLUGIN_ID + ".view.schemaformeditor"; 48 49 private SchemaEditorOverviewPage overview; 50 51 52 private SchemaEditorSourceCodePage sourceCode; 53 54 55 private Schema schema; 56 57 58 61 public void init( IEditorSite site, IEditorInput input ) throws PartInitException 62 { 63 setSite( site ); 64 setInput( input ); 65 setPartName( input.getName() ); 66 67 schema = ( ( SchemaEditorInput ) getEditorInput() ).getSchema(); 68 } 69 70 71 74 protected void addPages() 75 { 76 try 77 { 78 overview = new SchemaEditorOverviewPage( this ); 79 addPage( overview ); 80 sourceCode = new SchemaEditorSourceCodePage( this ); 81 addPage( sourceCode ); 82 } 83 catch ( PartInitException e ) 84 { 85 logger.debug( "error when adding pages" ); } 87 } 88 89 90 93 public void doSave( IProgressMonitor monitor ) 94 { 95 } 97 98 99 102 public void doSaveAs() 103 { 104 } 105 106 107 110 public boolean isSaveAsAllowed() 111 { 112 return false; 113 } 114 115 116 122 public Schema getSchema() 123 { 124 return schema; 125 } 126 } 127 | Popular Tags |