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


Java Line.Part方法代码示例

本文整理汇总了Java中org.openide.text.Line.Part方法的典型用法代码示例。如果您正苦于以下问题:Java Line.Part方法的具体用法?Java Line.Part怎么用?Java Line.Part使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openide.text.Line的用法示例。


在下文中一共展示了Line.Part方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getContext

import org.openide.text.Line; //导入方法依赖的package包/类
private static Pair<Line.Part, FileObject> getContext(EditorContextProvider ecp) {
    Line.Part lp = ecp.getContext();
    if (lp == null) {
        Line line = EditorContextDispatcher.getDefault().getMostRecentLine();
        if (line != null) {
            lp = line.createPart(0, 0);
        }
    }
    FileObject file;
    if (lp != null) {
        file = lp.getLine().getLookup().lookup(FileObject.class);
    } else {
        file = null;
    }
    return Pair.of(lp, file);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:EditorContextSetter.java

示例2: setupContext

import org.openide.text.Line; //导入方法依赖的package包/类
private static void setupContext(final JEditorPane editorPane, Pair<Line.Part, FileObject> context) {
    assert SwingUtilities.isEventDispatchThread();
    if (context != null) {
        final Line.Part lp = context.first();
        final FileObject file = context.second();
        //System.err.println("WatchPanel.setupContext("+file+", "+line+", "+offset+")");
        // Do the binding for text files only:
        if (file != null && file.getMIMEType().startsWith("text/")) { // NOI18N
            String origText = editorPane.getText();
            DialogBinding.bindComponentToFile(file,
                                              lp.getLine().getLineNumber(),
                                              lp.getColumn(),
                                              lp.getLength(),
                                              editorPane);
            Document editPaneDoc = editorPane.getDocument();
            //editPaneDoc.putProperty("org.netbeans.modules.editor.java.JavaCompletionProvider.skipAccessibilityCheck", "true");
            editorPane.setText(origText);
        }
    }
    setupUI(editorPane);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:EditorContextSetter.java

示例3: Request

import org.openide.text.Line; //导入方法依赖的package包/类
Request(
    AnnotationDesc annoDesc, Annotation[] annos, Line.Part lp,
    int offset, Object tooltipAttributeValue,
    ToolTipSupport tts, JTextComponent component, AbstractDocument doc, NbEditorKit kit, int requestId
) {
    this.annoDesc = annoDesc;
    this.annos = annos;
    this.linePart = lp;
    this.tts = tts;
    this.component = component;
    this.doc = doc;
    this.kit = kit;
    this.offset = offset;
    this.tooltipAttributeValue = tooltipAttributeValue;
    this.requestId = requestId;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:NbToolTip.java

示例4: DebuggerAnnotation

import org.openide.text.Line; //导入方法依赖的package包/类
DebuggerAnnotation (String type, Line.Part linePart) {
    this.type = type;
    this.line = linePart.getLine();
    this.thread = null;
    if ("Breakpoint".equals(type)) {    // Bug #169096
        Exceptions.printStackTrace(new IllegalStateException("Wrong annotation type: "+type+". Please report to bug #169096."));
    }
    attach (linePart);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:DebuggerAnnotation.java

示例5: markCurrent

import org.openide.text.Line; //导入方法依赖的package包/类
static synchronized void markCurrent (final Object line) {
    unmarkCurrent ();
    
    Annotatable[] annotatables = (Annotatable[]) line;
    int i = 0, k = annotatables.length;
    
    // first line with icon in gutter
    DebuggerAnnotation[] annotations = new DebuggerAnnotation [k];
    if (annotatables [i] instanceof Line.Part)
        annotations [i] = new DebuggerAnnotation (
            DebuggerAnnotation.CURRENT_LINE_PART_ANNOTATION_TYPE,
            annotatables [i]
        );
    else
        annotations [i] = new DebuggerAnnotation (
            DebuggerAnnotation.CURRENT_LINE_ANNOTATION_TYPE,
            annotatables [i]
        );
    
    // other lines
    for (i = 1; i < k; i++)
        if (annotatables [i] instanceof Line.Part)
            annotations [i] = new DebuggerAnnotation (
                DebuggerAnnotation.CURRENT_LINE_PART_ANNOTATION_TYPE2,
                annotatables [i]
            );
        else
            annotations [i] = new DebuggerAnnotation (
                DebuggerAnnotation.CURRENT_LINE_ANNOTATION_TYPE2,
                annotatables [i]
            );
    currentLine = annotations;
    
    showLine (line);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:36,代码来源:Utils.java

示例6: getLineNumber

import org.openide.text.Line; //导入方法依赖的package包/类
static int getLineNumber (Object line) {
//        return ((Line) line).getLineNumber ();
        
        final Annotatable[] a = (Annotatable[]) line;
        if (a [0] instanceof Line)
            return ((Line) a [0]).getLineNumber ();
        else
        if (a [0] instanceof Line.Part)
            return ((Line.Part) a [0]).getLine ().getLineNumber ();
        else
            throw new InternalError ();
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:Utils.java

示例7: contains

import org.openide.text.Line; //导入方法依赖的package包/类
public static boolean contains (Object currentLine, Line line) {
    if (currentLine == null) return false;
    final Annotatable[] a = (Annotatable[]) currentLine;
    int i, k = a.length;
    for (i = 0; i < k; i++) {
        if (a [i].equals (line)) return true;
        if ( a [i] instanceof Line.Part &&
             ((Line.Part) a [i]).getLine ().equals (line)
        ) return true;
    }
    return false;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:Utils.java

示例8: DebuggerAnnotation

import org.openide.text.Line; //导入方法依赖的package包/类
DebuggerAnnotation (String type, Line.Part linePart) {
    this.type = type;
    this.line = linePart.getLine();
    attach (linePart);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:DebuggerAnnotation.java

示例9: getShortDescription

import org.openide.text.Line; //导入方法依赖的package包/类
@Override
public String getShortDescription () {
    final Session session = DebuggerManager.getDebuggerManager ().getCurrentSession();
    if (session == null) {
        return null;
    }
    final DebuggerEngine engine = session.getCurrentEngine();
    if (engine == null) {
        return null;
    }

    final Line.Part lp = (Line.Part) getAttachedAnnotatable();
    if (lp == null) {
        return null;
    }
    Line line = lp.getLine ();
    DataObject dob = DataEditorSupport.findDataObject (line);
    if (dob == null) {
        return null;
    }
    final EditorCookie ec = dob.getLookup().lookup(EditorCookie.class);
    if (ec == null) {
        return null;
        // Only for editable dataobjects
    }

    Runnable runnable = new Runnable() {

        @Override
        public void run() {
            evaluate(session, engine/*, dbg*/, lp, ec);
        }
    };
    RequestProcessor rp = engine.lookupFirst(null, RequestProcessor.class);
    if (rp == null) {
        // Debugger is likely finishing...
        rp = RP;
    }
    rp.post(runnable);
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:42,代码来源:AbstractJSToolTipAnnotation.java


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