import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.editors.text.TextEditor;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
public class SQLEditor extends TextEditor {
- SQLConfiguration config;
+ private SQLSourceViewerConfiguration config;
private ColorManager colorManager;
+ private SQLContentOutlinePage outlinePage;
/**
* An editor capable of editing SQL scripts
*/
public SQLEditor() {
super();
+//System.out.println("SQL Editor");
colorManager = new ColorManager();
- config = new SQLConfiguration(colorManager);
+ config = new SQLSourceViewerConfiguration(colorManager);
config.loadPrefs();
setPreferenceStore(QuantumPlugin.getDefault().getPreferenceStore());
Color background = colorManager.getColor(SQLColorConstants.BACKGROUND);
widget.setBackground(background);
}
+
+ public Object getAdapter(Class required) {
+ if (IContentOutlinePage.class.equals(required)) {
+ if (this.outlinePage == null) {
+ this.outlinePage= new SQLContentOutlinePage(
+ (SQLDocumentProvider) getDocumentProvider(), this);
+ if (getEditorInput() != null)
+ this.outlinePage.setInput(getEditorInput());
+ }
+ return this.outlinePage;
+ }
+ return super.getAdapter(required);
+ }
+
}