EditorFactory.java revision 9883:903a2e023ffb
1145519Sdarrenr/*
2145510Sdarrenr * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
322514Sdarrenr * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
480486Sdarrenr *
522514Sdarrenr * This code is free software; you can redistribute it and/or modify it
680486Sdarrenr * under the terms of the GNU General Public License version 2 only, as
7145510Sdarrenr * published by the Free Software Foundation.
8161357Sguido *
922514Sdarrenr * This code is distributed in the hope that it will be useful, but WITHOUT
1022514Sdarrenr * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1126119Sdarrenr * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1226119Sdarrenr * version 2 for more details (a copy is included in the LICENSE file that
1326119Sdarrenr * accompanied this code).
1453024Sguido *
1553024Sguido * You should have received a copy of the GNU General Public License version
1653024Sguido * 2 along with this work; if not, write to the Free Software Foundation,
1753024Sguido * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1853024Sguido *
1953024Sguido * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2053024Sguido * or visit www.oracle.com if you need additional information or have any
2124583Sdarrenr * questions.
2222514Sdarrenr *
2353024Sguido */
2424583Sdarrenr
2553024Sguidopackage sun.jvm.hotspot.ui;
2622514Sdarrenr
2724583Sdarrenrimport javax.swing.JComponent;
2824583Sdarrenr
2924583Sdarrenr/** An EditorFactory is the basis of pluggable editor components. One
30145510Sdarrenr    can configure the debugger with a new EditorFactory, which
3122514Sdarrenr    completely replaces how the debugger displays source code. */
3224583Sdarrenr
33145510Sdarrenrpublic interface EditorFactory {
34145510Sdarrenr  /** Opens the given file in a new window. The debugger has already
3524583Sdarrenr      taken care of ensuring that the file can be found. The debugger
3624583Sdarrenr      will typically not create two Editor objects for the same source
3726119Sdarrenr      file, as it keeps track of open files. The EditorCommands object
3853024Sguido      provided to the Editor by the debugger allows the Editor to
3953024Sguido      notify the debugger of events such as a breakpoint being set or
4053024Sguido      a window being closed. */
4153024Sguido  public Editor openFile(String filename, EditorCommands commands);
4253024Sguido
4326119Sdarrenr  /** Retrieves the current topmost file of all of the Editors this
44      EditorFactory has opened. This is used for the debugger user
45      interface to request that a breakpoint be set. (Editors can also
46      request that breakpoints be set via the EditorCommands, but this
47      is intended to support external editors with their own
48      keystrokes for performing this operation.) Returns null if there
49      is no file currently being edited. */
50  public Editor getCurrentEditor();
51}
52