com.borland.primetime.ide
Class ProjectView

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.borland.primetime.ide.ProjectView

public class ProjectView
extends javax.swing.JPanel

The ProjectView (one instance per Browser) is effectively a display of the Node system in JBuilder. Multiple Projects can be displayed in the ProjectView, with only one being 'active' at a given time.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static BrowserAction ACTION_ActivateNode
          The action 'ViewNode' opens the Node in the Browser window.
static BrowserAction ACTION_ContextMenu
           
static BrowserAction ACTION_FileAdd
          Displays a FileChooser dialog allowing the user to select a file to open.
static BrowserAction ACTION_ProjectCloseActive
          Closes the active Project, and saves it if it has been modified.
static BrowserAction ACTION_ProjectNodeDelete
          Deletes the selected files and removes Node from its Project.
static BrowserAction ACTION_ProjectNodeRemove
          Removes the selected Node from its Project.
static BrowserAction ACTION_ProjectRefresh
           
static com.borland.primetime.ide.ProjectView.ProjectTree.ProjectTreeNode[] EMPTY_PTNODE_ARRAY
           
 ActionGroup GROUP_OpenProjects
           
static ActionGroup GROUP_ProjectNodeAdd
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Method Summary
 void addFile()
           
 void closeProject(Project project)
          Closes a Project (and all opened Nodes from the Project) from this ProjectView.
 Project getActiveProject()
          Returns the 'active' Project of this ProjectView.
 java.awt.Dimension getMinimumSize()
           
static int getModifiedProjectCount()
          Returns the count of open *modified* projects.
static Project getOpenProject(int index)
          Returns the open project at the specified index.
static int getOpenProjectCount()
          Returns the count of open projects.
static Project[] getOpenProjects()
          Returns the list of open projects as an array.
 Node getSelectedNode()
          Returns the currently selected Node in this ProjectView.
 Node getSelectedNode(Project project)
          Returns the currently selected Node in this ProjectView.
 Node[] getSelectedNodes()
          Returns the currently selected Nodes in this ProjectView.
 Node[] getSelectedNodes(Project project)
          Returns the currently selected Nodes in this ProjectView from the specified project.
 boolean isVisible()
           
 void refreshTree()
           
 void refreshTree(Project project)
           
static void registerContextActionProvider(ContextActionProvider provider)
           
 void setActiveProject(Project project)
          Sets the 'active' Project in this ProjectView.
 void setSelectedNode(Node node)
           
 void setSelectedNodes(Project project, Node[] nodes)
           
 void showNode(Node node)
           
 void updateUI()
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ACTION_ProjectRefresh

public static BrowserAction ACTION_ProjectRefresh

ACTION_ActivateNode

public static BrowserAction ACTION_ActivateNode
The action 'ViewNode' opens the Node in the Browser window.

ACTION_FileAdd

public static BrowserAction ACTION_FileAdd
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_ContextMenu

public static BrowserAction ACTION_ContextMenu

GROUP_ProjectNodeAdd

public static ActionGroup GROUP_ProjectNodeAdd

ACTION_ProjectNodeRemove

public static BrowserAction ACTION_ProjectNodeRemove
Removes the selected Node from its Project. If it has been modified, it will be prompted for changes.

ACTION_ProjectNodeDelete

public static BrowserAction ACTION_ProjectNodeDelete
Deletes the selected files and removes Node from its Project.

ACTION_ProjectCloseActive

public static BrowserAction ACTION_ProjectCloseActive
Closes the active Project, and saves it if it has been modified.

GROUP_OpenProjects

public ActionGroup GROUP_OpenProjects

EMPTY_PTNODE_ARRAY

public static com.borland.primetime.ide.ProjectView.ProjectTree.ProjectTreeNode[] EMPTY_PTNODE_ARRAY
Method Detail

getOpenProjectCount

public static int getOpenProjectCount()
Returns the count of open projects.

getModifiedProjectCount

public static int getModifiedProjectCount()
Returns the count of open *modified* projects.

getOpenProject

public static Project getOpenProject(int index)
Returns the open project at the specified index.

getOpenProjects

public static Project[] getOpenProjects()
Returns the list of open projects as an array.

setActiveProject

public void setActiveProject(Project project)
                      throws java.lang.Exception
Sets the 'active' Project in this ProjectView. If the passed Project is already open in this ProjectView, it is made the 'active' Project. If the passed Project is not already open in this ProjectView, it is first opened and then made the 'active' Project.

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

  1. browserProjectChanging(...)
  2. browserNodeChanging(...)
  3. browserViewerChanging(...)
  4. browserProjectChanged(...)
  5. browserNodeChanged(...)
  6. browserViewerChanged(...)
Parameters:
project - The Project to active in this ProjectView.
Throws:
java.lang.Exception - A myriad of different exceptions can be thrown when setting the active Project, including VetoException (if a BrowserListener doesn't want the Project, 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 Project is being opened for the first time.

getActiveProject

public Project getActiveProject()
Returns the 'active' Project of this ProjectView. This value will be null if no Projects are opened.
Returns:
The 'active' Project of this ProjectView. MAY BE NULL!

setSelectedNode

public void setSelectedNode(Node node)

showNode

public void showNode(Node node)

setSelectedNodes

public void setSelectedNodes(Project project,
                             Node[] nodes)

getSelectedNode

public Node getSelectedNode()
Returns the currently selected Node in this ProjectView. This value will be null if no Nodes are selected.
Returns:
The selected Node in this ProjectView. MAY BE NULL!

getSelectedNode

public Node getSelectedNode(Project project)
Returns the currently selected Node in this ProjectView. This value will be null if no Nodes are selected.
Parameters:
project - The project to return the selected node from
Returns:
The selected Node in this ProjectView. MAY BE NULL!

getSelectedNodes

public Node[] getSelectedNodes()
Returns the currently selected Nodes in this ProjectView.
Returns:
The selected Nodes in this ProjectView.

getSelectedNodes

public Node[] getSelectedNodes(Project project)
Returns the currently selected Nodes in this ProjectView from the specified project.
Parameters:
project - The project to retrieve the selected nodes from
Returns:
The selected Nodes in this ProjectView.

refreshTree

public void refreshTree()

refreshTree

public void refreshTree(Project project)

closeProject

public void closeProject(Project project)
                  throws java.lang.Exception
Closes a Project (and all opened Nodes from the Project) from this ProjectView.
Parameters:
project - The Project to close
Throws:
java.lang.Exception - A myriad of different exceptions can be thrown when closing a Project, including VetoException (if a BrowserListener doesn't want the Project, 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 during the Node save/close process.

addFile

public void addFile()

registerContextActionProvider

public static void registerContextActionProvider(ContextActionProvider provider)

isVisible

public boolean isVisible()
Overrides:
isVisible in class java.awt.Component

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class javax.swing.JComponent

updateUI

public void updateUI()
Overrides:
updateUI in class javax.swing.JPanel