Source code: javax/ide/log/LogManager.java
1 package javax.ide.log;
2
3 import javax.ide.Service;
4 import javax.ide.command.Context;
5 import javax.ide.spi.ProviderNotFoundException;
6
7 /**
8 * The LogManager provides the interface through which the IDE manipulates
9 * {@link LogPage}s.<p>
10 */
11 public abstract class LogManager extends Service
12 {
13 /**
14 * Open and display the page identified by the given type identifier.
15 *
16 * @param context The current {@link Context}.
17 * @param pageClass The page class.
18 *
19 * @return The log page identified by the specified page identifier.
20 */
21 public abstract LogPage openPage( Context context, String pageClass );
22
23 /**
24 * Find the log page with the specified id.
25 *
26 * @param pageClass the log page class.
27 * @return the log page instance if the page is already open, or null if
28 * no log page with the specified id is open.
29 */
30 public abstract LogPage findPage( String pageClass );
31
32 /**
33 * Close the specified <CODE>page</CODE>.
34 *
35 * @param page the page to closed.
36 */
37 public abstract void closePage( LogPage page );
38
39 /**
40 * Get the message page. The message page can be used as the
41 * default page to display textual messages for the user.
42 *
43 * @return get the default message page.
44 */
45 public abstract LogPage getMsgPage();
46
47 /**
48 * Gets the currently selected page.
49 *
50 * @return the currently selected page.
51 */
52 public abstract LogPage getSelectedPage();
53
54 protected final void initialize()
55 {
56
57 }
58
59 /**
60 * Get the log manager implementation for this IDE.
61 *
62 * @return return a LogManager implementation.
63 */
64 public static LogManager getLogManager()
65 {
66 try
67 {
68 return (LogManager) getService( LogManager.class );
69 }
70 catch ( ProviderNotFoundException nse )
71 {
72 nse.printStackTrace();
73 throw new IllegalStateException( "No log manager" );
74 }
75 }
76 }