org.sourcejammer.client.plugin
Interface GUIContext

All Known Implementing Classes:
GUIContextImpl

public interface GUIContext

Title: $FileName: GUIContext.java$

Version:
$VerNum: 5$
Author:
$AuthorName: Rob MacGrogan$

$Description: $
$KeyWordsOff: $ Represents the context of the SJ GUI client. Contains useful methods for intereacting with and getting information from the GUI.

Method Summary
 void displayErrorMessage(java.lang.String message)
          Defaults eventThread to false.
 void displayErrorMessage(java.lang.String[] message)
          Defaults eventThread to false.
 void displayErrorMessage(java.lang.String[] message, boolean eventThread)
          Displays the message in an error dialog.
 void displayErrorMessage(java.lang.String message, boolean eventThread)
          Displays the message in an error dialog.
 SourceVersionChecker getChecker(java.io.File flDirectory)
          Returns a SourceVersionChecker for the specified directory.
 int getClientDefaultEOLType()
          Gets the default EOL type for the client from AppConfig.
 ProjectTreeNode getCurrentTreeNode()
          Returns the currently selected project tree node.
 java.lang.String getCurrentUserName()
          Returns the currently logged in user's user name as a String.
 SJPrimaryWindow getMainWindow()
          Returns a reference to the main GUI window.
 java.io.PrintStream getMessageStream()
          Returns the PrintStream that prints out to the message area on the GUI.
 javax.swing.JTable getPrimaryTable()
          Returns a reference to the file table.
 javax.swing.table.TableColumnModel getPrimaryTableColumnModel()
          Returns the TableColumnModel of the file table.
 javax.swing.JTree getProjectTree()
          Returns a reference to the project tree.
 java.lang.String[] getSelectedFileNames()
          Returns names of all files selected in the file table.
 org.sourcejammer.project.view.NodeInfo getSelectedFileNodeInfo()
          Convenience method.
 org.sourcejammer.project.view.NodeInfo[] getSelectedFilesNodeInfo()
          Returns a NodeInfo object for each file selected in the file table.

Note that NodeInfo can be case to FileNodeInfo if you need to figure out local/remote sync state.
 boolean hasLocalFileChanged(java.lang.String fileName, java.io.File flTargetDir)
          Returns true if the file with the name fileName in flTargetDir has changed in the archive since that file was last downloaded to the client.
 boolean isConnected()
          Returns true if the GUI is currently connected to an archive.
 void rebuildFileView()
          Rebuilds the cached file tables starting at the currently selected project tree node.
 void rebuildFileView(boolean fromRoot)
          Rebuilds the cached file tables.
 void selectProject(ProjectTreeNode nd)
          Select the specified project in the project tree.
 

Method Detail

getMainWindow

public SJPrimaryWindow getMainWindow()
Returns a reference to the main GUI window.


getProjectTree

public javax.swing.JTree getProjectTree()
Returns a reference to the project tree.


getPrimaryTable

public javax.swing.JTable getPrimaryTable()
Returns a reference to the file table.


displayErrorMessage

public void displayErrorMessage(java.lang.String message,
                                boolean eventThread)
Displays the message in an error dialog.

Parameters:
message - -- the error message.
eventThread - -- must be true if invoked from the eventThread, and false otherwise. This is tricky. BEFORE_EVENT and AFTER_EVENT timing are in the event thread. BEFORE_REQUEST_SENT and AFTER_RESPONSE_RECEIVED are generally outside of the event thread, but not always.

displayErrorMessage

public void displayErrorMessage(java.lang.String[] message,
                                boolean eventThread)
Displays the message in an error dialog. Each String is treated as a separate line in the dialog.

Parameters:
message - -- the error message.
eventThread - -- must be true if invoked from the eventThread, and false otherwise. This is tricky. BEFORE_EVENT and AFTER_EVENT timing are in the event thread. BEFORE_REQUEST_SENT and AFTER_RESPONSE_RECEIVED are generally outside of the event thread, but not always.

displayErrorMessage

public void displayErrorMessage(java.lang.String[] message)
Defaults eventThread to false.


displayErrorMessage

public void displayErrorMessage(java.lang.String message)
Defaults eventThread to false.


selectProject

public void selectProject(ProjectTreeNode nd)
Select the specified project in the project tree.


isConnected

public boolean isConnected()
Returns true if the GUI is currently connected to an archive.


getChecker

public SourceVersionChecker getChecker(java.io.File flDirectory)
                                throws java.io.IOException
Returns a SourceVersionChecker for the specified directory. SourceVersionChecker is used to determine the version info for the version of a file in the local directory. See API doc on SourceVersionChecker for details.

java.io.IOException

getClientDefaultEOLType

public int getClientDefaultEOLType()
Gets the default EOL type for the client from AppConfig.


getMessageStream

public java.io.PrintStream getMessageStream()
Returns the PrintStream that prints out to the message area on the GUI.


getCurrentTreeNode

public ProjectTreeNode getCurrentTreeNode()
Returns the currently selected project tree node.


getCurrentUserName

public java.lang.String getCurrentUserName()
Returns the currently logged in user's user name as a String.


getPrimaryTableColumnModel

public javax.swing.table.TableColumnModel getPrimaryTableColumnModel()
Returns the TableColumnModel of the file table.


getSelectedFileNames

public java.lang.String[] getSelectedFileNames()
Returns names of all files selected in the file table.


getSelectedFileNodeInfo

public org.sourcejammer.project.view.NodeInfo getSelectedFileNodeInfo()
Convenience method. Returns the "first" file selected in the file table as a NodeInfo object. If only one file is selected, returns that file.

Note that NodeInfo can be case to FileNodeInfo if you need to figure out local/remote sync state.


getSelectedFilesNodeInfo

public org.sourcejammer.project.view.NodeInfo[] getSelectedFilesNodeInfo()
Returns a NodeInfo object for each file selected in the file table.

Note that NodeInfo can be case to FileNodeInfo if you need to figure out local/remote sync state.


hasLocalFileChanged

public boolean hasLocalFileChanged(java.lang.String fileName,
                                   java.io.File flTargetDir)
                            throws java.io.IOException
Returns true if the file with the name fileName in flTargetDir has changed in the archive since that file was last downloaded to the client.

java.io.IOException

rebuildFileView

public void rebuildFileView()
                     throws org.sourcejammer.project.NodeExistsException,
                            java.io.IOException
Rebuilds the cached file tables starting at the currently selected project tree node. Does not involve a server hit.

org.sourcejammer.project.NodeExistsException
java.io.IOException

rebuildFileView

public void rebuildFileView(boolean fromRoot)
                     throws org.sourcejammer.project.NodeExistsException,
                            java.io.IOException
Rebuilds the cached file tables. Does not involve a server hit.

Parameters:
fromRoot - -- if true starts rebuilding from archive root project.
org.sourcejammer.project.NodeExistsException
java.io.IOException


Copyright © 2003 Soucejammer project.