Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dtp-dev] Overriding icons using labelService extension point

Hi Larry

Now I have the following entry in plugin.xml, as you suggested
               <contributor
                       type = "oracle.dbtools.modelbase.db.DatabaseLink"
iconLocation = "platform:/plugin/oracle.dbtools.connectivity/icons/dbconn.png"
                       displayType = "DatabaseLink"
selector = "oracle.dbtools.connectivity.ui.explorer.providers.label.ServerExplorerLabelSelector">
               </contributor>

And I get following exception when run as standalone

Regards
Anthos

!ENTRY org.eclipse.jface 4 2 2006-07-06 12:54:06.374
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
org.eclipse.swt.SWTException: i/o error (java.io.FileNotFoundException: file:/home/anthos/projects/opensource/eclipse-platform/plugins/oracle.dbtools.connectivity_1.0.0.jar!/platform:/plugin/oracle.dbtools.connectivity/icons/dbconn.png (No such file or directory))
	at org.eclipse.swt.SWT.error(SWT.java:3374)
	at org.eclipse.swt.SWT.error(SWT.java:3297)
	at org.eclipse.swt.graphics.ImageLoader.load(ImageLoader.java:156)
	at org.eclipse.swt.graphics.ImageDataLoader.load(ImageDataLoader.java:26)
	at org.eclipse.swt.graphics.ImageData.<init>(ImageData.java:374)
	at org.eclipse.swt.graphics.Image.<init>(Image.java:593)
	at org.eclipse.datatools.connectivity.sqm.core.internal.ui.util.resources.ResourceLoader.queryImage(ResourceLoader.java:71)
	at org.eclipse.datatools.connectivity.sqm.core.internal.ui.util.resources.ResourceLoader.queryAbsolutePathImageFromRegistry(ResourceLoader.java:94)
	at org.eclipse.datatools.connectivity.sqm.core.internal.ui.services.LabelService$LabelInfo.getIcon(LabelService.java:445)
	at org.eclipse.datatools.connectivity.sqm.core.internal.ui.services.LabelService.getIcon(LabelService.java:259)
	at oracle.dbtools.connectivity.ui.explorer.providers.label.ServerExplorerlabelProvider.getImage(ServerExplorerlabelProvider.java:20)
	at org.eclipse.ui.internal.navigator.extensions.SafeDelegateCommonLabelProvider.getImage(SafeDelegateCommonLabelProvider.java:91)
	at org.eclipse.ui.internal.navigator.extensions.SafeDelegateCommonLabelProvider.updateLabel(SafeDelegateCommonLabelProvider.java:149)
	at org.eclipse.ui.internal.navigator.NavigatorContentServiceLabelProvider.findUpdateLabel(NavigatorContentServiceLabelProvider.java:323)
	at org.eclipse.ui.internal.navigator.NavigatorContentServiceLabelProvider.updateLabel(NavigatorContentServiceLabelProvider.java:307)
	at org.eclipse.jface.viewers.DecoratingLabelProvider.updateLabel(DecoratingLabelProvider.java:345)
	at org.eclipse.jface.viewers.StructuredViewer.buildLabel(StructuredViewer.java:2077)
	at org.eclipse.jface.viewers.TreeViewer.doUpdateItem(TreeViewer.java:252)
	at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:95)
	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.JFaceUtil$1.run(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
	at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:840)
	at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:465)
	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.JFaceUtil$1.run(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
	at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:1955)
	at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:744)
	at org.eclipse.ui.navigator.CommonViewer.createTreeItem(CommonViewer.java:116)
	at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:722)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:696)
	at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:892)
	at org.eclipse.jface.viewers.AbstractTreeViewer.handleTreeExpand(AbstractTreeViewer.java:1240)
	at org.eclipse.jface.viewers.AbstractTreeViewer$4.treeExpanded(AbstractTreeViewer.java:1252)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:181)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1109)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1094)
	at org.eclipse.swt.widgets.Tree.gtk_test_expand_row(Tree.java:1873)
	at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1462)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:3802)
	at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:5245)
	at org.eclipse.swt.widgets.Display.eventProc(Display.java:1133)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1427)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2838)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.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(EclipseStarter.java:400)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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)
Caused by: java.io.FileNotFoundException: file:/home/anthos/projects/opensource/eclipse-platform/plugins/oracle.dbtools.connectivity_1.0.0.jar!/platform:/plugin/oracle.dbtools.connectivity/icons/dbconn.png (No such file or directory)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:106)
	at java.io.FileInputStream.<init>(FileInputStream.java:66)
	at org.eclipse.swt.internal.Compatibility.newFileInputStream(Compatibility.java:155)
	at org.eclipse.swt.graphics.ImageLoader.load(ImageLoader.java:153)
	... 67 more



Lawrence E Dunnell wrote:

The icon location is specified as "icons/view.png" which doesn't exist when the plug-in is deployed because the deployed plug-in is a single file called oracle.dbtools.connectivity_1.0.0.jar. In order to get Eclipse to look for the icons inside the jar file you must specify the icon location as:

iconLocation = "platform:/plugin/oracle.dbtools.connectivity/icons/dbconn.png"

Larry Dunnell
Internet address: ledunnel@xxxxxxxxxx




*Anil T Samuel <anil.samuel@xxxxxxxxxx>*
Sent by: dtp-dev-bounces@xxxxxxxxxxx

07/03/2006 06:21 PM
Please respond to
DTP development mailing list <dtp-dev@xxxxxxxxxxx>


	
To
	DTP development mailing list <dtp-dev@xxxxxxxxxxx>
cc
	
Subject
	Re: [dtp-dev] Overriding icons using labelService extension point



	





Thanks Larry.

But now I am hit with another hiccup.

I have an icons directory in the plugin jar with PNG images for DSE
icons and I have them spec'd in the plugin.xml. It works fine when I run
test the plugin within the Eclipse IDE; but fails when run standalone
with following exception in the org.eclipse.ui.workbench/log file.

Caused by: java.io.FileNotFoundException: file:/home/anthos/projects/opensource/eclipse-platform/plugins/oracle.dbtools.connectivity_1.0.0.jar!/icons/dbconn.png (No such file or directory)
                at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
                at java.io.FileInputStream.<init>(FileInputStream.java:66)
at org.eclipse.swt.internal.Compatibility.newFileInputStream(Compatibility.java:155) at org.eclipse.swt.graphics.ImageLoader.load(ImageLoader.java:153)
                ... 67 more

The icons in jar file :-
[anthos@bilbo opensource]$ jar -tvf
/home/anthos/projects/opensource/eclipse-platform/plugins/oracle.dbtools.connectivity_1.0.0.jar
| grep icons
    0 Tue Jul 04 10:45:20 EST 2006 icons/
  857 Tue Jul 04 10:45:20 EST 2006 icons/dbconn.png
  779 Tue Jul 04 10:45:20 EST 2006 icons/plsql_package.png
  734 Tue Jul 04 10:45:20 EST 2006 icons/view.png

extension point in plugin.xml:-
  <extension point =
"org.eclipse.datatools.connectivity.sqm.core.ui.labelService">
               <contributor
                       type =
"oracle.dbtools.modelbase.db.MaterializedView"
                       iconLocation = "icons/view.png"
                       displayType = "MaterializedView">
               </contributor>
               <contributor
                       type = "oracle.dbtools.modelbase.db.DatabaseLink"
                       iconLocation = "icons/dbconn.png"
                       displayType = "DatabaseLink">
               </contributor>
                               <contributor
                       type =
"oracle.dbtools.connectivity.catalog.OracleView"
                       iconLocation = "icons/view.png"
                       displayType = "View">
               </contributor>
                               <contributor
                       type = "oracle.dbtools.modelbase.db.OraPackage"
                       iconLocation = "icons/plsql_package.png"
                       displayType = "Package">
               </contributor>
       </extension>

Any clue ?

Regards
Anthos
Lawrence E Dunnell wrote:
>
> Sorry for the late reply.
>
> The key to getting your icon to show is to specify the "selector"
> attribute in the labelService extension point.  The class you specify
> in the "selector" attribute can specify whether of not the object in
> question should use the "overriding" icon.
>
> The selector class implements the
> org.eclipse.datatools.connectivity.sqm.core.internal.ui.LabelSelector
> interface.  If provided, this class will be used in addition to the
> type to determine if the label information should be passed back for
> the given object.
>
> *public* *interface* LabelSelector
> {
>     *public* *boolean* select( Object element );
> }
>
> I will add this information to the defect and resolve it.
>
> Larry Dunnell
> Internet address: ledunnel@xxxxxxxxxx
>
>
>
>
> *Anil T Samuel <anil.samuel@xxxxxxxxxx>*
> Sent by: dtp-dev-bounces@xxxxxxxxxxx
>
> 07/02/2006 05:36 PM
> Please respond to
> DTP development mailing list <dtp-dev@xxxxxxxxxxx>
>
>
> > To
>                  DTP development mailing list <dtp-dev@xxxxxxxxxxx>
> cc
> > Subject > Re: [dtp-dev] Overriding icons using labelService extension point
>
>
>
> >
>
>
>
>
> Bug logged.. _Go To Bug 149420_
> <https://bugs.eclipse.org/bugs/show_bug.cgi?id=149420>
>
> Anthos
> Anil T Samuel wrote:
> Hi
>
> The following xml snippet to over-ride the default icon with vendor
> specific one doesnot seem to work. I am using the same type
> (org.eclipse.datatools.modelbase.sql.tables.ViewTable) as the one used
> for View in org.eclipse.datatools.connectivity.sqm.core.ui package.
>
>   <extension point =
> "org.eclipse.datatools.connectivity.sqm.core.ui.labelService">
>                                  <contributor
>                         type =
> "org.eclipse.datatools.modelbase.sql.tables.ViewTable"
>                         iconLocation = "icons/view.gif"
>                         displayType = "View">
>                </contributor>
>  </extension>
>
> Same was the result when I tried OracleView->ViewTable as the type.
>
> I shall log this as a bug, if it is one.
>
> Anthos
>
> _______________________________________________
> dtp-dev mailing list
> _dtp-dev@eclipse.org_ <mailto:dtp-dev@xxxxxxxxxxx>
> _https://dev.eclipse.org/mailman/listinfo/dtp-dev_
> > _______________________________________________
> dtp-dev mailing list
> dtp-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/dtp-dev
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> dtp-dev mailing list
> dtp-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/dtp-dev
>
_______________________________________________
dtp-dev mailing list
dtp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dtp-dev

------------------------------------------------------------------------

_______________________________________________
dtp-dev mailing list
dtp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dtp-dev



Back to the top