本文整理汇总了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;
}
示例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()]);
}
示例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() };
}
示例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) };
}
示例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) };
}
示例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[] {});
}
示例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[] {});
}
示例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) };
}
示例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;
}
示例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() };
}
示例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() };
}
示例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()]);
}
示例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);
}
示例14: bindIHyperlinkDetector
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; //导入依赖的package包/类
/** Custom IHyperlinkDetector. */
@Override
public Class<? extends IHyperlinkDetector> bindIHyperlinkDetector() {
return N4JSHyperlinkDetector.class;
}
示例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()) };
}