org.openide.text.Line.show()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(93)

本文整理了Java中org.openide.text.Line.show()方法的一些代码示例,展示了Line.show()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Line.show()方法的具体详情如下:
包路径:org.openide.text.Line
类名称:Line
方法名:show

Line.show介绍

[英]Shows the line (at the first column).
[中]显示行(在第一列)。

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-text

@Override
  public void run() {
    l.show(openType, visibilityType, column);
  }
});

代码示例来源:origin: org.netbeans.api/org-openide-text

/** Shows the line (at the first column).
* @param openType one of {@link ShowOpenType#NONE}, {@link ShowOpenType#OPEN},
*   {@link ShowOpenType#REUSE} or {@link ShowOpenType#REUSE_NEW}
* @param visibilityType one of {@link ShowVisibilityType#NONE},
*   {@link ShowVisibilityType#FRONT} or {@link ShowVisibilityType#FOCUS}
* @see #show(ShowOpenType, ShowVisibilityType, int)
* @since org.openide.text 6.21
*/
public void show(ShowOpenType openType, ShowVisibilityType visibilityType) {
  show(openType, visibilityType, 0);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** Shows the line (at the first column).
* @param kind one of {@link #SHOW_TRY_SHOW}, {@link #SHOW_SHOW}, or {@link #SHOW_GOTO}
* @see #show(int, int)
*/
public void show(int kind) {
  show(kind, 0);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-project

@Override
  public void run() {
    currentLine.show(Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS);
  }
});

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-selenium2

@Override
  public void run() {
    currentLine.show(Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS, column);
  }
});

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** Shows the line (at the first column).
* @param kind one of {@link #SHOW_TRY_SHOW}, {@link #SHOW_SHOW}, or {@link #SHOW_GOTO}
* @see #show(int, int)
*/
public void show(int kind) {
  show(kind, 0);
}

代码示例来源:origin: org.netbeans.api/org-openide-text

/** Shows the line (at the first column).
* @param kind one of {@link #SHOW_TRY_SHOW}, {@link #SHOW_SHOW}, {@link #SHOW_GOTO},
* {@link #SHOW_REUSE} or {@link #SHOW_REUSE_NEW}
* @see #show(int, int)
* @deprecated Deprecated since 6.21. Use {@link #show(ShowOpenType, ShowVisibilityType)} instead.
*/
@Deprecated
public void show(int kind) {
  show(kind, 0);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-apisupport-project

@Override
public void performClickAction(Document doc, int offset, HyperlinkType type) {
  Line ln = getLine(doc, offset);
  if (ln != null) {
    ln.show(ShowOpenType.OPEN, ShowVisibilityType.FOCUS);
  } else {
    Toolkit.getDefaultToolkit().beep();
  }
}

代码示例来源:origin: stackoverflow.com

FileObject fo = null;
 LineCookie lc = DataObject.find(fo).getLookup().lookup(LineCookie.class);
 int lineNumber=42;
 int colNumber=43;
 Line line = lc.getLineSet().getOriginal(lineNumber);
 line.show(Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FRONT, colNumber);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-javascript2-debug-ui

private static void goToSource(JSLineBreakpoint breakpoint ) {
  Line line = JSUtils.getLine(breakpoint);
  if (line != null) {
    line.show(Line.ShowOpenType.REUSE, Line.ShowVisibilityType.FOCUS);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-apisupport-project

public @Override void run() {
    lineCookie.getLineSet().getCurrent(line.get() - 1).show(ShowOpenType.OPEN, ShowVisibilityType.FOCUS);
  }
});

代码示例来源:origin: dcaoyuan/nbscala

static Line showSourceLine(String url, int lineNumber, Object timeStamp) {
  Line l = LineTranslations.getTranslations().getLine(url, lineNumber, timeStamp); // false = use original ln
  if (l == null) {
    ErrorManager.getDefault().log(ErrorManager.WARNING,
        "Show Source: Have no line for URL = " + url + ", line number = " + lineNumber);
    return null;
  }
  if ("true".equalsIgnoreCase(fronting) || Utilities.isWindows()) {
    l.show(Line.SHOW_REUSE);
    l.show(Line.SHOW_TOFRONT); //FIX 47825
  } else {
    l.show(Line.SHOW_REUSE);
  }
  return l;
}

代码示例来源:origin: org.codehaus.mevenide/nb-project

/** Called when some sort of action is performed on a line.
 * @param ev the event describing the line
 */
public void outputLineAction(OutputEvent ev) {
  cookie.getLineSet().getCurrent(line).show(Line.SHOW_GOTO);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-terminal-nb

private void doEDT() {
  if (lc != null) {
    // XXX opens +-1 line
    Line l = lc.getLineSet().getOriginal(lineNumber);
    l.show(Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-debugger-common2

/**
 * Support for bpt GoToSource action
 */
public void visitNextAnnotation() {
DebuggerAnnotation annotation = getNextAnnotation();
if (annotation != null) {
  Line line = annotation.getLine();
    if (line != null) {
      line.show(Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS);
    }
}
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial

@Override
  public void run() {
    javax.swing.JEditorPane[] panes = support.getOpenedPanes();
    if (panes != null) {
      if (lineNumber >= 0 && lineNumber < support.getLineSet().getLines().size()) {
        support.getLineSet().getCurrent(lineNumber).show(Line.ShowOpenType.NONE, Line.ShowVisibilityType.FRONT);
      }
      org.netbeans.modules.mercurial.ui.annotate.AnnotateAction.showAnnotations(panes[0], originalFile, revision.getRevisionNumber());
    }
  }
});

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-java-hints-analyzer

public void open() {
  try {
    PositionRef pos = ed.getRange().getBegin();
    int line = pos.getLine();
    int column = pos.getColumn();
    Line l = pos.getCloneableEditorSupport().getLineSet().getCurrent(line);
    l.show(Line.SHOW_GOTO, column);
  } catch (IOException ex) {
    Exceptions.printStackTrace(ex);
  }
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-languages

public void run () {
    int definitionOffset = definition.getOffset ();
    try {
      DataObject dobj = DataObject.find (fo);
      EditorCookie ec = dobj.getCookie (EditorCookie.class);
      StyledDocument doc2 = ec.openDocument ();
      LineCookie lc = dobj.getCookie (LineCookie.class);
      Line.Set lineSet = lc.getLineSet ();
      Line line = lineSet.getCurrent (NbDocument.findLineNumber (doc2, definitionOffset));
      int column = NbDocument.findLineColumn (doc2, definitionOffset);
      line.show (ShowOpenType.OPEN, ShowVisibilityType.FOCUS, column);
    } catch (IOException ex) {
      ex.printStackTrace ();
    }
  }
};

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-languages

void show () {
  DataObject dataObject = NbEditorUtilities.getDataObject (document);
  LineCookie lineCookie = dataObject.getCookie (LineCookie.class);
  Line.Set lineSet = lineCookie.getLineSet ();
  Line line = lineSet.getCurrent (NbDocument.findLineNumber (document, item.getOffset ()));
  int column = NbDocument.findLineColumn (document, item.getOffset ());
  line.show (ShowOpenType.OPEN, ShowVisibilityType.FOCUS, column);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-spring-beans

private static boolean openFileAtOffset(DataObject dataObject, int offset) throws IOException {
  EditorCookie ec = dataObject.getCookie(EditorCookie.class);
  LineCookie lc = dataObject.getCookie(LineCookie.class);
  if (ec != null && lc != null) {
    StyledDocument doc = ec.openDocument();
    if (doc != null) {
      int lineNumber = NbDocument.findLineNumber(doc, offset);
      if (lineNumber != -1) {
        Line line = lc.getLineSet().getCurrent(lineNumber);
        if (line != null) {
          int lineOffset = NbDocument.findLineOffset(doc, lineNumber);
          int column = offset - lineOffset;
          line.show(ShowOpenType.OPEN, ShowVisibilityType.FOCUS, column);
          return true;
        }
      }
    }
  }
  return false;
}

相关文章