org.eclipse.jface.text.ITextDoubleClickStrategy Java Examples

The following examples show how to use org.eclipse.jface.text.ITextDoubleClickStrategy. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JavaSourceViewerConfiguration.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
	if (IJavaPartitions.JAVA_DOC.equals(contentType))
		return new JavadocDoubleClickStrategy(getConfiguredDocumentPartitioning(sourceViewer));
	if (IJavaPartitions.JAVA_SINGLE_LINE_COMMENT.equals(contentType))
		return new PartitionDoubleClickSelector(getConfiguredDocumentPartitioning(sourceViewer), 0, 0);
	if (IJavaPartitions.JAVA_MULTI_LINE_COMMENT.equals(contentType))
		return new PartitionDoubleClickSelector(getConfiguredDocumentPartitioning(sourceViewer), 0, 0);
	else if (IJavaPartitions.JAVA_STRING.equals(contentType) || IJavaPartitions.JAVA_CHARACTER.equals(contentType))
		return new PartitionDoubleClickSelector(getConfiguredDocumentPartitioning(sourceViewer), 1, 1);
	if (fJavaDoubleClickSelector == null) {
		fJavaDoubleClickSelector= new JavaDoubleClickSelector();
		fJavaDoubleClickSelector.setSourceVersion(fPreferenceStore.getString(JavaCore.COMPILER_SOURCE));
	}
	return fJavaDoubleClickSelector;
}
 
Example #2
Source File: DotHtmlLabelDoubleClickStrategy.java    From gef with Eclipse Public License 2.0 5 votes vote down vote up
private IRegion findExtendedSelectionHtml(
		ITextDoubleClickStrategy doubleClickStrategy,
		IDocument htmlDocument, int htmlLabelClickOffset) {
	Method findExtendedSelection = findExtendedDoubleClickSelectionMethod(
			doubleClickStrategy.getClass());
	return invokeMethodOn(findExtendedSelection, doubleClickStrategy,
			htmlDocument, htmlLabelClickOffset);
}
 
Example #3
Source File: XMLConfiguration.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
@Override
public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer,
        String contentType) {
  if (doubleClickStrategy == null)
    doubleClickStrategy = new XMLDoubleClickStrategy();
  return doubleClickStrategy;
}
 
Example #4
Source File: XMLConfiguration.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public ITextDoubleClickStrategy getDoubleClickStrategy(
		ISourceViewer sourceViewer, String contentType )
{
	if ( doubleClickStrategy == null )
		doubleClickStrategy = new XMLDoubleClickStrategy( );
	return doubleClickStrategy;
}
 
Example #5
Source File: XMLConfiguration.java    From codeexamples-eclipse with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public ITextDoubleClickStrategy getDoubleClickStrategy(
	ISourceViewer sourceViewer,
	String contentType) {
	if (doubleClickStrategy == null)
		doubleClickStrategy = new XMLDoubleClickStrategy();
	return doubleClickStrategy;
}
 
Example #6
Source File: PropertiesFileSourceViewerConfiguration.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
	if (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType))
		return new PartitionDoubleClickSelector(getConfiguredDocumentPartitioning(sourceViewer), 0, 0, 0);
	if (IPropertiesFilePartitions.COMMENT.equals(contentType))
		return new PartitionDoubleClickSelector(getConfiguredDocumentPartitioning(sourceViewer), 0, 0);
	if (IPropertiesFilePartitions.PROPERTY_VALUE.equals(contentType))
		return new PartitionDoubleClickSelector(getConfiguredDocumentPartitioning(sourceViewer), 1, -1);

	return super.getDoubleClickStrategy(sourceViewer, contentType);
}
 
Example #7
Source File: CommonSourceViewerConfiguration.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
@Override
public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType)
{
	if (fDoubleClickStrategy == null)
	{
		fDoubleClickStrategy = new CommonDoubleClickStrategy();
	}

	return fDoubleClickStrategy;
}
 
Example #8
Source File: HTMLSourceViewerConfiguration.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
@Override
public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType)
{
	if (fDoubleClickStrategy == null)
	{
		fDoubleClickStrategy = new HTMLDoubleClickStrategy();
	}
	return fDoubleClickStrategy;
}
 
Example #9
Source File: CSSSourceViewerConfiguration.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
@Override
public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType)
{
	if (fDoubleClickStrategy == null)
	{
		fDoubleClickStrategy = new CSSDoubleClickStrategy();
	}
	return fDoubleClickStrategy;
}
 
Example #10
Source File: DotHtmlLabelDoubleClickStrategy.java    From gef with Eclipse Public License 2.0 5 votes vote down vote up
private IRegion findRegionHtml(IDocument htmlDocument,
		int htmlLabelClickOffset,
		ITextDoubleClickStrategy doubleClickStrategy) {
	IRegion htmlRegion = findExtendedSelectionHtml(doubleClickStrategy,
			htmlDocument, htmlLabelClickOffset);

	if (htmlRegion != null)
		return htmlRegion;

	return findWordHtml(doubleClickStrategy, htmlDocument,
			htmlLabelClickOffset);
}
 
Example #11
Source File: DotDoubleClickStrategyProvider.java    From gef with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public ITextDoubleClickStrategy getStrategy(ISourceViewer sourceViewer,
		String contentType, String documentPartitioning) {
	if (DotTerminalsTokenTypeToPartitionMapper.HTML_STRING_PARTITION
			.equals(contentType)) {
		return new DotHtmlLabelDoubleClickStrategy();
	}
	return super.getStrategy(sourceViewer, contentType,
			documentPartitioning);
}
 
Example #12
Source File: DotHtmlLabelDoubleClickStrategyProvider.java    From gef with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public ITextDoubleClickStrategy getStrategy(ISourceViewer sourceViewer,
		String contentType, String documentPartitioning) {
	if (DotHtmlLabelTerminalsTokenTypeToPartitionMapper.TEXT_PARTITION
			.equals(contentType)) {
		return new AbstractWordAwareDoubleClickStrategy();
	}
	return super.getStrategy(sourceViewer, contentType,
			documentPartitioning);
}
 
Example #13
Source File: JimpleConfiguration.java    From JAADAS with GNU General Public License v3.0 5 votes vote down vote up
public ITextDoubleClickStrategy getDoubleClickStrategy(
	ISourceViewer sourceViewer,
	String contentType) {
	if (doubleClickStrategy == null)
		doubleClickStrategy = new JimpleDoubleClickStrategy();
	return doubleClickStrategy;
}
 
Example #14
Source File: DoubleClickStrategyProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
public ITextDoubleClickStrategy getStrategy(ISourceViewer sourceViewer, String contentType, String documentPartitioning) {
	if (TerminalsTokenTypeToPartitionMapper.COMMENT_PARTITION.equals(contentType))
		return new FixedCharCountPartitionDoubleClickSelector(documentPartitioning, 0, 0);
	if (TerminalsTokenTypeToPartitionMapper.SL_COMMENT_PARTITION.equals(contentType))
		return new FixedCharCountPartitionDoubleClickSelector(documentPartitioning, 0, 0);
	if (TerminalsTokenTypeToPartitionMapper.STRING_LITERAL_PARTITION.equals(contentType))
		return new FixedCharCountPartitionDoubleClickSelector(documentPartitioning, 1, 1);
	return defaultDoubleClickStrategy;
}
 
Example #15
Source File: DotHtmlLabelHoverFakeSourceViewer.java    From gef with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void setTextDoubleClickStrategy(ITextDoubleClickStrategy strategy,
		String contentType) {
	throw new UnsupportedOperationException();
}
 
Example #16
Source File: HConfiguration.java    From http4e with Apache License 2.0 4 votes vote down vote up
/**
 * @Override
 */
public ITextDoubleClickStrategy getDoubleClickStrategy( ISourceViewer sourceViewer, String contentType){
   if (doubleClickStrategy == null)
      doubleClickStrategy = new HDoubleClickStrategy();
   return doubleClickStrategy;
}
 
Example #17
Source File: DotHtmlLabelDoubleClickStrategy.java    From gef with Eclipse Public License 2.0 4 votes vote down vote up
private IRegion findWordHtml(ITextDoubleClickStrategy doubleClickStrategy,
		IDocument htmlDocument, int htmlLabelClickOffset) {
	Method findWord = findWordMethod(doubleClickStrategy.getClass());
	return invokeMethodOn(findWord, doubleClickStrategy, htmlDocument,
			htmlLabelClickOffset);
}
 
Example #18
Source File: DelegatingTextViewer.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 4 votes vote down vote up
public void setTextDoubleClickStrategy(ITextDoubleClickStrategy strategy,
    String contentType) {
  originalTextViewer.setTextDoubleClickStrategy(strategy, contentType);
}
 
Example #19
Source File: ModulaSourceViewerConfiguration.java    From xds-ide with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public ITextDoubleClickStrategy getDoubleClickStrategy(
		ISourceViewer sourceViewer, String contentType) {
	return new ModulaDoubleClickStrategy();
}
 
Example #20
Source File: MockableTextViewer.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void setTextDoubleClickStrategy(ITextDoubleClickStrategy strategy, String contentType) {
	throw new UnsupportedOperationException();
}
 
Example #21
Source File: MockableTextViewer.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void setTextDoubleClickStrategy(ITextDoubleClickStrategy strategy, String contentType) {
	throw new UnsupportedOperationException();
}
 
Example #22
Source File: XtextSourceViewerConfiguration.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
	return doubleClickStrategyProvider.getStrategy(sourceViewer, contentType, getConfiguredDocumentPartitioning(sourceViewer));
}
 
Example #23
Source File: DummyTextViewer.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void setTextDoubleClickStrategy(ITextDoubleClickStrategy strategy, String contentType) {
	throw new UnsupportedOperationException();
}
 
Example #24
Source File: ScriptConsoleViewerWrapper.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void setTextDoubleClickStrategy(ITextDoubleClickStrategy strategy, String contentType) {
    viewer.setTextDoubleClickStrategy(strategy, contentType);
}
 
Example #25
Source File: XMLConfiguration.java    From http4e with Apache License 2.0 4 votes vote down vote up
public ITextDoubleClickStrategy getDoubleClickStrategy(
        ISourceViewer sourceViewer, String contentType){
    if( doubleClickStrategy == null)
        doubleClickStrategy = new XMLDoubleClickStrategy();
    return doubleClickStrategy;
}
 
Example #26
Source File: PyEditConfigurationWithoutEditor.java    From Pydev with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Just the default double-click strategy for now. But we should be smarter.
 *
 * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getDoubleClickStrategy(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
 */
@Override
public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
    return new PyDoubleClickStrategy(contentType);
}