com.borland.primetime.ide
Class Browser

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--com.borland.primetime.ide.Browser

public class Browser
extends javax.swing.JFrame

This is the Browser window, which is the center of all JBuilder UI. The Browser window consists of several different interacting parts:

BrowserMenuBar
The BrowserMenuBar is the top-most menu in the Browser window.
BrowserToolBarPane
The BrowserToolBarPane houses the speed-buttons for opening, saving, compiling, and debugging nodes displayed in the browser.
ProjectView
The ProjectView displays the list of opened Projects in the Browser, and the contents of each.
ContentManager
The ContentManager houses the list of ContentViews - one for each open Node in the Browser. The ContentViews each display a set of tabs representing the NodeViewer classes registered that accept the Node.
StructureView
The StructureView houses the StructureComponent for a given NodeViewer. The contents of the StructureView is controlled entirely by the NodeViewer.
MessageView
The MessageView displays messages to the user from any subsystem. Messages in the MessageView can have independant context menus, react to clicking and double-clicking, as well as provide F1 contextual help.
StatusView
The StatusView also displays messages to the user from any subsystem, but the messages are text only.

See Also:
BrowserMenuBar, BrowserToolBarPane, ProjectView, ContentManager, StructureView, MessageView, StatusView, Serialized Form

Inner Class Summary
protected  class Browser.UpdateTimer
           
 
Inner classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Field Summary
static UpdateAction ACTION_BrowserCascadeAll
          Scans the list of existing Browsers in this JBuilder session, and arrages them all in a Z-order cascade, with the top of the Z-order remaining in front.
static BrowserAction ACTION_BrowserExit
          Calls the close() method on this Browser.
static BrowserAction ACTION_BrowserIconify
           
static UpdateAction ACTION_BrowserMinimizeAll
          Scans the list of existing Browsers in this JBuilder session, and minimizes them all.
static UpdateAction ACTION_BrowserNew
          Creates a new browser window when invoked.
static UpdateAction ACTION_BrowserRestoreAll
          Scans the list of existing Browsers in this JBuilder session, and restores them all from a minimized state.
static BrowserAction ACTION_BrowserShow
          Calls the show() method on this browser window.
static UpdateAction ACTION_BrowserTileAll
          Scans the list of existing Browsers in this JBuilder session, and tiles them all to fit on the screen at the same time.
static BrowserAction ACTION_EditDefaultProjectProperties
          The static action 'EditDefaultProjectProperties' displays the PropertyDialog to the user for default project settings.
static BrowserAction ACTION_EditProjectProperties
          The static action 'EditProjectProperties' displays the PropertyDialog to the user for the active project's settings.
static BrowserAction ACTION_FileOpen
          Displays a FileChooser dialog allowing the user to select a file to open.
static BrowserAction ACTION_NavigateBack
          Navigates the Browser to the prior item in the Browser's history list.
static BrowserAction ACTION_NavigateForward
          Navigates the Browser to the next item in the Browser's history list.
static BrowserAction ACTION_NavigateHome
          Navigates the Browser back the 'home' position.
static BrowserAction ACTION_NewFolder
           
static BrowserAction ACTION_NextOpenNode
          Navigates the Browser to the next item in the open tabs list
static BrowserAction ACTION_NodeClose
          Calls the closeNode(...) method on this Browser passing the Node returned from the getActiveNode() method on this Browser.
static BrowserAction ACTION_NodeCloseAll
          Calls the closeNodes(...) method on this Browser passing the the Node array returned from the getNodes() method on this Browser.
static BrowserAction ACTION_NodeRename
          Renames the active node in the Browser.
static BrowserAction ACTION_NodeRevert
          Retrieves the 'active' Node using the getActiveNode() method on this Browser.
static BrowserAction ACTION_NodeSave
          Saves the active Node if it has been modified.
static BrowserAction ACTION_NodeSaveAll
          Saves all modified buffers and projects.
static BrowserAction ACTION_NodeSaveAs
          Saves the active Node under a user selected name.
static BrowserAction ACTION_PreviousOpenNode
          Navigates the Browser to the next item in the open tabs list
static BrowserAction ACTION_ProjectFileOpen
           
static BrowserAction ACTION_ProjectNodeRename
          Renames the active selected node in the ProjectView to a new name.
static BrowserAction ACTION_ProjectSave
          Saves the active Project if it has been modified.
static BrowserAction ACTION_ProjectSaveAs
          Saves the active Project under a new name.
static BrowserAction ACTION_ToggleCurtain
           
static BrowserAction ACTION_ToolBarHideAll
           
static BrowserAction ACTION_ToolBarShowAll
           
static DelegateAction DELEGATE_ContextMenu
           
static DelegateAction DELEGATE_Copy
           
static DelegateAction DELEGATE_Cut
           
static DelegateAction DELEGATE_Delete
           
static DelegateAction DELEGATE_Paste
           
static DelegateAction DELEGATE_Redo
           
static DelegateAction DELEGATE_Refresh
           
static DelegateAction DELEGATE_SearchAgain
           
static DelegateAction DELEGATE_SearchFind
           
static DelegateAction DELEGATE_SearchIncremental
           
static DelegateAction DELEGATE_SearchReplace
           
static DelegateAction DELEGATE_SelectAll
           
static DelegateAction DELEGATE_Undo
           
static ActionGroup GROUP_NavigateTo
           
static ActionGroup GROUP_NodeOpen
           
static ActionGroup GROUP_OpenBrowsers
           
static ActionGroup GROUP_OpenWindows
           
static ActionGroup GROUP_Reopen
           
static ActionGroup GROUP_ToolBars
           
static BrowserStateAction STATE_ContentPaneVisible
           The state 'ContentPaneVisible' controls the visible state of this Browser's ContentManager.
static BrowserStateAction STATE_MessagePaneVisible
           The state 'MessagePaneVisible' controls the visible state of this Browser's MessageView.
static BrowserStateAction STATE_ProjectPaneVisible
           The state 'ProjectPaneVisible' controls the visible state of this Browser's ProjectView.
static BrowserStateAction STATE_StatusPaneVisible
          The state 'StatusPaneVisible' controls the visible state of this Browser's StatusView.
static BrowserStateAction STATE_StructurePaneVisible
           The state 'StructurePaneVisible' controls the visible state of this Browser's StructureView.
static BrowserStateAction STATE_ToolBarPaneVisible
          The state 'ToolBarVisible' controls the visible state of this Browser's main toolbar.
protected  Browser.UpdateTimer updateTimer
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
Browser()
          Constructs a new Browser window.
 
Method Summary
 void addBrowserListener(BrowserListener l)
          Adds a BrowserListener to listen to Browser events from this Browser.
 void addButton(ActionButton button)
           
static void addMenuGroup(ActionGroup group)
          Adds an ActionGroup to the end of the static list of ActionGroups that will appear in all subsequently created Browser window menus.
static void addMenuGroup(int index, ActionGroup group)
          Inserts an ActionGroup into the static list of ActionGroups at the specified index.
static void addStaticBrowserListener(BrowserListener l)
          Adds a BrowserListener to listen to Browser events from *ALL* existing Browsers.
static void addToolBarGroup(ActionGroup group)
          Adds an ActionGroup to the end of the static list of ActionGroups that will appear in all subsequently created Browser window toolbars.
static void addToolBarGroup(int index, ActionGroup group)
          Inserts an ActionGroup into the static list of toolbar ActionGroups at the specified index.
static boolean canDisplayNode(Node node)
           Returns the count of NodeViewers that have 'accepted' the specified Node, and are available to display the contents of the Node in the ContentView.
 boolean canNavigateBack()
          Returns true if the navigation stack pointer is not at the beginning of the navigation stack.
 boolean canNavigateForward()
          Returns true if there are items in the navigation stack beyond the current item.
static java.io.File checkExtension(UrlNode urlNode, java.io.File file)
          Checks the node type extension against the selected file.
 boolean checkOverwrite(java.lang.String fileName)
          Checks if the user wishes to overwrite the specified file.
 void clearWaitMessages()
          Hides the message window, and kills any delayed messages that may still be in the queue.
static java.lang.String clipPath(java.awt.FontMetrics fm, java.lang.String text, int width)
          Clips a file path as needed in the middle to fit the given width.
static java.lang.String clipPath(java.lang.String text)
           
 void close()
          Closes this Browser window and saves any modified files.
 void closeNode(Node node)
           Closes the specified Node and removes it from this Browser's ContentManager.
 void closeNodes(Node[] nodes)
           Closes the specified list of Nodes and removes them from this Browser's ContentManager.
 void closeProject(Project project)
           
 void delayWaitMessage(int delay, java.lang.String title, java.lang.String text)
          Displays an information window centered on the screen with the specified title and text messages - after the specified delay (ms) has passed.
 void doOpen(java.io.File openedFile, boolean add2Proj)
           
 void doRename(Node node)
          Checks the specified node to see if it is an instance of UrlNode or a LightweightNode, and calls doRenameUrlNode(UrlNode) or doRenameLightweightNode(LightweightNode) respectively.
 void doRenameLightweightNode(LightweightNode liteNode)
          Renames the specified LightweightNode to a user specified name.
 void doRenameUrlNode(UrlNode urlNode)
          Renames the specified UrlNode to a user specified name.
 void doRevert(Node[] nodes)
          Scans the array of nodes and calls doRevert(UrlNode) on all UrlNode instances in the array.
 void doRevert(UrlNode urlNode)
          Reverts the specified UrlNode.
 void doSave(Node[] nodes)
          Scans and attempts to save each of the UrlNode instances in the passed array.
 void doSave(UrlNode urlNode)
          Saves the specified UrlNode - or if it is a new node, doSaveAs(UrlNode) is called passing the specified node.
 void doSaveAll(boolean checked)
          Scans entire PrimeTime environment for modified buffers and projects and optionally presents a list of these to the user (if checked flag is true) to select which ones to save.
 void doSaveAs(UrlNode urlNode)
          Saves the specifed UrlNode as specified by the user.
 void doSaveChecked(Node[] nodes)
          Presents the specified list of nodes in a save dialog for the user to select which ones they want to save.
 void doSaveChecked(UrlNode urlNode)
          Queries the user if they want to save the specified UrlNode.
static Browser findBrowser(java.lang.Object source)
          Walks up the containership hierarchy to try to find a Browser instance from the passed Object (if the passed Object is a Component).
protected  void fireBrowserActivated()
          The 'browserActivated' event is fired each time the Browser window is activated - by switching to this Browser from another Browser, or by switching to this Browser from another application.
protected  void fireBrowserClosed()
          The 'browserClosed' event is fired when a Browser is finally closed.
protected  void fireBrowserClosing()
          The 'browserClosing' event is fired when the Browser is attempting to close.
protected  void fireBrowserDeactivated()
          The 'browserDeactivated' event is fired each time the Browser window is deactivated - by switching to another Browser, or by switching to another application.
protected  void fireBrowserNodeActivated(Node node)
          The 'browserNodeActivated' event is fired when the 'active' Node in the Browser has changed - ie.
protected  void fireBrowserNodeClosed(Node node)
          The 'browserNodeClosed' event is fired when a Node in the Browser is closed.
protected  void fireBrowserOpened()
          The 'browserOpened' event is fired when a Browser is opened for the first time.
protected  void fireBrowserProjectActivated(Project project)
          The 'browserProjectActivated' event is fired when the 'active' Project in the Browser has changed - ie.
protected  void fireBrowserProjectClosed(Project project)
          The 'browserProjectClosed' event is fired when a Project in the Browser is closed.
protected  void fireBrowserViewerActivated(Node node, NodeViewer viewer)
          The 'browserViewerActivated' event is fired when the 'active' Node in the Browser's 'active' NodeViewer has changed - ie.
protected  void fireBrowserViewerDeactivating(Node node, NodeViewer viewer)
          The 'browserViewerDeactivating' event is fired when the active Node's viewer is changing - ie.
static Browser getActiveBrowser()
           Returns the active (most recently activated) Browser in this JBuilder session.
 Node getActiveNode()
          Returns the active Node in this Browser.
 Project getActiveProject()
           
 NodeViewer getActiveViewer(Node node)
          Returns the active NodeViewer for the specified Node in this Browser.
static Node[] getAllOpenNodes()
          Returns all the open Nodes in all Browsers.
static int getBrowserCount()
          Returns the count of Browsers in this JBuilder session.
static Browser[] getBrowsers()
          Returns a Browser array in the correct Z order (order of activation), with the most recently active Browser first.
static Browser[] getBrowsersNonZ()
          Returns a Browser array in the non-Z order (order of creation), with the most recently created Browser last.
static java.lang.String getBrowserTitle()
          Returns the browser title.
 ContentManager getContentManager()
          Returns this Browser's ContentManager instance.
static Project getDefaultProject()
          Returns the Default project.
static Url getDefaultProjectUrl()
          Returns a Url pointing to the Default project.
static java.lang.String getIDELookAndFeelClassName()
          Returns the class name of the IDE's active LookAndFeel.
static java.io.File getLastDirectory()
           
 Url getLastOpenedUrl()
          Returns the last opened url address.
static ActionGroup getMenuGroup(int index)
          Returns the menu ActionGroup at the specied index.
static int getMenuGroupCount()
          Returns the static count of ActionGroups that appear in all Browser menus.
static ActionGroup[] getMenuGroups()
          Returns the static list of ActionGroups that appear in all Browser menus.
 MessageView getMessageView()
          Returns this Browser's MessageView instance.
 Node[] getNavigationHistory()
           
 Node getNavigationHistory(int index)
           
 int getNavigationHistoryCount()
           
 int getNavigationIndex()
           
 int getOpenNodeCount()
          Returns the count of open Nodes in this Browser.
 Node[] getOpenNodes()
          Returns the open Nodes in this Browser.
 ProjectView getProjectView()
          Returns this Browser's ProjectView instance.
 StatusView getStatusView()
          Returns this Browser's StatusView instance.
static ActionGroup getToolBarGroup(int index)
          Returns the toolbar ActionGroup at the specied index.
static int getToolBarGroupCount()
          Returns the count of static Browser toolbars.
static ActionGroup[] getToolBarGroups()
          Returns the static list of ActionGroups that appear in all Browser toolbars.
 BrowserToolBarPane getToolBarPane()
          Returns this browser's BrowserToolBarPane instance.
 int getViewerCount(Node node)
           Returns the count of NodeViewers that have 'accepted' the specified Node, and are available to display the contents of the Node in the ContentView.
 NodeViewer getViewerOfType(Node node, java.lang.Class clazz)
           Returns the first NodeViewer instance of the specified type that have is displaying the specified Node.
 NodeViewer[] getViewers(Node node)
           Returns the NodeViewers that have 'accepted' the specified Node, and are available to display the contents of the Node in the ContentView.
 boolean isContentPaneVisible()
          Returns this browser's content pane's visible state.
 boolean isMessagePaneVisible()
          Returns this browser's message pane's visible state.
 boolean isOpenNode(Node node)
          Returns true if the passed node is currently being displayed in this Browser.
 boolean isProjectPaneVisible()
          Returns this browser's project pane's visible state.
 boolean isStatusPaneVisible()
          Returns this browser's status pane's visible state.
 boolean isStructurePaneVisible()
          Returns this browser's structure pane's visible state.
 boolean isToolBarPaneVisible()
          Returns this browser toolbar pane's visible state.
 void navigateBack()
          Moves the active node to the previous node in the navigation stack (if the navigation stack pointer is not at the beginning).
 void navigateForward()
          Moves the active node to the next node in the navigation stack (if the navigation stack pointer is not at the end).
 void navigateHome()
          Moves the active node to the first node in the navigation stack (if the navigation stack pointer is not at the beginning).
 void navigateTo(int index)
           
 void navigateTo(Node node)
          Effectively a 'drill-in'.
 void nextOpenNode(boolean requestFocus)
          Sets the next node as the active node in this Browser window.
 void openFile(boolean add2Proj)
           
 void openProjectFile()
           
 void previousOpenNode(boolean requestFocus)
          Sets the previous node as the active node in this Browser window.
static void registerNodeViewerFactory(NodeViewerFactory factory)
           Registers a NodeViewerFactory class for displaying Node contents.
static void registerNodeViewerFactory(NodeViewerFactory factory, boolean asFirst)
           Registers a NodeViewerFactory class for displaying Node contents.
 void removeBrowserListener(BrowserListener l)
          Removes a BrowserListener from this Browser.
 void removeButton(ActionButton button)
           
static void removeMenuGroup(ActionGroup group)
          Removes an ActionGroup from the static list of ActionGroups that appear in all subsequently created Browser window menus.
static void removeStaticBrowserListener(BrowserListener l)
          Removes a BrowserListener from the static listener list.
static void removeToolBarGroup(ActionGroup group)
          Removes an ActionGroup from the static list of ActionGroups that appear in all subsequently created Browser window toolbars.
 void setActiveNode(Node node, boolean requestFocus)
           Sets the 'active' open Node in this Browser.
 void setActiveProject(Project project)
           
 void setActiveViewer(Node node, NodeViewer viewer, boolean requestFocus)
           Sets the active NodeViewer for the specified Node.
 void setBounds(java.awt.Rectangle b)
           
static void setBrowserTitle(java.lang.String title)
          Sets the browser title.
 void setContentPaneVisible(boolean visible)
          Hides/shows this browser's content pane.
static void setDefaultProjectUrl(Url url)
          Sets the default project's url.
static void setIDELookAndFeelClassName(java.lang.String className)
          Sets the LookAndFeel for the whole JBuilder IDE (Browsers and all other addins).
static void setLastDirectory(java.io.File file)
          Sets the last visited directory.
 void setLastOpenedUrl(Url url)
          Sets the last opened url address.
 void setMessagePaneVisible(boolean visible)
          Hides/shows this browser's message pane.
 void setProjectPaneVisible(boolean visible)
          Hides/shows this browser's project pane.
 void setStatusPaneVisible(boolean visible)
          Hides/shows this browser's status pane.
 void setStructurePaneVisible(boolean visible)
          Hides/shows this browser's structure pane.
 void setToolBarPaneVisible(boolean visible)
          Hides/shows this browser's toolbar pane.
 void showIllegalFileNameWarning(java.lang.String fileName)
          Alerts the user that the passed filename is invalid.
 void toggleCurtain()
          Toggles the project/structure left pane visible/invisible.
 void waitMessage(java.lang.String title, java.lang.String text)
          Displays an information window centered on the screen with the specified title and text messages.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, isResizable, remove, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle
 
Methods inherited from class java.awt.Window
addWindowListener, applyResourceBundle, applyResourceBundle, dispose, getFocusOwner, getInputContext, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isShowing, pack, postEvent, processEvent, removeWindowListener, setCursor, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

updateTimer

protected Browser.UpdateTimer updateTimer

ACTION_BrowserNew

public static UpdateAction ACTION_BrowserNew
Creates a new browser window when invoked.

ACTION_BrowserMinimizeAll

public static UpdateAction ACTION_BrowserMinimizeAll
Scans the list of existing Browsers in this JBuilder session, and minimizes them all.

ACTION_BrowserRestoreAll

public static UpdateAction ACTION_BrowserRestoreAll
Scans the list of existing Browsers in this JBuilder session, and restores them all from a minimized state.

ACTION_BrowserCascadeAll

public static UpdateAction ACTION_BrowserCascadeAll
Scans the list of existing Browsers in this JBuilder session, and arrages them all in a Z-order cascade, with the top of the Z-order remaining in front.

ACTION_BrowserTileAll

public static UpdateAction ACTION_BrowserTileAll
Scans the list of existing Browsers in this JBuilder session, and tiles them all to fit on the screen at the same time.

ACTION_BrowserShow

public static BrowserAction ACTION_BrowserShow
Calls the show() method on this browser window. This will bring it to the front, and show it if it is iconified or hidden.

ACTION_BrowserIconify

public static BrowserAction ACTION_BrowserIconify

ACTION_BrowserExit

public static BrowserAction ACTION_BrowserExit
Calls the close() method on this Browser.

GROUP_OpenWindows

public static ActionGroup GROUP_OpenWindows

ACTION_NewFolder

public static BrowserAction ACTION_NewFolder

ACTION_FileOpen

public static BrowserAction ACTION_FileOpen
Displays a FileChooser dialog allowing the user to select a file to open. If a file is selected, it is first tested to see if it is a Project. If it is a Project, the setActiveProject(...) method is called on this Browser's ProjectView. If the file is not a Project, a Node is created from the file using the 'active' Project, and the setActiveNode(...) method is called on this Browser.

ACTION_ProjectFileOpen

public static BrowserAction ACTION_ProjectFileOpen

ACTION_NodeSave

public static BrowserAction ACTION_NodeSave
Saves the active Node if it has been modified.

ACTION_NodeSaveAs

public static BrowserAction ACTION_NodeSaveAs
Saves the active Node under a user selected name.

ACTION_NodeRename

public static BrowserAction ACTION_NodeRename
Renames the active node in the Browser.

ACTION_ProjectNodeRename

public static BrowserAction ACTION_ProjectNodeRename
Renames the active selected node in the ProjectView to a new name.

ACTION_NodeSaveAll

public static BrowserAction ACTION_NodeSaveAll
Saves all modified buffers and projects.

ACTION_ProjectSave

public static BrowserAction ACTION_ProjectSave
Saves the active Project if it has been modified.

ACTION_ProjectSaveAs

public static BrowserAction ACTION_ProjectSaveAs
Saves the active Project under a new name.

ACTION_NodeClose

public static BrowserAction ACTION_NodeClose
Calls the closeNode(...) method on this Browser passing the Node returned from the getActiveNode() method on this Browser.

ACTION_NodeCloseAll

public static BrowserAction ACTION_NodeCloseAll
Calls the closeNodes(...) method on this Browser passing the the Node array returned from the getNodes() method on this Browser.

ACTION_NodeRevert

public static BrowserAction ACTION_NodeRevert
Retrieves the 'active' Node using the getActiveNode() method on this Browser. It then checks if the Node has been modified and if it is an instanceof UrlNode. If both conditions are true, the UrlNode.revert() method is called.

ACTION_NavigateHome

public static BrowserAction ACTION_NavigateHome
Navigates the Browser back the 'home' position.

ACTION_NavigateBack

public static BrowserAction ACTION_NavigateBack
Navigates the Browser to the prior item in the Browser's history list. If there is no prior item in the Browser's history list, this action does nothing.

ACTION_NavigateForward

public static BrowserAction ACTION_NavigateForward
Navigates the Browser to the next item in the Browser's history list. If there is no next item in the Browser's history list, this action does nothing.

GROUP_NavigateTo

public static ActionGroup GROUP_NavigateTo

ACTION_NextOpenNode

public static BrowserAction ACTION_NextOpenNode
Navigates the Browser to the next item in the open tabs list

ACTION_PreviousOpenNode

public static BrowserAction ACTION_PreviousOpenNode
Navigates the Browser to the next item in the open tabs list

STATE_ToolBarPaneVisible

public static BrowserStateAction STATE_ToolBarPaneVisible
The state 'ToolBarVisible' controls the visible state of this Browser's main toolbar. If the state is true, the toolbar is visible. If the state is false, the toolbar is invisible.

STATE_ProjectPaneVisible

public static BrowserStateAction STATE_ProjectPaneVisible

The state 'ProjectPaneVisible' controls the visible state of this Browser's ProjectView. If the state is true, the ProjectView is visible. If the state is false, the ProjectView is invisible.


STATE_ContentPaneVisible

public static BrowserStateAction STATE_ContentPaneVisible

The state 'ContentPaneVisible' controls the visible state of this Browser's ContentManager. If the state is true, the ContentManager is visible. If the state is false, the ContentPane is invisible.


STATE_StructurePaneVisible

public static BrowserStateAction STATE_StructurePaneVisible

The state 'StructurePaneVisible' controls the visible state of this Browser's StructureView. If the state is true, the StructureView is visible. If the state is false, the StructureView is invisible.


ACTION_ToggleCurtain

public static BrowserAction ACTION_ToggleCurtain

STATE_MessagePaneVisible

public static BrowserStateAction STATE_MessagePaneVisible

The state 'MessagePaneVisible' controls the visible state of this Browser's MessageView. If the state is true, the MessageView is visible. If the state is false, the MessageView is invisible.


STATE_StatusPaneVisible

public static BrowserStateAction STATE_StatusPaneVisible
The state 'StatusPaneVisible' controls the visible state of this Browser's StatusView. If the state is true, the StatusView is visible. If the state is false, the StatusView is invisible.

DELEGATE_Undo

public static DelegateAction DELEGATE_Undo

DELEGATE_Redo

public static DelegateAction DELEGATE_Redo

DELEGATE_Cut

public static DelegateAction DELEGATE_Cut

DELEGATE_Copy

public static DelegateAction DELEGATE_Copy

DELEGATE_Paste

public static DelegateAction DELEGATE_Paste

DELEGATE_Delete

public static DelegateAction DELEGATE_Delete

DELEGATE_SelectAll

public static DelegateAction DELEGATE_SelectAll

DELEGATE_SearchFind

public static DelegateAction DELEGATE_SearchFind

DELEGATE_SearchReplace

public static DelegateAction DELEGATE_SearchReplace

DELEGATE_SearchAgain

public static DelegateAction DELEGATE_SearchAgain

DELEGATE_SearchIncremental

public static DelegateAction DELEGATE_SearchIncremental

DELEGATE_ContextMenu

public static DelegateAction DELEGATE_ContextMenu

DELEGATE_Refresh

public static DelegateAction DELEGATE_Refresh

ACTION_ToolBarShowAll

public static BrowserAction ACTION_ToolBarShowAll

ACTION_ToolBarHideAll

public static BrowserAction ACTION_ToolBarHideAll

GROUP_ToolBars

public static ActionGroup GROUP_ToolBars

GROUP_OpenBrowsers

public static ActionGroup GROUP_OpenBrowsers

GROUP_NodeOpen

public static ActionGroup GROUP_NodeOpen

GROUP_Reopen

public static final ActionGroup GROUP_Reopen

ACTION_EditProjectProperties

public static BrowserAction ACTION_EditProjectProperties
The static action 'EditProjectProperties' displays the PropertyDialog to the user for the active project's settings.

ACTION_EditDefaultProjectProperties

public static BrowserAction ACTION_EditDefaultProjectProperties
The static action 'EditDefaultProjectProperties' displays the PropertyDialog to the user for default project settings.
Constructor Detail

Browser

public Browser()
Constructs a new Browser window.
Method Detail

getBrowserCount

public static int getBrowserCount()
Returns the count of Browsers in this JBuilder session.
Returns:
An int representing the count of Browsers in this JBuilder session.

getBrowsers

public static Browser[] getBrowsers()
Returns a Browser array in the correct Z order (order of activation), with the most recently active Browser first.
Returns:
An array of Browsers in this JBuilder session.

getBrowsersNonZ

public static Browser[] getBrowsersNonZ()
Returns a Browser array in the non-Z order (order of creation), with the most recently created Browser last.
Returns:
An array of Browsers in this JBuilder session.

getActiveBrowser

public static Browser getActiveBrowser()

Returns the active (most recently activated) Browser in this JBuilder session.

Typically, if a sub-system requires a Browser, it will have been initialized with access to the specific Browser, and should use that instance rather than calling this method.

Returns:
The active (most rectently activated) Browser in this JBuilder session, or null if no Browser windows are open.

registerNodeViewerFactory

public static void registerNodeViewerFactory(NodeViewerFactory factory)

Registers a NodeViewerFactory class for displaying Node contents. This NodeViewerFactory will be added to the end of the cannonical listing of all NodeViewerFactories - thus will display as the last tab (as of yet).

Parameters:
factory - The NodeViewerFactory to register.

registerNodeViewerFactory

public static void registerNodeViewerFactory(NodeViewerFactory factory,
                                             boolean asFirst)

Registers a NodeViewerFactory class for displaying Node contents. If the 'asFirst' paramter is set to true, this NodeViewerFactory will be inserted at the beginning of the cannonical listing of all NodeViewerFactories - thus will display as the first tab (as of yet). If the 'asFirst' parameter is false, the NodeViewerFactory will be added to the end of the list.

Parameters:
factory - The NodeViewerFactory to register.
asFirst - True if the NodeViewerFactory is to be put at the beginning of the cannonical listing, false if at the end.

findBrowser

public static Browser findBrowser(java.lang.Object source)
Walks up the containership hierarchy to try to find a Browser instance from the passed Object (if the passed Object is a Component).
Parameters:
source - The Object source to try to find an associated Browser instance for. This is typically an event object's source: as in e.getSource().

setBrowserTitle

public static void setBrowserTitle(java.lang.String title)
Sets the browser title. When a node is active this will appear before a dash followed by the node's longDisplayName.
Parameters:
title - The browser title

getBrowserTitle

public static java.lang.String getBrowserTitle()
Returns the browser title. This is the text that appears before the dash when a node is open in the browser.
Returns:
The browser title

setDefaultProjectUrl

public static void setDefaultProjectUrl(Url url)
Sets the default project's url.
Parameters:
url - The new default project url

getDefaultProjectUrl

public static Url getDefaultProjectUrl()
Returns a Url pointing to the Default project.
Returns:
A com.borland.primetime.vfs.Url pointing at the Default project.

getDefaultProject

public static Project getDefaultProject()
Returns the Default project.
Returns:
A com.borland.primetime.node.Project representing the Default project.

setIDELookAndFeelClassName

public static void setIDELookAndFeelClassName(java.lang.String className)
Sets the LookAndFeel for the whole JBuilder IDE (Browsers and all other addins).
Parameters:
className - A String representing the class name of the LookAndFeel For example, "javax.swing.plaf.motif.MotifLookAndFeel"

getIDELookAndFeelClassName

public static java.lang.String getIDELookAndFeelClassName()
Returns the class name of the IDE's active LookAndFeel.
Returns:
A String representing the full class name of the IDE's active LookAndFeel. For example, "javax.swing.plaf.motif.MotifLookAndFeel".

getLastOpenedUrl

public Url getLastOpenedUrl()
Returns the last opened url address.

setLastOpenedUrl

public void setLastOpenedUrl(Url url)
Sets the last opened url address.

getLastDirectory

public static java.io.File getLastDirectory()

setLastDirectory

public static void setLastDirectory(java.io.File file)
Sets the last visited directory.

clipPath

public static java.lang.String clipPath(java.awt.FontMetrics fm,
                                        java.lang.String text,
                                        int width)
Clips a file path as needed in the middle to fit the given width.

clipPath

public static java.lang.String clipPath(java.lang.String text)

openProjectFile

public void openProjectFile()

openFile

public void openFile(boolean add2Proj)

doOpen

public void doOpen(java.io.File openedFile,
                   boolean add2Proj)

setToolBarPaneVisible

public void setToolBarPaneVisible(boolean visible)
Hides/shows this browser's toolbar pane.
Parameters:
visible - true for visible, false for invisible

isToolBarPaneVisible

public boolean isToolBarPaneVisible()
Returns this browser toolbar pane's visible state.
Returns:
true if the toolbar is visible, false if not

setProjectPaneVisible

public void setProjectPaneVisible(boolean visible)
Hides/shows this browser's project pane.
Parameters:
visible - true for visible, false for invisible

isProjectPaneVisible

public boolean isProjectPaneVisible()
Returns this browser's project pane's visible state.
Returns:
true if the project pane is visible, false if not

setContentPaneVisible

public void setContentPaneVisible(boolean visible)
Hides/shows this browser's content pane.
Parameters:
visible - true for visible, false for invisible

isContentPaneVisible

public boolean isContentPaneVisible()
Returns this browser's content pane's visible state.
Returns:
true if the content pane is visible, false if not

setStructurePaneVisible

public void setStructurePaneVisible(boolean visible)
Hides/shows this browser's structure pane.
Parameters:
visible - true for visible, false for invisible

isStructurePaneVisible

public boolean isStructurePaneVisible()
Returns this browser's structure pane's visible state.
Returns:
true if the structure pane is visible, false if not

toggleCurtain

public void toggleCurtain()
Toggles the project/structure left pane visible/invisible.

setMessagePaneVisible

public void setMessagePaneVisible(boolean visible)
Hides/shows this browser's message pane.
Parameters:
visible - true for visible, false for invisible

isMessagePaneVisible

public boolean isMessagePaneVisible()
Returns this browser's message pane's visible state.
Returns:
true if the message pane is visible, false if not

setStatusPaneVisible

public void setStatusPaneVisible(boolean visible)
Hides/shows this browser's status pane.
Parameters:
visible - true for visible, false for invisible

isStatusPaneVisible

public boolean isStatusPaneVisible()
Returns this browser's status pane's visible state.
Returns:
true if the status pane is visible, false if not

getNavigationHistoryCount

public int getNavigationHistoryCount()

getNavigationIndex

public int getNavigationIndex()

getNavigationHistory

public Node getNavigationHistory(int index)

getNavigationHistory

public Node[] getNavigationHistory()

navigateTo

public void navigateTo(int index)
                throws java.lang.Exception

navigateTo

public void navigateTo(Node node)
                throws java.lang.Exception
Effectively a 'drill-in'. This changes the active node in the browser, and pushes the passed node onto the history stack.
Parameters:
node - The node to navigate to (push onto the history stack)
Throws:
Several - exceptions can be thrown if there is a problem moving to the specified node

canNavigateForward

public boolean canNavigateForward()
Returns true if there are items in the navigation stack beyond the current item.
Returns:
true if the current navigation stack pointer is not at the end of the navigation stack

navigateForward

public void navigateForward()
                     throws java.lang.Exception
Moves the active node to the next node in the navigation stack (if the navigation stack pointer is not at the end).
Throws:
Several - exceptions can be thrown if there is a problem moving to the specified node

canNavigateBack

public boolean canNavigateBack()
Returns true if the navigation stack pointer is not at the beginning of the navigation stack.
Returns:
true if the navigation pointer is not at the beginning of the stack

navigateBack

public void navigateBack()
                  throws java.lang.Exception
Moves the active node to the previous node in the navigation stack (if the navigation stack pointer is not at the beginning).
Throws:
Several - exceptions can be thrown if there is a problem moving to the specified node

navigateHome

public void navigateHome()
                  throws java.lang.Exception
Moves the active node to the first node in the navigation stack (if the navigation stack pointer is not at the beginning).
Throws:
Several - exceptions can be thrown if there is a problem moving to the specified node

getMenuGroupCount

public static int getMenuGroupCount()
Returns the static count of ActionGroups that appear in all Browser menus.
Returns:
An int representing the count of static menu groups

getMenuGroup

public static ActionGroup getMenuGroup(int index)
Returns the menu ActionGroup at the specied index.
Parameters:
index - The index of the desired menu group
Returns:
The menu ActionGroup at the specified index

getMenuGroups

public static ActionGroup[] getMenuGroups()
Returns the static list of ActionGroups that appear in all Browser menus.
Returns:
An array of ActionGroup that are present in all Browser menus.

addMenuGroup

public static void addMenuGroup(ActionGroup group)
Adds an ActionGroup to the end of the static list of ActionGroups that will appear in all subsequently created Browser window menus.
Parameters:
group - The ActionGroup to add to the static list of menus.

addMenuGroup

public static void addMenuGroup(int index,
                                ActionGroup group)
Inserts an ActionGroup into the static list of ActionGroups at the specified index. The inserted ActionGroup will appear in all subsequently created Browser window menus.
Parameters:
group - The ActionGroup to insert into the static list of menus.

removeMenuGroup

public static void removeMenuGroup(ActionGroup group)
Removes an ActionGroup from the static list of ActionGroups that appear in all subsequently created Browser window menus.
Parameters:
group - The ActionGroup to remove from the static list of menus.

getToolBarPane

public BrowserToolBarPane getToolBarPane()
Returns this browser's BrowserToolBarPane instance.
Returns:
This browser's BrowserToolBarPane instance

getToolBarGroupCount

public static int getToolBarGroupCount()
Returns the count of static Browser toolbars.
Returns:
An int representing the count of static Browser toolbars.

getToolBarGroup

public static ActionGroup getToolBarGroup(int index)
Returns the toolbar ActionGroup at the specied index.
Parameters:
index - The index of the desired toolbar group
Returns:
The toolbar ActionGroup at the specified index

getToolBarGroups

public static ActionGroup[] getToolBarGroups()
Returns the static list of ActionGroups that appear in all Browser toolbars.
Returns:
An array of ActionGroup that are present in all Browser toolbars.

addToolBarGroup

public static void addToolBarGroup(ActionGroup group)
Adds an ActionGroup to the end of the static list of ActionGroups that will appear in all subsequently created Browser window toolbars.
Parameters:
group - The ActionGroup to add to the static list of toolbars.

addToolBarGroup

public static void addToolBarGroup(int index,
                                   ActionGroup group)
Inserts an ActionGroup into the static list of toolbar ActionGroups at the specified index. The inserted ActionGroup will appear in all subsequently created Browser window toolbars.
Parameters:
group - The ActionGroup to insert into the static list of toolbars.

removeToolBarGroup

public static void removeToolBarGroup(ActionGroup group)
Removes an ActionGroup from the static list of ActionGroups that appear in all subsequently created Browser window toolbars.
Parameters:
group - The ActionGroup to remove from the static list of toolbars.

waitMessage

public void waitMessage(java.lang.String title,
                        java.lang.String text)
Displays an information window centered on the screen with the specified title and text messages. Passing two nulls or two empty strings will hide the message window. This should be called subsystems when they are about to perform an operation that will take a bit of time to complete. This message is to inform the user that a pause will occur - and to provide information as to when the pause will end...
Parameters:
title - The title to display in the mesage window
text - The message text to display in the message window

delayWaitMessage

public void delayWaitMessage(int delay,
                             java.lang.String title,
                             java.lang.String text)
Displays an information window centered on the screen with the specified title and text messages - after the specified delay (ms) has passed. This should be called subsystems when they are about to perform an operation that *may* take a bit of time to complete. If the clearMessages method is called before the delay has elapsed, no message will be shown. This message is to inform the user why the pause is occurring - and to provide information as to when the pause will end...
Parameters:
delay - The time (ms) to wait before displaying the message window
title - The title to display in the mesage window
text - The message text to display in the message window

clearWaitMessages

public void clearWaitMessages()
Hides the message window, and kills any delayed messages that may still be in the queue.

getProjectView

public ProjectView getProjectView()
Returns this Browser's ProjectView instance.

setActiveProject

public void setActiveProject(Project project)
                      throws java.lang.Exception

getActiveProject

public Project getActiveProject()

closeProject

public void closeProject(Project project)
                  throws java.lang.Exception

getOpenNodeCount

public int getOpenNodeCount()
Returns the count of open Nodes in this Browser. This is the number of tabs currently showing in the ContentManager.
Returns:
An int representing the count of open Nodes in this Browser.

getOpenNodes

public Node[] getOpenNodes()
Returns the open Nodes in this Browser. These are the Nodes currently displaying on tabs in the ContentManager.
Returns:
An array of Nodes opened in this Browser.

getAllOpenNodes

public static Node[] getAllOpenNodes()
Returns all the open Nodes in all Browsers. These are the Nodes currently displaying on tabs in the ContentManager in each of the open Browsers.
Returns:
An array of all the opened Nodes from all Browsers.

isOpenNode

public boolean isOpenNode(Node node)
Returns true if the passed node is currently being displayed in this Browser.
Parameters:
node - The Node to check
Returns:
true if the Node is opened in this Browser, false if not.

setActiveNode

public void setActiveNode(Node node,
                          boolean requestFocus)
                   throws java.lang.Exception

Sets the 'active' open Node in this Browser. If the passed Node already exists in the set of opened Nodes, it will be activated as the active open node. If the passed Node is not in the opened list, it will be opened, activated, and added to the list.

Note that if the passed Node is not already the active Node in this Browser, calling this method will trigger several Browser events:

  1. browserNodeChanging(...)
  2. browserViewerChanging(...)
  3. browserNodeChanged(...)
  4. browserViewerChanged(...)
It will also potentially trigger several methods on the NodeViewer interface (could be all of them if the Node is being loaded for the first time).
Parameters:
node - The Node to set as the active Node in this Browser.
Throws:
java.lang.Exception - A myriad of different exceptions can be thrown when setting the active Node, including VetoException (if a BrowserListener doesn't want the Node or the viewer to change, or if a NodeViewer doesn't want the viewer to change). Any number of IOExceptions or Node exceptions can be thrown if the Node is being opened for the first time.

getActiveNode

public Node getActiveNode()
Returns the active Node in this Browser. This is the tab currently showing in the ContentManager.
Returns:
The active Node displaying in this Browser, or null if zero Nodes are open.

closeNode

public void closeNode(Node node)
               throws java.lang.Exception

Closes the specified Node and removes it from this Browser's ContentManager.

This method will check if the Node has been modified. If it has, the user will be prompted to save changes. The user will be given the option to save, not save (revert), or cancel. Choosing save will save the changes to the Node before closing. Choosing not to save will revert the Node before closing (this is important if the Node's Buffer is being displayed in another Node - in this Browser or perhaps another). Choosing cancel will stop the whole process and the Node will not save, revert, or close.

Note that if the passed Node is the active Node in this ContentManager, calling this method will trigger several Browser events:

  1. browserProjectChanging(...)
  2. browserNodeChanging(...)
  3. browserViewerChanging(...)
  4. browserProjectChanged(...)
  5. browserNodeChanged(...)
  6. browserViewerChanged(...)
Parameters:
node - The Node to close and remove from this Browser's ContentManager.
Throws:
java.lang.Exception - A myriad of different exceptions can be thrown when closing a Node, including VetoException (if a BrowserListener doesn't want the active Node or the viewer to change, or if a NodeViewer doesn't want the viewer to change). Any number of IOExceptions or Node exceptions can be thrown if the Node is modified, and there are troubles saving it.

closeNodes

public void closeNodes(Node[] nodes)
                throws java.lang.Exception

Closes the specified list of Nodes and removes them from this Browser's ContentManager.

This method will check if the Nodes have been modified. The user will be prompted to save changes to modified nodes in a grouped dialog. The user will be given the option to save or not save (revert) each node, or to cancel the close operation. Selecting save for each node will save the changes to the Node before closing. Choosing not to save will revert the Node before closing (this is important if the Node's Buffer is being displayed in another Node - in this Browser or perhaps another). Choosing cancel will stop the whole process and none of the Nodes will be saved, reverted, or closed.

Note that if one of the passed Nodes is the active Node in this ContentManager, calling this method will trigger several Browser events:

  1. browserProjectChanging(...)
  2. browserNodeChanging(...)
  3. browserViewerChanging(...)
  4. browserProjectChanged(...)
  5. browserNodeChanged(...)
  6. browserViewerChanged(...)
Parameters:
nodes - The array of Nodes to close and remove from this Browser's ContentManager.
Throws:
java.lang.Exception - A myriad of different exceptions can be thrown when closing a Node, including VetoException (if a BrowserListener doesn't want the active Node or the viewer to change, or if a NodeViewer doesn't want the viewer to change). Any number of IOExceptions or Node exceptions can be thrown if the Node is modified, and there are troubles saving it.

nextOpenNode

public void nextOpenNode(boolean requestFocus)
                  throws java.lang.Exception
Sets the next node as the active node in this Browser window. Node order is determined by the metaphor of the ContentManager (tabbed or MDI).
Parameters:
requestFocus - True to set focus on the next node, false to move without changing focus

previousOpenNode

public void previousOpenNode(boolean requestFocus)
                      throws java.lang.Exception
Sets the previous node as the active node in this Browser window. Node order is determined by the metaphor of the ContentManager (tabbed or MDI).
Parameters:
requestFocus - True to set focus on the privious node, false to move without changing focus

doSaveAll

public void doSaveAll(boolean checked)
               throws VetoException
Scans entire PrimeTime environment for modified buffers and projects and optionally presents a list of these to the user (if checked flag is true) to select which ones to save. Any unchecked files will be reverted.
Parameters:
checked - If true, a dialog will be presented to the user to select which files are to be saved.
Throws:
VetoException - If the user selects Cancel or if there is a problem while saving

doSaveChecked

public void doSaveChecked(Node[] nodes)
                   throws VetoException
Presents the specified list of nodes in a save dialog for the user to select which ones they want to save. Any unchecked nodes will be reverted.
Parameters:
nodes - An array of Nodes to present to the user
Throws:
VetoException - if the user clicks the Cancel button on the save dialog

doSave

public void doSave(Node[] nodes)
            throws VetoException
Scans and attempts to save each of the UrlNode instances in the passed array. See the doSave(UrlNode) method for a description of the possible dialogs that may display during the save process.
Parameters:
nodes - An array of nodes to attempt to save
Throws:
VetoException - if the user clicks on cancel in any of the many possible resulting dialogs

doSaveChecked

public void doSaveChecked(UrlNode urlNode)
                   throws java.lang.Exception
Queries the user if they want to save the specified UrlNode. If they do, doSave(UrlNode) method is called passing the specified node. If not, the UrlNode is reverted.
Parameters:
urlNode - The node to save or revert as the user specifies
Throws:
java.lang.Exception - See doSave(UrlNode) to see the exception types

doSave

public void doSave(UrlNode urlNode)
            throws java.lang.Exception
Saves the specified UrlNode - or if it is a new node, doSaveAs(UrlNode) is called passing the specified node.
Parameters:
urlNode - The node to save
Throws:
Any - of several exceptions if the save process fails

doSaveAs

public void doSaveAs(UrlNode urlNode)
              throws java.lang.Exception
Saves the specifed UrlNode as specified by the user.
Parameters:
urlNode - The node to save as
Throws:
java.lang.Exception - Several exceptions can be thrown by the saveAs operation

doRevert

public void doRevert(Node[] nodes)
Scans the array of nodes and calls doRevert(UrlNode) on all UrlNode instances in the array.
Parameters:
nodes - The array of nodes to revert

doRevert

public void doRevert(UrlNode urlNode)
              throws java.lang.Exception
Reverts the specified UrlNode.
Parameters:
urlNode - The node to revert
Throws:
java.lang.Exception - Several exceptions can be thrown by attempting to revert a node

doRename

public void doRename(Node node)
              throws java.lang.Exception
Checks the specified node to see if it is an instance of UrlNode or a LightweightNode, and calls doRenameUrlNode(UrlNode) or doRenameLightweightNode(LightweightNode) respectively.
Parameters:
node - The node to rename
Throws:
java.lang.Exception - the rename process can throw several exceptions

doRenameUrlNode

public void doRenameUrlNode(UrlNode urlNode)
                     throws java.lang.Exception
Renames the specified UrlNode to a user specified name.
Parameters:
urlNode - The node to rename
Exception - several exceptions can be thrown when renaming a node

doRenameLightweightNode

public void doRenameLightweightNode(LightweightNode liteNode)
Renames the specified LightweightNode to a user specified name.
Parameters:
liteNode - The node to rename

checkExtension

public static java.io.File checkExtension(UrlNode urlNode,
                                          java.io.File file)
Checks the node type extension against the selected file. If no extension is specified, a new file is created with the correct extension. If any extension is detected on the file, it is returned (and may fail at a later time - when the user will be notified).

checkOverwrite

public boolean checkOverwrite(java.lang.String fileName)
                       throws VetoException
Checks if the user wishes to overwrite the specified file. Returns true for yes, false for no, or throws a VetoExcpetion for cancel.

showIllegalFileNameWarning

public void showIllegalFileNameWarning(java.lang.String fileName)
Alerts the user that the passed filename is invalid.

canDisplayNode

public static boolean canDisplayNode(Node node)

Returns the count of NodeViewers that have 'accepted' the specified Node, and are available to display the contents of the Node in the ContentView. This is the number of tabs showing along the bottom of the ContentView for the specified Node.

NOTE: If the passed Node is in the ContentManager's opened list, zero is silently returned. Be sure the Node in question is actually opened before checking the number of Viewers it has.

Parameters:
node - The Node to get the count of NodeViewers for.
Returns:
An int representing the count of NodeViewers for the specified Node.

getViewerOfType

public NodeViewer getViewerOfType(Node node,
                                  java.lang.Class clazz)

Returns the first NodeViewer instance of the specified type that have is displaying the specified Node. This is one of the tabs showing along the bottom of the ContentView for the specified Node.

NOTE: If the passed Node is in the ContentManager's opened list, null is returned. Be sure the Node in question is actually opened before retrieving a NodeViewer.

Parameters:
node - The Node to get the NodeViewer for
clazz - The type (java.lang.Class) of NodeViewer to return
Returns:
The first NodeViewer instance of the specified type displaying the node, or null if the NodeViewer is there is no instance of the specified type displaying the node.

getViewerCount

public int getViewerCount(Node node)

Returns the count of NodeViewers that have 'accepted' the specified Node, and are available to display the contents of the Node in the ContentView. This is the number of tabs showing along the bottom of the ContentView for the specified Node.

NOTE: If the passed Node is in the ContentManager's opened list, zero is silently returned. Be sure the Node in question is actually opened before checking the number of Viewers it has.

Parameters:
node - The Node to get the count of NodeViewers for.
Returns:
An int representing the count of NodeViewers for the specified Node.

getViewers

public NodeViewer[] getViewers(Node node)

Returns the NodeViewers that have 'accepted' the specified Node, and are available to display the contents of the Node in the ContentView. These are the tabs showing along the bottom of the ContentView for the specified Node.

NOTE: If the passed Node is not in the ContentManager's opened list, a zero-length array is silently returned. Be sure the Node in question is actually opened before retrieving its NodeViewers.

Parameters:
node - The Node to retrieve the NodeViewers for.
Returns:
An array of NodeViewer that are acting as viewers for the specified Node.

setActiveViewer

public void setActiveViewer(Node node,
                            NodeViewer viewer,
                            boolean requestFocus)
                     throws java.lang.Exception

Sets the active NodeViewer for the specified Node.

NOTE: If the passed Node is not opened in this Browser, calling this method will fire an AssertionException. A few Browser events will be triggered:

  1. browserViewerChanging(...)
  2. browserViewerChanged(...)
It will also trigger several methods on the NodeViewer interface (could be all of them if the Node is being displayed with a specific NodeViewer for the first time).
Parameters:
node - The Node to set the specified NodeViewer on
viewer - The NodeViewer to display the specified node with
requestFocus - True for the NodeViewer to request focus once activated
Throws:
java.lang.Exception - A few exceptions can be thrown when setting the active NodeViewer, including VetoException (if a BrowserListener doesn't want the viewer to change, or if a NodeViewer doesn't want the viewer to change). An AssertionException can be thrown if the specified Node is not currently opened in this Browser, or if the NodeViewer is not a valid selection for the specified Node.

getActiveViewer

public NodeViewer getActiveViewer(Node node)
Returns the active NodeViewer for the specified Node in this Browser. This is the tab currently showing in the Node's ContentView.
Returns:
The active NodeViewer displaying the contents of the specified Node.

getMessageView

public MessageView getMessageView()
Returns this Browser's MessageView instance.

getStatusView

public StatusView getStatusView()
Returns this Browser's StatusView instance.

getContentManager

public ContentManager getContentManager()
Returns this Browser's ContentManager instance.

addBrowserListener

public void addBrowserListener(BrowserListener l)
Adds a BrowserListener to listen to Browser events from this Browser.
Parameters:
l - The BrowserListener implementation to add the listener list.

removeBrowserListener

public void removeBrowserListener(BrowserListener l)
Removes a BrowserListener from this Browser.
Parameters:
l - The BrowserListener implementation to remove from listener list.

addStaticBrowserListener

public static void addStaticBrowserListener(BrowserListener l)
Adds a BrowserListener to listen to Browser events from *ALL* existing Browsers.
Parameters:
l - The BrowserListener implementation to add the listener list.

removeStaticBrowserListener

public static void removeStaticBrowserListener(BrowserListener l)
Removes a BrowserListener from the static listener list.
Parameters:
l - The BrowserListener implementation to remove from listener list.

fireBrowserOpened

protected void fireBrowserOpened()
The 'browserOpened' event is fired when a Browser is opened for the first time. This event is only fired once per Browser.

fireBrowserActivated

protected void fireBrowserActivated()
The 'browserActivated' event is fired each time the Browser window is activated - by switching to this Browser from another Browser, or by switching to this Browser from another application.

fireBrowserDeactivated

protected void fireBrowserDeactivated()
The 'browserDeactivated' event is fired each time the Browser window is deactivated - by switching to another Browser, or by switching to another application.

fireBrowserClosing

protected void fireBrowserClosing()
                           throws VetoException
The 'browserClosing' event is fired when the Browser is attempting to close. Listeners can throw a VetoException if they don't want the Browser to close, and it will remain open.
Throws:
VetoException - A listener might throw a VetoException to stop the Browser from closing.

fireBrowserClosed

protected void fireBrowserClosed()
The 'browserClosed' event is fired when a Browser is finally closed. This event is only fired once per Browser. Note that this is a notification event, and that listeners cannot do anything to stop the Browser from closing at this point.

fireBrowserProjectActivated

protected void fireBrowserProjectActivated(Project project)
The 'browserProjectActivated' event is fired when the 'active' Project in the Browser has changed - ie. the user has selected a different Project.
Parameters:
project - The Browser's new 'active' Project. MAY BE NULL!

fireBrowserProjectClosed

protected void fireBrowserProjectClosed(Project project)
The 'browserProjectClosed' event is fired when a Project in the Browser is closed.
Parameters:
project - The project that closed.

fireBrowserNodeActivated

protected void fireBrowserNodeActivated(Node node)
The 'browserNodeActivated' event is fired when the 'active' Node in the Browser has changed - ie. the opened Node has switched.
Parameters:
node - The Browser's new 'active' Node. MAY BE NULL!

fireBrowserNodeClosed

protected void fireBrowserNodeClosed(Node node)
The 'browserNodeClosed' event is fired when a Node in the Browser is closed.
Parameters:
node - The node that closed.

fireBrowserViewerActivated

protected void fireBrowserViewerActivated(Node node,
                                          NodeViewer viewer)
The 'browserViewerActivated' event is fired when the 'active' Node in the Browser's 'active' NodeViewer has changed - ie. the user has switched from the Source tab to the Design tab.
Parameters:
node - The Node whose NodeViewer has changed.
viewer - The Node's new 'active' NodeViewer.

fireBrowserViewerDeactivating

protected void fireBrowserViewerDeactivating(Node node,
                                             NodeViewer viewer)
                                      throws VetoException
The 'browserViewerDeactivating' event is fired when the active Node's viewer is changing - ie. the user is switching from the Source to the Design tab. Listeners can throw a VetoException if they don't want the Viewer to switch, and it will remain on the NodeViewer.
Parameters:
node - The Node whose viewer is changing.
viewer - The Node's active NodeViewer.
Throws:
VetoException - A listener might throw a VetoException to stop the active NodeViewer from changing.

close

public void close()
           throws java.lang.Exception
Closes this Browser window and saves any modified files.

setBounds

public void setBounds(java.awt.Rectangle b)
Overrides:
setBounds in class java.awt.Component

addButton

public void addButton(ActionButton button)

removeButton

public void removeButton(ActionButton button)