org.openide
Class TopManager

java.lang.Object
  |
  +--org.openide.TopManager

public abstract class TopManager
extends Object

Heart of the whole IDE. Provides initial access to all features in the system. Use getDefault() to obtain the default instance in the system.


Inner Class Summary
static class TopManager.NodeOperation
          Provides common operations on nodes.
 
Field Summary
static String PROP_DEBUGGER
          Name of property for the debugger.
static String PROP_GLOBAL_KEYMAP
          Name of property for the global keymap.
static String PROP_PLACES
          Name of property for the Places object.
 
Constructor Summary
TopManager()
           
 
Method Summary
abstract  void addPropertyChangeListener(PropertyChangeListener l)
          Add a listener to property changes in the TopManager.
abstract  Dialog createDialog(DialogDescriptor descriptor)
          Get a new standard dialog.
abstract  ClassLoader currentClassLoader()
          Provide access to the user class loader.
abstract  void exit()
          Exit the IDE.
abstract  ActionManager getActionManager()
          Specialized manager that provides information about actions.
abstract  ExClipboard getClipboard()
          Get global system clipboard.
abstract  CompilationEngine getCompilationEngine()
          Get default compilation engine.
abstract  ControlPanel getControlPanel()
          Deprecated. Not useful.
abstract  Debugger getDebugger()
          Get the default debugger.
static TopManager getDefault()
          Get the default top manager for the system.
abstract  ErrorManager getErrorManager()
          Get the exception manager for the IDE.
abstract  ExecutionEngine getExecutionEngine()
          Get default execution engine.
abstract  Keymap getGlobalKeymap()
          Get global keyboard-shortcut map.
 InputOutput getIO(String name)
          Support reading from and writing to a specific tab on the Output Window.
abstract  InputOutput getIO(String name, boolean newIO)
          Support reading from and writing to a specific tab on the Output Window.
abstract  DataLoaderPool getLoaderPool()
          Get default data loader pool.
abstract  TopManager.NodeOperation getNodeOperation()
          Get default handler for node customization and exploration.
abstract  Places getPlaces()
          Get object providing locations of important places in the system.
abstract  Repository getRepository()
          Get the Repository of user and system files.
abstract  ServiceType.Registry getServices()
          Getter for registry of services registered to the system.
abstract  OutputWriter getStdOut()
          Support writing to the Output Window on the main tab.
abstract  WindowManager getWindowManager()
          Get the window manager for the IDE.
static boolean isInitialized()
          Test to check whether the top manager is initilized or not.
abstract  Object notify(NotifyDescriptor descriptor)
          Notify the user of something in a message box, possibly with feedback.
 void notifyException(Throwable ex)
          Notify the user of an otherwise unhandled Java exception.
abstract  void openProject(ProjectCookie project)
          Opens specified project.
abstract  void removePropertyChangeListener(PropertyChangeListener l)
          Remove a listener to property changes in the TopManager.
abstract  void saveAll()
          Save all opened objects.
static void setDefault(TopManager tm)
          Deprecated. Useless.
abstract  void setStatusText(String text)
          Show text in the IDE's status line.
abstract  void showHelp(HelpCtx helpCtx)
          Display help.
abstract  void showUrl(URL url)
          Browse a document named by some URL.
abstract  ClassLoader systemClassLoader()
          Provide access to the system class loader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_DEBUGGER

public static final String PROP_DEBUGGER
Name of property for the debugger.

PROP_GLOBAL_KEYMAP

public static final String PROP_GLOBAL_KEYMAP
Name of property for the global keymap.

PROP_PLACES

public static final String PROP_PLACES
Name of property for the Places object. This is most likely to change when a new project is opened.
Constructor Detail

TopManager

public TopManager()
Method Detail

getDefault

public static TopManager getDefault()
Get the default top manager for the system.
Returns:
the default

setDefault

public static void setDefault(TopManager tm)
                       throws SecurityException
Deprecated. Useless.


isInitialized

public static boolean isInitialized()
Test to check whether the top manager is initilized or not.
Returns:
true if the default instance of top manager has already been created

getRepository

public abstract Repository getRepository()
Get the Repository of user and system files.
Returns:
the repository

showHelp

public abstract void showHelp(HelpCtx helpCtx)
Display help.
Parameters:
helpCtx - help context to be displayed in help window

showUrl

public abstract void showUrl(URL url)
Browse a document named by some URL. HtmlBrowser provides more control in certain cases.
Parameters:
url - URL of WWW or local document to be shown
See Also:
HtmlBrowser

getStdOut

public abstract OutputWriter getStdOut()
Support writing to the Output Window on the main tab.
Returns:
a writer for the standard IDE output

getIO

public InputOutput getIO(String name)
Support reading from and writing to a specific tab on the Output Window. If a tab with the supplied name already exists, a new tab with the same name will be created regardless.
Parameters:
name - desired name of the tab
Returns:
an InputOutput class for accessing the new tab

getIO

public abstract InputOutput getIO(String name,
                                  boolean newIO)
Support reading from and writing to a specific tab on the Output Window. If a tab with the supplied name already exists, a new tab with the same name will be created regardless.
Parameters:
name - desired name of the tab
newIO - if true new InputOutput is returned else already used InputOutput is returned.
Returns:
an InputOutput class for accessing the new tab

getClipboard

public abstract ExClipboard getClipboard()
Get global system clipboard.
Returns:
the clipboard

getControlPanel

public abstract ControlPanel getControlPanel()
Deprecated. Not useful.

Get system control panel. This permits all current user options to be examined, among other things.
Returns:
the control panel

getServices

public abstract ServiceType.Registry getServices()
Getter for registry of services registered to the system.
Returns:
the singleton with all services

getActionManager

public abstract ActionManager getActionManager()
Specialized manager that provides information about actions. Currently it holds list of all context sensitive actions registered in the IDE.
Returns:
the manager

notifyException

public void notifyException(Throwable ex)
Notify the user of an otherwise unhandled Java exception. This method provides a convenient way of handling exceptions occurring in the IDE. If you catch an exception and wish to inform the user about it (though no response is required), you may send the message to this method. The manager handles the rest.

The default implementation uses notify(org.openide.NotifyDescriptor) to alert the user at a critical level.

Parameters:
ex - the exception

notify

public abstract Object notify(NotifyDescriptor descriptor)
Notify the user of something in a message box, possibly with feedback.

To support both GUI and non-GUI use, this method may be called from any thread (providing you are not holding any locks), and will block the caller's thread. In GUI mode, it will be run in the AWT event thread automatically. If you wish to hold locks, or do not need the result object immediately or at all, please make this call asynchronously (e.g. from the request processor).

Parameters:
nd - description of the notification
Returns:
the option that caused the message box to be closed

createDialog

public abstract Dialog createDialog(DialogDescriptor descriptor)
Get a new standard dialog. The dialog is designed and created as specified in the parameter. Anyone who wants a dialog with standard buttons and standard behavior should use this method.

Do not cache the resulting dialog if it is modal and try to reuse it! Always create a new dialog using this method if you need to show a dialog again. Otherwise previously closed windows can reappear.

Parameters:
descriptor - general description of the dialog

setStatusText

public abstract void setStatusText(String text)
Show text in the IDE's status line. Can be called at any time, but remember the text may not be updated until the AWT event queue is ready for it - so if you are hogging the event queue the text will not appear until you release it (finish your work or display a modal dialog, for example).
Parameters:
text - the text to be shown

getGlobalKeymap

public abstract Keymap getGlobalKeymap()
Get global keyboard-shortcut map.
Returns:
default root of shortcuts

getCompilationEngine

public abstract CompilationEngine getCompilationEngine()
Get default compilation engine.
Returns:
default compilation engine in the system

getExecutionEngine

public abstract ExecutionEngine getExecutionEngine()
Get default execution engine.
Returns:
default execution engine in the system

getDebugger

public abstract Debugger getDebugger()
                              throws DebuggerNotFoundException
Get the default debugger.
Returns:
default debugger in the system (never null)
Throws:
DebuggerNotFoundException - in case of a problem (for example, there is no debugger installed)

saveAll

public abstract void saveAll()
Save all opened objects.

exit

public abstract void exit()
Exit the IDE. This method will return only if java.lang.System#exit fails, or if at least one component of the system refuses to exit (because it cannot be properly shut down).

getLoaderPool

public abstract DataLoaderPool getLoaderPool()
Get default data loader pool.
Returns:
default loader pool in the system

getNodeOperation

public abstract TopManager.NodeOperation getNodeOperation()
Get default handler for node customization and exploration.
Returns:
default node operation manager in the system

getPlaces

public abstract Places getPlaces()
Get object providing locations of important places in the system.
Returns:
the descriptor

openProject

public abstract void openProject(ProjectCookie project)
                          throws IOException,
                                 UserCancelException
Opens specified project. Asks to save the previously opened project.
Throws:
IOException - if error occurs accessing the project
UserCancelException - if the selection is interrupted by the user

getErrorManager

public abstract ErrorManager getErrorManager()
Get the exception manager for the IDE. It can be used to rafine handling of exception and the way they are presented to the user.
Returns:
the manager

getWindowManager

public abstract WindowManager getWindowManager()
Get the window manager for the IDE. The window manager is responsible for the placement of windows and the handling of TopComponents.

It is usually used only from the org.openide.windows package.

Returns:
default window manager

systemClassLoader

public abstract ClassLoader systemClassLoader()
Provide access to the system class loader. This class loader allows loading of IDE implementation classes in the startup class path, and all installed modules as well. It does not load any classes from the user Repository.

The class loader may change from call to call, for example due to a module installation.

Returns:
the system classloader

currentClassLoader

public abstract ClassLoader currentClassLoader()
Provide access to the user class loader. This class loader can load everything provided by the system one, as well as user classes in the Repository.

The class loader may change from call to call, as it is affected by module and repository operations. The returned classloader will reflect the current state of the filesystem, taking into account modifications of .class files.

Returns:
the user classloader

addPropertyChangeListener

public abstract void addPropertyChangeListener(PropertyChangeListener l)
Add a listener to property changes in the TopManager.
Parameters:
l - the listener to add

removePropertyChangeListener

public abstract void removePropertyChangeListener(PropertyChangeListener l)
Remove a listener to property changes in the TopManager.
Parameters:
l - the listener to remove


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.