org.eclipse.xtext.common.types.ui.query
Class UIParticipant

java.lang.Object
  extended by org.eclipse.xtext.common.types.ui.query.UIParticipant
All Implemented Interfaces:
org.eclipse.jdt.ui.search.IMatchPresentation

public class UIParticipant
extends java.lang.Object
implements org.eclipse.jdt.ui.search.IMatchPresentation

Author:
Sebastian Zarnekow - Initial contribution and API

Constructor Summary
UIParticipant()
           
 
Method Summary
 org.eclipse.jface.viewers.ILabelProvider createLabelProvider()
          Creates a new instance of a label provider for elements that have been contributed to a search result by the corresponding query participant.
 void showMatch(org.eclipse.search.ui.text.Match match, int currentOffset, int currentLength, boolean activate)
          Opens an editor on the given element and selects the given range of text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UIParticipant

public UIParticipant()
Method Detail

createLabelProvider

public org.eclipse.jface.viewers.ILabelProvider createLabelProvider()
Description copied from interface: org.eclipse.jdt.ui.search.IMatchPresentation
Creates a new instance of a label provider for elements that have been contributed to a search result by the corresponding query participant. The search view will call this method when it needs to render elements and will dispose the label providers when it is done with them. This method may therefore be called multiple times.

Specified by:
createLabelProvider in interface org.eclipse.jdt.ui.search.IMatchPresentation
Returns:
A label provider for elements found by the corresponding query participant.

showMatch

public void showMatch(org.eclipse.search.ui.text.Match match,
                      int currentOffset,
                      int currentLength,
                      boolean activate)
Description copied from interface: org.eclipse.jdt.ui.search.IMatchPresentation
Opens an editor on the given element and selects the given range of text. The location of matches are automatically updated when a file is edited through the file buffer infrastructure (see ITextFileBufferManager). When a file buffer is saved, the current positions are written back to the match. If the activate parameter is true the opened editor should have be activated. Otherwise the focus should not be changed.

Specified by:
showMatch in interface org.eclipse.jdt.ui.search.IMatchPresentation
Parameters:
match - The match to show.
currentOffset - The current start offset of the match.
currentLength - The current length of the selection.
activate - Whether to activate the editor the match is shown in.