Tooltip for ITableLabelProvider - swt

I have a problem regarding the tooltips in my Table.
It seems the only way to get tooltips is to use a ColumnLabelProvider.
But all my tables work with the ITableLabelProvider and would need a lot of refactoring and work.
Is there any workaround to provide my tables with tooltips?

I don't see anything, ITableLabelProvider is an older interface that was added before the tool tip support.
When you use ITableLabelProvider JFace is actually using an internal ColumnLabelProvider (called TableColumnViewerLabelProvider) but there is no way to get that to do tool tips.
I don't think you can adapt ColumnViewerToolTipSupport since it relies on a number of package private methods in the viewer.

Related

Missing captioned images feature in TinyMCE and Plone5

I'm missing the function to enable captioned images in TinyMCE/Plone5. It was possible to enable that in the control panel with Plone4 (https://plone.org/documentation/manual/plone-4-user-manual/using-tinymce-as-visual-editor/images).
Now I'm using the new Plone5rc3 with TinyMCE 1.4.3, but the properties of TinyMCE in the control panel don't have the needed checkbox.
Does anybody know how to get that?
Thanks a lot!
So here's an answer in parts: you need several things for the captions to work:
Your <img> tags need to have the class captioned. I still need to find a good way to do that. The image picker will remove all other classes everytime you open it, so I guess a good way would be to change the classes that are added by the inline/left/right selection, but I've not easily found where those are defined.
You need the output filter, but fortunately, that is still there. However, the filter wants to see an IImageCaptioningEnabler, which is essentially a flag to turn the captioning mechanism on, and the old editors used to have that and currently, nothing in standard Plone does provide such a beast. If you're comfortable with add-on development, the class you want is
from plone.outputfilters.filters.resolveuid_and_caption import IImageCaptioningEnabler
from zope.interface import implements
class CaptioningAlwaysEnabled(object):
implements(IImageCaptioningEnabler)
available = True
with corresponding configure.zcml stanza
<utility factory=".resolveuid_and_caption.CaptioningAlwaysEnabled"
name="plone5-captions-always-enabled"
zcml:condition="have plone-5" />
(you can tell I patched buildout-cache/plone.outputfilters-2.1-py2.7.egg/plone/outputfilters/filters/configure.zcml and resolveuid_and_caption.py to include that, but of course, you shouldn't do that.)
If you're not comfortable with add-on development, you could, bizarrely enough, see if another editor provides that global switch, you don't need to have it set as your editor or the default editor. (Products.kupu would, but it doesn't install in 5.0. collective.ckeditor might, I can't try that right now due to missing dependencies.)
So, summary: no, you can't easily turn it on; you can turn it on with a bit of hacking; and if you file it as a feature request, it's the kind of thing that takes about fifteen minutes to fix for somebody who knows their way around the code.

Which eclipse listener should I use to add annotations to a text editor

I am an eclipse newbie. I have a long term goal which is to add my own annotations to the java editor: a bit like FindBugs. I want my own static code analysers, and to be able to add markers/annotations to resources.
So I have read a lot of excellent documentation, and undertaken a load of tutorials. The most helpful was probably http://www.ibm.com/developerworks/opensource/tutorials/os-ecl-commplgin2/section9.html. A lot of the Lars Vogel documents have been useful too. I can now make TextEditors with syntax highlighters. I am however struggling with the best approach for adding annotations.
I understand roughly how to do this: the text editor has a DocumentProvider. The DocumentProvider has an AnnotationModel. It is possible to add annotations to the annotation model.
My question is "where do I put this code" specifically the code that scans the text in the editor and updates the annotation model. It seems clear that this should be in response to a listener...but which one?
I have tried a ResourceChangeListener. This seems to only fire on a save option, rather than when text is typed. In addition I don't know how to get the editor from the resource. ("The" editor is probably a misnomer as presumably the resource can be open in multiple editors). I can find the current editor via IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor(), but this seems the wrong approach, as I want to update all relevant annotation models.
I have tried adding an ElementStateListener to the text editor. None of the events seem to be the one I want.
I've looked at DamageRepairers...these seem to nearly be what I want, except that long term I want to tie into the JavaEditor, so I don't want to change the default DamageRepair.
Thanks for all the help
I found that this question can be answered, by mentioning the following resource: www.ibm.com/developerworks/opensource/tutorials/os-eclipse-plugin-guide/index.html
The question author also mentions here:
I add the annotations to the resource, and the annotations are
auto-magically added to the editor.
So when my plugin starts I run through the active resources, add
annotations to them if needed, then add a resource changed listener
which adds them as the resource is opened.

Using overlayButtons on FusionCharts with javascript links

I would like to use a javascript function link such as 'link:j-myJS-data' for drill down type charts. I have everything working great to drill down but cannot figure out how to incorporate the overlayButton through the configureLink when drilling down. At present, I can drill down but cannot go back. Can anyone provide a basic example of how I may go about this? Is it even possible?
I thought I could add my own "Back" button to hande this as one option. I do not want to use a jsonURL as there is a lot of data and many paramertes need to be passed resutling in a long links and a lot of extra data in the JSON.
Thanks in advance.
There are multiple options available to create a drill-down chart with FusionCharts XT. Here is a table which explains all of them, with each one's syntax.
The method that you've used is the JavaScript function link. Using this one, you won't get an overlay button to go back to the parent chart.
The overlay button is available only when a LinkedChart is created.
So there are 2 ways that you could go about:
You could change all your charts to use the LinkedCharts technique. Here is a blog post detailing how LinkedCharts can be created using PHP + MySQL. If you aren't using PHP, the general idea shown still applies to any server-side environment.
You could create a separate button sitting near the chart, and this button would re-create the parent chart for you.
The button (which we call "overlay-button") can be made automatically visible using LinkedCharts alone.
However the overlay-button can be internally invoked using the charts' private API. Since these APIs are private, it may change between implementations and may not work as desired under certain circumstances. I would not recommend you to use this. If you are still interested in knowing more on this API, put in a comment and I will update this post.

Customizing IMarker behavior

I'm trying to make an Eclipse plugin that will highlight certain lines certain colors based on outside input. Is there any way to specify the behavior of a new IMarker rather than rely on basic implementation of bookmarks, problems, etc?
Thanks
I don't have the complete solution, but I think, I can give you some starting points.
The basic idea is to create custom annotations for your custom markers. You can define your own marker types, and register constant formatting rules for it (the latter one is a shameless link to one of my own blog posts). In this case, if your code creates the correct marker types, you can add the different formatting regarding the output.
On the other hand, if you have only a single problem type, I don't know the correct answer, but the Annotation Model Creation extension seems to be the answer. For details look at the Eclipse help.

Xcode/iPhone Code templates

Is there some tool in Xcode that allows me to store snippets of code I often reuse in various applications so I do not have to retype it each time? I am talking about things like all the code that goes into defining Table Delegate Methods and Table Source Methods, UIAlertViews code and such. I just would like to have my own private repository where I can put snippets of code I think I may need in the future in other apps. Is there anything like that? Thanks for any help.
I guess the answer to your need is discussed in this page http://www.turkeysheartrhinos.com/?p=8. Look at the "Custom TextMate – Like Macros" section.
In Interface Builder you can drag and drop components you've built into the library under the Custom Objects list. These can be reused in other XIBs you build later.
I'm not sure about code snippets in Xcode itself, I would find that useful too. If you are talking reuse though, can you put alot of your generic stuff in superclasses that you can inherit from when appropriate?
Try "Edit User Scripts..." under the script menu in Xcode. Look at the scripts under the "HeaderDoc" header to see some examples of inserting templates into code. You'll have to reformat your snippets into blocks of Perl like these, but this approach also gives you those neat tab-through-able input areas like you see when you autocomplete method calls.
How about using the tool "sinppets" ?