Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DTP » SQL Editor
SQL Editor [message #19925] Tue, 25 July 2006 17:53 Go to next message
Eclipse UserFriend
Originally posted by: francine.grimmer.ncr.com

I am trying to display DDL in the SQL Editor frame from the DataSource
Explorer. I have written my own SQLEditorStorageEditorInput that generates
the DDL and calls the setStorage with the text and setConnectionInfo with
the connection profile. Then I have my own ObjectActionDelegate that has a
run method that does the page.openEditor and provides the input text. The
DDL is displayed but I am getting the following Null Pointer exception:

Error occurred while trying to install sql updater

java.lang.NullPointerException
at
org.eclipse.datatools.sqltools.sqleditor.internal.editor.SQL Updater.rememberAnnotations(SQLUpdater.java:358)
at
org.eclipse.datatools.sqltools.sqleditor.internal.editor.SQL Updater.removeMarkers(SQLUpdater.java:404)
at
org.eclipse.datatools.sqltools.sqleditor.internal.editor.SQL Updater.update(SQLUpdater.java:188)
at
org.eclipse.datatools.sqltools.sqleditor.internal.editor.SQL Updater.access$000(SQLUpdater.java:62)
at
org.eclipse.datatools.sqltools.sqleditor.internal.editor.SQL Updater$1.run(SQLUpdater.java:132)
at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1737)
at
org.eclipse.datatools.sqltools.sqleditor.internal.editor.SQL Updater.run(SQLUpdater.java:128)
at
org.eclipse.datatools.sqltools.sqleditor.SQLEditor.installSQ LUpdater(SQLEditor.java:795)
at
org.eclipse.datatools.sqltools.sqleditor.SQLEditor.getAdapte r(SQLEditor.java:459)
at
org.eclipse.ui.views.contentoutline.ContentOutline.doCreateP age(ContentOutline.java:128)
at org.eclipse.ui.part.PageBookView.createPage(PageBookView.jav a:399)
at org.eclipse.ui.part.PageBookView.partActivated(PageBookView. java:743)
at
org.eclipse.ui.views.contentoutline.ContentOutline.partBroug htToTop(ContentOutline.java:209)
at
org.eclipse.ui.internal.PartListenerList$2.run(PartListenerL ist.java:87)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:843)
at
org.eclipse.ui.internal.PartListenerList.fireEvent(PartListe nerList.java:57)
at
org.eclipse.ui.internal.PartListenerList.firePartBroughtToTo p(PartListenerList.java:85)
at
org.eclipse.ui.internal.PartService.firePartBroughtToTop(Par tService.java:87)
at
org.eclipse.ui.internal.WorkbenchPagePartList.firePartBrough tToTop(WorkbenchPagePartList.java:75)
at
org.eclipse.ui.internal.WorkbenchPagePartList.fireActiveEdit orChanged(WorkbenchPagePartList.java:51)
at org.eclipse.ui.internal.PartList.setActiveEditor(PartList.ja va:152)
at
org.eclipse.ui.internal.WorkbenchPage.makeActiveEditor(Workb enchPage.java:1181)
at
org.eclipse.ui.internal.WorkbenchPage.updateActivePart(Workb enchPage.java:1126)
at
org.eclipse.ui.internal.WorkbenchPage.partAdded(WorkbenchPag e.java:1524)
at
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:210)
at
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:819)
at
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:718)
at
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:679)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2586)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2521)
at
org.eclipse.ui.internal.WorkbenchPage.access$10(WorkbenchPag e.java:2513)
at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.ja va:2498)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2493)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2470)
at
com.ncr.teradata.datatools.dtp.catalog.popup.actions.Generat eDDLActionDelegate.run(GenerateDDLActionDelegate.java:78)

at
org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:254)
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:539)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:400)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3348)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2968)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:95)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:78)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)

When stepping through the code, it appears that the _annotationModel is
not getting set in SQLUpdater and then dereferenced in
SqlUpdater.rememberAnnotations(). I am not sure what I am missing???

I am calling page.openEditor, passing in the ID for the Eclipse SQLEditor.
I have also tried the SQLScrapebookEditor ID as well. Here is the code
snippet:

IWorkbenchPage page =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage();
try {
page.openEditor(new ShowDDLSQLEditorInput(schema.getName(),
database.getName(), table, connectionProfile),
"org.eclipse.datatools.sqltools.sqleditor.SQLEditor");
} catch (PartInitException e) {
System.out.println("CreateTableActionDelegate.run, PartInitException,
can't open editor - " + e.getMessage());
}


regards,
Francine Grimmer
Re: SQL Editor [message #20107 is a reply to message #19925] Wed, 26 July 2006 05:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hcao.sybase.com

Hi Francine,
I guess there must be a bug here, but it's hard for me to debug your
problem. A hint is to look into SQLUpdater.setInput:
_annotationModel = _editor.getDocumentProvider().getAnnotationModel(input);
This line gets the annotation model from the document provider. Since your
editor input is of type SQLEditorStorageEditorInput, the annotation model
should be created in SQLStorageDocumentProvider.createAnnotationModel().
Hope that helps.
Re: SQL Editor [message #20280 is a reply to message #20107] Thu, 27 July 2006 21:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: francine.grimmer.ncr.com

Thank you for your reply.
I looked at the SQLStorageDocumentProvider but still confused as to how
this is supposed to work or how the AnnotationModel gets set. Since I am
using the existing SQLEditor and not writing my own, do I have to provide
a different annontation model? Is there a bug in the DTP code or am I
missing something in my code. If I create my own AnnotationModel, how do I
set it from within my SQLEditorStorageEditorInput class? Is this
documented somewhere that would explain to users on how to get input text
into the Editor pain for DTP. Or is that not its purpose? Do I have to
write my own Editor?

Also I noticed that SQLStorageDocumentProvider is under the
org/eclipse/datatools/sqltools/routineeditor, which I am not using.
Shouldn't this part of the /sqleditor package so that it is available for
those using the SQLEditor and not forced to bring in another package not
needed.

thank you for your help,
-francine
Re: SQL Editor [message #20288 is a reply to message #20280] Fri, 28 July 2006 08:27 Go to previous message
Eclipse UserFriend
Originally posted by: hcao.sybase.com

Hi Francine,
I've created a bug entry 152104 for the problem you mentioned and have
just committed the code. You can checkout the latest code to try again. The
SQLStorageDocumentProvider is pulled up to sqleditor plugin. An
SQLStorageAnnotationModel is created in SQLStorageDocumentProvider which in
turn is created by SQLEditor so that you don't need to create one for
yourself.

Thanks for spotting this bug and giving suggestions.
Hui Cao
Sybase Inc.

"francine" <francine.grimmer@ncr.com> wrote in message
news:a316e77d01b300a0a4f72c3c164a9062$1@www.eclipse.org...
> Thank you for your reply.
> I looked at the SQLStorageDocumentProvider but still confused as to how
> this is supposed to work or how the AnnotationModel gets set. Since I am
> using the existing SQLEditor and not writing my own, do I have to provide
> a different annontation model? Is there a bug in the DTP code or am I
> missing something in my code. If I create my own AnnotationModel, how do I
> set it from within my SQLEditorStorageEditorInput class? Is this
> documented somewhere that would explain to users on how to get input text
> into the Editor pain for DTP. Or is that not its purpose? Do I have to
> write my own Editor?
> Also I noticed that SQLStorageDocumentProvider is under the
> org/eclipse/datatools/sqltools/routineeditor, which I am not using.
> Shouldn't this part of the /sqleditor package so that it is available for
> those using the SQLEditor and not forced to bring in another package not
> needed.
>
> thank you for your help,
> -francine
>
Re: SQL Editor [message #581335 is a reply to message #19925] Wed, 26 July 2006 05:48 Go to previous message
Hui Cao is currently offline Hui CaoFriend
Messages: 29
Registered: July 2009
Junior Member
Hi Francine,
I guess there must be a bug here, but it's hard for me to debug your
problem. A hint is to look into SQLUpdater.setInput:
_annotationModel = _editor.getDocumentProvider().getAnnotationModel(input);
This line gets the annotation model from the document provider. Since your
editor input is of type SQLEditorStorageEditorInput, the annotation model
should be created in SQLStorageDocumentProvider.createAnnotationModel().
Hope that helps.
Re: SQL Editor [message #581358 is a reply to message #20107] Thu, 27 July 2006 21:42 Go to previous message
Eclipse UserFriend
Originally posted by: francine.grimmer.ncr.com

Thank you for your reply.
I looked at the SQLStorageDocumentProvider but still confused as to how
this is supposed to work or how the AnnotationModel gets set. Since I am
using the existing SQLEditor and not writing my own, do I have to provide
a different annontation model? Is there a bug in the DTP code or am I
missing something in my code. If I create my own AnnotationModel, how do I
set it from within my SQLEditorStorageEditorInput class? Is this
documented somewhere that would explain to users on how to get input text
into the Editor pain for DTP. Or is that not its purpose? Do I have to
write my own Editor?

Also I noticed that SQLStorageDocumentProvider is under the
org/eclipse/datatools/sqltools/routineeditor, which I am not using.
Shouldn't this part of the /sqleditor package so that it is available for
those using the SQLEditor and not forced to bring in another package not
needed.

thank you for your help,
-francine
Re: SQL Editor [message #581382 is a reply to message #20280] Fri, 28 July 2006 08:27 Go to previous message
Hui Cao is currently offline Hui CaoFriend
Messages: 29
Registered: July 2009
Junior Member
Hi Francine,
I've created a bug entry 152104 for the problem you mentioned and have
just committed the code. You can checkout the latest code to try again. The
SQLStorageDocumentProvider is pulled up to sqleditor plugin. An
SQLStorageAnnotationModel is created in SQLStorageDocumentProvider which in
turn is created by SQLEditor so that you don't need to create one for
yourself.

Thanks for spotting this bug and giving suggestions.
Hui Cao
Sybase Inc.

"francine" <francine.grimmer@ncr.com> wrote in message
news:a316e77d01b300a0a4f72c3c164a9062$1@www.eclipse.org...
> Thank you for your reply.
> I looked at the SQLStorageDocumentProvider but still confused as to how
> this is supposed to work or how the AnnotationModel gets set. Since I am
> using the existing SQLEditor and not writing my own, do I have to provide
> a different annontation model? Is there a bug in the DTP code or am I
> missing something in my code. If I create my own AnnotationModel, how do I
> set it from within my SQLEditorStorageEditorInput class? Is this
> documented somewhere that would explain to users on how to get input text
> into the Editor pain for DTP. Or is that not its purpose? Do I have to
> write my own Editor?
> Also I noticed that SQLStorageDocumentProvider is under the
> org/eclipse/datatools/sqltools/routineeditor, which I am not using.
> Shouldn't this part of the /sqleditor package so that it is available for
> those using the SQLEditor and not forced to bring in another package not
> needed.
>
> thank you for your help,
> -francine
>
Previous Topic:DTP Connectivity Features for 0.9.1 and 1.0
Next Topic:Features similar to Sun Studio Creator 2
Goto Forum:
  


Current Time: Thu Apr 25 09:31:13 GMT 2024

Powered by FUDForum. Page generated in 0.03418 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top