[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: What is the "F2 Widget", and can it be reused?

I think it's a Shell, but with SWT.NO_TRIM or SWT.TOOL set. Have a play around with what's there ...

The other alternative is to dig into the code that generates the window and see what it does.

Looking in plugin.xml of org.eclipse.jdt.ui, there's:

[xml]
      <key
            sequence="F2"
            contextId="org.eclipse.jdt.ui.javaEditorScope"
            commandId="org.eclipse.jdt.ui.edit.text.java.show.javadoc"
            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
[/xml]

Search for the commandId, and you find SHOW_JAVADOC in IJavaEditorActionDefinitionIds, and references to this field in BasicJavaEditorActionContributor and JavaEditor. Drill down, and you end up in DefaultInformationControl.

It looks like it's indeed using these fields in the constructor:

[code]this(parent, SWT.TOOL | SWT.NO_TRIM, style, presenter, statusFieldText);[/code]

You can do this searching yourself if you've got the source as well, by opening the Plugin Development Perspective, navigating down the plugins list until you get to org.eclipse.jdt.ui, and then doing Import as Source. You can then use all the searching goodness that Eclispe gives you -- if you know where to look ;-)

Alex.