Package org.eclipse.ui.internal.console

Examples of org.eclipse.ui.internal.console.ConsoleHyperlinkPosition


    public IHyperlink[] getHyperlinks() {
        try {
            Position[] positions = getDocument().getPositions(ConsoleHyperlinkPosition.HYPER_LINK_CATEGORY);
            IHyperlink[] hyperlinks = new IHyperlink[positions.length];
            for (int i = 0; i < positions.length; i++) {
                ConsoleHyperlinkPosition position = (ConsoleHyperlinkPosition) positions[i];
                hyperlinks[i] = position.getHyperLink();
            }
            return hyperlinks;
        } catch (BadPositionCategoryException e) {
            return new IHyperlink[0];
        }
View Full Code Here


     * @param length the length of the text which should be hyperlinked
     * @throws BadLocationException if the specified location is not valid.
     */
    public void addHyperlink(IHyperlink hyperlink, int offset, int length) throws BadLocationException {
        IDocument document = getDocument();
    ConsoleHyperlinkPosition hyperlinkPosition = new ConsoleHyperlinkPosition(hyperlink, offset, length);
    try {
      document.addPosition(ConsoleHyperlinkPosition.HYPER_LINK_CATEGORY, hyperlinkPosition);
            fConsoleManager.refresh(this);
    } catch (BadPositionCategoryException e) {
      ConsolePlugin.log(e);
View Full Code Here

    try {
        IDocument doc = getDocument();
        if (doc != null) {
        Position[] positions = doc.getPositions(ConsoleHyperlinkPosition.HYPER_LINK_CATEGORY);
        for (int i = 0; i < positions.length; i++) {
          ConsoleHyperlinkPosition position = (ConsoleHyperlinkPosition)positions[i];
          if (position.getHyperLink().equals(link)) {
            return new Region(position.getOffset(), position.getLength());
          }
        }
        }
    } catch (BadPositionCategoryException e) {
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.internal.console.ConsoleHyperlinkPosition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.