Java 类org.eclipse.jface.text.hyperlink.IHyperlinkDetector 实例源码

项目:mesfavoris    文件:HyperlinkTokenScanner.java   
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;
}
项目:bts    文件:XtextSourceViewerConfiguration.java   
@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()]);
}
项目:eclipse-jenkins-editor    文件:JenkinsSourceViewerConfiguration.java   
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    if (sourceViewer == null){
        return null;
    }

    return new IHyperlinkDetector[] { new URLHyperlinkDetector() };
}
项目:eclipse-batch-editor    文件:BatchSourceViewerConfiguration.java   
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    if (sourceViewer == null)
        return null;

    return new IHyperlinkDetector[] { new URLHyperlinkDetector(), new BatchHyperlinkDetector(adaptable) };
}
项目:eclipse-bash-editor    文件:BashSourceViewerConfiguration.java   
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    if (sourceViewer == null)
        return null;

    return new IHyperlinkDetector[] { new URLHyperlinkDetector(), new BashHyperlinkDetector(adaptable) };
}
项目:vertigo-chroma-kspplugin    文件:KspSourceViewerConfiguration.java   
@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[] {});
}
项目:vertigo-chroma-kspplugin    文件:KprSourceViewerConfiguration.java   
@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[] {});
}
项目:egradle    文件:GradleSourceViewerConfiguration.java   
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    if (sourceViewer == null){
        return null;
    }
    return new IHyperlinkDetector[] { new URLHyperlinkDetector(), new GradleHyperlinkDetector(adaptable) };
}
项目:tlaplus    文件:TLAEditor.java   
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;
}
项目:KaiZen-OpenAPI-Editor    文件:SwaggerSourceViewerConfiguration.java   
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
       return new IHyperlinkDetector[] { new URLHyperlinkDetector(), //
               new SwaggerReferenceHyperlinkDetector(), //
               new PathParamHyperlinkDetector(), //
               new DefinitionHyperlinkDetector() };
}
项目:KaiZen-OpenAPI-Editor    文件:OpenApi3Editor.java   
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    return new IHyperlinkDetector[] { new URLHyperlinkDetector(), //
            new PathParamHyperlinkDetector(), //
            new DefinitionHyperlinkDetector(), //
            new OpenApi3ReferenceHyperlinkDetector(), //
            new SecuritySchemeHyperlinkDetector(), //
            new LinkOperationHyperlinkDetector(), //
            new LinkOperationRefHyperlinkDetector() };
}
项目:sadlos2    文件:SadlSourceViewerConfiguration.java   
@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()]);
}
项目:sadlos2    文件:SadlSourceViewerConfiguration.java   
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);
}
项目:n4js    文件:N4JSUiModule.java   
/** Custom IHyperlinkDetector. */
@Override
public Class<? extends IHyperlinkDetector> bindIHyperlinkDetector() {
    return N4JSHyperlinkDetector.class;
}
项目:DarwinSPL    文件:DwprofileSourceViewerConfiguration.java   
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    if (sourceViewer == null) {
        return null;
    }
    return new IHyperlinkDetector[] { new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileHyperlinkDetector(resourceProvider.getResource()) };
}
项目:DarwinSPL    文件:HyexpressionSourceViewerConfiguration.java   
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    if (sourceViewer == null) {
        return null;
    }
    return new IHyperlinkDetector[] { new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionHyperlinkDetector(resourceProvider.getResource()) };
}
项目:DarwinSPL    文件:HyvalidityformulaSourceViewerConfiguration.java   
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    if (sourceViewer == null) {
        return null;
    }
    return new IHyperlinkDetector[] { new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaHyperlinkDetector(resourceProvider.getResource()) };
}
项目:DarwinSPL    文件:HydatavalueSourceViewerConfiguration.java   
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    if (sourceViewer == null) {
        return null;
    }
    return new IHyperlinkDetector[] { new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueHyperlinkDetector(resourceProvider.getResource()) };
}
项目:DarwinSPL    文件:HymappingSourceViewerConfiguration.java   
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    if (sourceViewer == null) {
        return null;
    }
    return new IHyperlinkDetector[] { new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingHyperlinkDetector(resourceProvider.getResource()) };
}
项目:DarwinSPL    文件:HyconstraintsSourceViewerConfiguration.java   
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    if (sourceViewer == null) {
        return null;
    }
    return new IHyperlinkDetector[] { new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsHyperlinkDetector(resourceProvider.getResource()) };
}
项目:DarwinSPL    文件:HymanifestSourceViewerConfiguration.java   
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    if (sourceViewer == null) {
        return null;
    }
    return new IHyperlinkDetector[] { new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestHyperlinkDetector(resourceProvider.getResource()) };
}
项目:hybris-commerce-eclipse-plugin    文件:ImpexSourceViewerConfig.java   
@Override 
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) { 

    return new IHyperlinkDetector[]{new ImpexTypeHyperlinkDetector()}; 
}
项目:mesfavoris    文件:HyperlinkSourceViewer.java   
private void resetHyperlinkDetectors() {
    IHyperlinkDetector[] detectors = configuration
            .getHyperlinkDetectors(this);
    int stateMask = configuration.getHyperlinkStateMask(this);
    setHyperlinkDetectors(detectors, stateMask);
}
项目:mesfavoris    文件:HyperlinkSourceViewer.java   
/**
 * Returns the hyperlink detectors which are to be used to detect
 * hyperlinks in the given source viewer. This implementation uses
 * {@link #internalGetHyperlinkDetectors(ISourceViewer)} to get the
 * hyperlink detectors.
 * <p>
 * Sets up the hyperlink detetctors such that they are active on both
 * {@link SWT#NONE} and on the configured modifier key combination if
 * the viewer is configured to open hyperlinks on direct click, i.e., if
 * {@link TextSourceViewerConfiguration#getHyperlinkStateMask(ISourceViewer)
 * getHyperlinkStateMask(ISourceViewer)} returns {@link SWT#NONE}.
 * </p>
 *
 * @param sourceViewer
 *            the {@link ISourceViewer} to be configured by this
 *            configuration
 * @return an array with {@link IHyperlinkDetector}s or {@code null} if
 *         no hyperlink support should be installed
 */
@Override
public final IHyperlinkDetector[] getHyperlinkDetectors(
        ISourceViewer sourceViewer) {
    IHyperlinkDetector[] detectors = internalGetHyperlinkDetectors(
            sourceViewer);
    if (detectors != null && detectors.length > 0
            && getHyperlinkStateMask(sourceViewer) == SWT.NONE) {
        // Duplicate them all with a detector that is active on SWT.NONE
        int defaultMask = getConfiguredDefaultMask();
        IHyperlinkDetector[] newDetectors = new IHyperlinkDetector[detectors.length
                * 2];
        int j = 0;
        for (IHyperlinkDetector original : detectors) {
            if (original instanceof IHyperlinkDetectorExtension2) {
                int mask = ((IHyperlinkDetectorExtension2) original)
                        .getStateMask();
                if (mask == -1) {
                    newDetectors[j++] = new FixedMaskHyperlinkDetector(
                            original, defaultMask);
                    if (defaultMask != SWT.NONE) {
                        newDetectors[j++] = new NoMaskHyperlinkDetector(
                                original);
                    }
                } else {
                    newDetectors[j++] = original;
                    if (mask != SWT.NONE) {
                        newDetectors[j++] = new NoMaskHyperlinkDetector(
                                original);
                    }
                }
            } else {
                newDetectors[j++] = original;
            }
        }
        IHyperlinkDetector[] result = new IHyperlinkDetector[j];
        System.arraycopy(newDetectors, 0, result, 0, j);
        return result;
    }
    return detectors;
}
项目:mesfavoris    文件:HyperlinkSourceViewer.java   
protected InternalHyperlinkDetector(IHyperlinkDetector delegate) {
    this.delegate = delegate;
}
项目:mesfavoris    文件:HyperlinkSourceViewer.java   
protected FixedMaskHyperlinkDetector(IHyperlinkDetector delegate,
        int mask) {
    super(delegate);
    this.mask = mask;
}
项目:mesfavoris    文件:HyperlinkSourceViewer.java   
private NoMaskHyperlinkDetector(IHyperlinkDetector delegate) {
    // Private to allow instantiation only within this compilation unit
    super(delegate, SWT.NONE);
}
项目:ncl30-eclipse    文件:NCLConfiguration.java   
/**
 * Add NCLEclipse Hyperlink Detector to Source Viewer Configuration
 */
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    return new IHyperlinkDetector[] {
            new NCLEclipseHyperlinkDetector(sourceViewer),
            new URLHyperlinkDetector() };
}
项目:fluentmark    文件:FluentMkSimpleSourceViewerConfiguration.java   
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    return null;
}
项目:bts    文件:ReadOnlySourceViewerConfiguration.java   
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    return null;
}
项目:bts    文件:DefaultUiModule.java   
public Class<? extends IHyperlinkDetector> bindIHyperlinkDetector() {
    return DefaultHyperlinkDetector.class;
}
项目:bts    文件:OpenDeclarationHandler.java   
public void setDetector(IHyperlinkDetector detector) {
    this.detector = detector;
}
项目:bts    文件:OpenDeclarationHandler.java   
public IHyperlinkDetector getDetector() {
    return detector;
}
项目:KaiZen-OpenAPI-Editor    文件:JsonSourceViewerConfiguration.java   
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    return new IHyperlinkDetector[] { new URLHyperlinkDetector()};
}
项目:gama    文件:GamlUiModule.java   
@Override
public Class<? extends IHyperlinkDetector> bindIHyperlinkDetector() {
    return GamlHyperlinkDetector.class;
}
项目:Eclipse-Postfix-Code-Completion    文件:SimpleJavaSourceViewerConfiguration.java   
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    return null;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:SimpleJavaSourceViewerConfiguration.java   
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    return null;
}
项目:rustyeclipse    文件:RustEditorConfig.java   
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(@Nullable ISourceViewer sourceViewer) {
    return new IHyperlinkDetector[] { new RustHyperlinkDetector(editor) };
}
项目:eclipse-gn    文件:SimpleGnSourceViewerConfiguration.java   
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
  return null;
}
项目:Pydev    文件:ScriptConsoleViewerWrapper.java   
public void setHyperlinkDetectors(IHyperlinkDetector[] hyperlinkDetectors, int eventStateMask) {
    viewer.setHyperlinkDetectors(hyperlinkDetectors, eventStateMask);
}