当前位置: 首页>>代码示例>>Java>>正文


Java IHyperlinkDetector类代码示例

本文整理汇总了Java中org.eclipse.jface.text.hyperlink.IHyperlinkDetector的典型用法代码示例。如果您正苦于以下问题:Java IHyperlinkDetector类的具体用法?Java IHyperlinkDetector怎么用?Java IHyperlinkDetector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IHyperlinkDetector类属于org.eclipse.jface.text.hyperlink包,在下文中一共展示了IHyperlinkDetector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getHyperlinkDetectors

import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; //导入依赖的package包/类
private IHyperlinkDetector[] getHyperlinkDetectors() {
	IHyperlinkDetector[] allDetectors;
	IHyperlinkDetector[] configuredDetectors = configuration
			.getHyperlinkDetectors(viewer);
	if (configuredDetectors == null || configuredDetectors.length == 0) {
		allDetectors = new IHyperlinkDetector[0];
	} else if (preferenceStore.getBoolean(URL_HYPERLINK_DETECTOR_KEY)
			|| !preferenceStore.getBoolean(
					AbstractTextEditor.PREFERENCE_HYPERLINKS_ENABLED)) {
		allDetectors = configuredDetectors;
	} else {
		allDetectors = new IHyperlinkDetector[configuredDetectors.length
				+ 1];
		System.arraycopy(configuredDetectors, 0, allDetectors, 0,
				configuredDetectors.length);
		// URLHyperlinkDetector can only detect hyperlinks at the start of
		// the range. We need one that can detect all hyperlinks in a given
		// region.
		allDetectors[configuredDetectors.length] = new MultiURLHyperlinkDetector();
	}
	return allDetectors;
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:23,代码来源:HyperlinkTokenScanner.java

示例2: getHyperlinkDetectors

import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; //导入依赖的package包/类
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
	List<IHyperlinkDetector> detectors = new LinkedList<IHyperlinkDetector>();
	IHyperlinkDetector[] inheritedDetectors = super.getHyperlinkDetectors(sourceViewer);
	if (inheritedDetectors != null) {
		for (final IHyperlinkDetector detector : inheritedDetectors) {
			detectors.add(new IHyperlinkDetector() {
				public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region,
						boolean canShowMultipleHyperlinks) {
					try {
						return detector.detectHyperlinks(textViewer, region, canShowMultipleHyperlinks);
					}
					catch (Throwable e) {
						// fail safe hyperlink detector - prevent others
						// from failing
					}
					return null;
				}

			});
		}
	}
	detectors.add(detector);
	return detectors.toArray(new IHyperlinkDetector[detectors.size()]);
}
 
开发者ID:cplutte,项目名称:bts,代码行数:26,代码来源:XtextSourceViewerConfiguration.java

示例3: getHyperlinkDetectors

import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; //导入依赖的package包/类
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
	if (sourceViewer == null){
		return null;
	}

	return new IHyperlinkDetector[] { new URLHyperlinkDetector() };
}
 
开发者ID:de-jcup,项目名称:eclipse-jenkins-editor,代码行数:9,代码来源:JenkinsSourceViewerConfiguration.java

示例4: getHyperlinkDetectors

import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; //导入依赖的package包/类
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
	if (sourceViewer == null)
		return null;

	return new IHyperlinkDetector[] { new URLHyperlinkDetector(), new BatchHyperlinkDetector(adaptable) };
}
 
开发者ID:de-jcup,项目名称:eclipse-batch-editor,代码行数:8,代码来源:BatchSourceViewerConfiguration.java

示例5: getHyperlinkDetectors

import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; //导入依赖的package包/类
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
	if (sourceViewer == null)
		return null;

	return new IHyperlinkDetector[] { new URLHyperlinkDetector(), new BashHyperlinkDetector(adaptable) };
}
 
开发者ID:de-jcup,项目名称:eclipse-bash-editor,代码行数:8,代码来源:BashSourceViewerConfiguration.java

示例6: getHyperlinkDetectors

import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; //导入依赖的package包/类
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
	IHyperlinkDetector[] hyperlinkDetectors = super.getHyperlinkDetectors(sourceViewer);
	List<IHyperlinkDetector> list = new ArrayList<>(Arrays.asList(hyperlinkDetectors));
	list.add(new KspNameHyperLinkDetector());
	list.add(new SqlTableHyperLinkDetector());
	list.add(new CanonicalJavaNameHyperLinkDetector());
	list.add(new DtoDefinitionPathHyperLinkDetector());
	return list.toArray(new IHyperlinkDetector[] {});
}
 
开发者ID:sebez,项目名称:vertigo-chroma-kspplugin,代码行数:11,代码来源:KspSourceViewerConfiguration.java

示例7: getHyperlinkDetectors

import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; //导入依赖的package包/类
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
	IHyperlinkDetector[] hyperlinkDetectors = super.getHyperlinkDetectors(sourceViewer);
	List<IHyperlinkDetector> list = new ArrayList<>(Arrays.asList(hyperlinkDetectors));
	list.add(new FilePathHyperLinkDetector());
	return list.toArray(new IHyperlinkDetector[] {});
}
 
开发者ID:sebez,项目名称:vertigo-chroma-kspplugin,代码行数:8,代码来源:KprSourceViewerConfiguration.java

示例8: getHyperlinkDetectors

import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; //导入依赖的package包/类
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
	if (sourceViewer == null){
		return null;
	}
	return new IHyperlinkDetector[] { new URLHyperlinkDetector(), new GradleHyperlinkDetector(adaptable) };
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:8,代码来源:GradleSourceViewerConfiguration.java

示例9: execute

import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; //导入依赖的package包/类
public Object execute(ExecutionEvent event) throws ExecutionException
{

    TLAEditorAndPDFViewer editor = (TLAEditorAndPDFViewer) HandlerUtil.getActiveEditor(event);
    ISourceViewer internalSourceViewer = editor.getTLAEditor().getSourceViewer();

    ITextSelection selection = (ITextSelection) editor.getTLAEditor().getSelectionProvider().getSelection();
    IRegion region = new Region(selection.getOffset(), selection.getLength());

    // get the detectors
    IHyperlinkDetector[] hyperlinkDetectors = editor.getTLAEditor().getSourceViewerConfiguration()
            .getHyperlinkDetectors(internalSourceViewer);
    if (hyperlinkDetectors != null)
    {
        for (int i = 0; i < hyperlinkDetectors.length; i++)
        {
            // detect
            IHyperlink[] hyperlinks = hyperlinkDetectors[i].detectHyperlinks(internalSourceViewer, region,
                    false);
            if (hyperlinks != null && hyperlinks.length > 0)
            {
                // open
                IHyperlink hyperlink = hyperlinks[0];
                hyperlink.open();
                break;
            }
        }
    }
    return null;
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:31,代码来源:TLAEditor.java

示例10: getHyperlinkDetectors

import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; //导入依赖的package包/类
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
       return new IHyperlinkDetector[] { new URLHyperlinkDetector(), //
               new SwaggerReferenceHyperlinkDetector(), //
               new PathParamHyperlinkDetector(), //
               new DefinitionHyperlinkDetector() };
}
 
开发者ID:RepreZen,项目名称:KaiZen-OpenAPI-Editor,代码行数:8,代码来源:SwaggerSourceViewerConfiguration.java

示例11: getHyperlinkDetectors

import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; //导入依赖的package包/类
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    return new IHyperlinkDetector[] { new URLHyperlinkDetector(), //
            new PathParamHyperlinkDetector(), //
            new DefinitionHyperlinkDetector(), //
            new OpenApi3ReferenceHyperlinkDetector(), //
            new SecuritySchemeHyperlinkDetector(), //
            new LinkOperationHyperlinkDetector(), //
            new LinkOperationRefHyperlinkDetector() };
}
 
开发者ID:RepreZen,项目名称:KaiZen-OpenAPI-Editor,代码行数:11,代码来源:OpenApi3Editor.java

示例12: getHyperlinkDetectors

import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; //导入依赖的package包/类
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
	List<IHyperlinkDetector> detectors = new LinkedList<IHyperlinkDetector>();
	IHyperlinkDetector[] inheritedDetectors = getInheritedDetectors(sourceViewer);

	if (inheritedDetectors != null) {
		for (final IHyperlinkDetector detector : inheritedDetectors) {
			detectors.add(new IHyperlinkDetector() {
				public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region,
						boolean canShowMultipleHyperlinks) {
					try {
						IHyperlink[] hyperlinks = detector.detectHyperlinks(textViewer, region, canShowMultipleHyperlinks);
						hyperlinks = removeURLHyperlinksOfManagedResources(hyperlinks);
						return hyperlinks;
					}
					catch (Throwable e) {
						// fail safe hyperlink detector - prevent others
						// from failing
					}
					return null;
				}

			});
		}
	}
	detectors.add(detector);
	return detectors.toArray(new IHyperlinkDetector[detectors.size()]);
}
 
开发者ID:crapo,项目名称:sadlos2,代码行数:29,代码来源:SadlSourceViewerConfiguration.java

示例13: getInheritedDetectors

import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; //导入依赖的package包/类
private IHyperlinkDetector[] getInheritedDetectors (ISourceViewer sourceViewer) {
	if (sourceViewer == null || fPreferenceStore == null)
		return super.getHyperlinkDetectors(sourceViewer);

	if (!fPreferenceStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED))
		return null;

	return getRegisteredHyperlinkDetectors(sourceViewer);
}
 
开发者ID:crapo,项目名称:sadlos2,代码行数:10,代码来源:SadlSourceViewerConfiguration.java

示例14: bindIHyperlinkDetector

import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; //导入依赖的package包/类
/** Custom IHyperlinkDetector. */
@Override
public Class<? extends IHyperlinkDetector> bindIHyperlinkDetector() {
	return N4JSHyperlinkDetector.class;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:6,代码来源:N4JSUiModule.java

示例15: getHyperlinkDetectors

import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; //导入依赖的package包/类
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
	if (sourceViewer == null) {
		return null;
	}
	return new IHyperlinkDetector[] { new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileHyperlinkDetector(resourceProvider.getResource()) };
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:7,代码来源:DwprofileSourceViewerConfiguration.java


注:本文中的org.eclipse.jface.text.hyperlink.IHyperlinkDetector类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。