|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.pds.ltdt.gui.util.Utility
public class Utility
Constructor Summary | |
---|---|
Utility()
|
Method Summary | |
---|---|
static java.lang.String |
addCRLF(java.lang.String s)
Add carriage-return (\ |
static java.lang.String |
addLeadingWhiteSpace(java.lang.String string,
int length)
Adds leading whitespaces to a given string |
static java.lang.String |
addQuotes(java.lang.String string)
Add surrounding quotes |
static java.lang.String |
addTrailingWhiteSpace(java.lang.String string,
int length)
|
static javax.swing.JPanel |
createVerticalBoxPanel()
Create a panel to hold components vertically |
static boolean |
dirRWAllowed(java.lang.String dir)
Examine if a directory is read/write permitted |
static java.lang.String |
formatInt(int in,
int targetLength)
|
static java.util.ArrayList |
getKeyList(java.lang.String inFile)
Get a list of key fields in a keyword=value type of file, for example LTDT tool profile, LTDT project property file, etc. |
static java.lang.String |
getNewProjectLogFileName(java.lang.String newProjectLocation)
Get fully qualified name for a project log file located at non-default path |
static java.lang.String |
getNewProjectPropertyFileName(java.lang.String newProjectLocation)
Get fully qualified name for a project property file located at non-default path |
static java.lang.String |
getNewProjectTemplateFileName(java.lang.String newProjectLocation)
Get fully qualified name for a project templae file located at non-default path |
static java.lang.String |
getNewProjectWDDFileName(java.lang.String newProjectLocation)
Get fully qualified name for a project WDD file located at non-default path |
static java.lang.String |
getProjectLocation(java.lang.String projectName)
Given a proejct name, retrive the path of the project from LTDT property file HOME/.ltdt |
static java.lang.String |
getProjectLogFileName(java.util.Properties props)
Get full path name for a project log file |
static java.lang.String |
getProjectName(java.lang.String projectLocation)
Given a project location, search the LTDT tool property and find out the project registered with the location |
static java.lang.String |
getProjectPropertyFileName(java.util.Properties props)
Get fully qualified name for a project property file |
static java.lang.String |
getProjectTemplateFileName(java.util.Properties props)
Get fully qualified name for a project template file |
static java.lang.String |
getProjectWDDFileName(java.util.Properties props)
Get fully qualified name for a project WDD file |
static java.util.Properties |
getProperties(java.net.URL propFile)
Bases on URL, load and return properties info |
static java.util.ArrayList |
getSortedProjectList(java.lang.String propFile)
Return a sorted list of LTDT project names available on the system. |
static void |
initializeEmptyProject(java.util.Properties props,
MainWindow window)
Clear windows and properties to get ready for the next project |
static java.lang.String |
list2quotedSet(java.util.List dlist)
Given a list object, this method constructs and returns a string contains element from the original list, with "," as delimiter and " around each element value. |
static java.lang.String |
list2stringLF(java.util.List dlist)
Given a List object and return it as a String with a ',' and a line feed as delimiters ** with a leading line feed |
static java.lang.String |
list2stringNLF(java.util.List dlist)
Given a List object and return it as a String with a ',' and a line feed as delimiters, ** without leading line feed |
static java.lang.String |
makeTestString(int size)
Makes a string. |
static java.lang.String |
reformatDescription(java.lang.String origDescription)
|
static java.util.List |
rowstring2list(java.lang.String instring)
Given a string, tokenize it, and create an ArrayList as result. |
static java.util.List |
rowstring2listNotQuoted(java.lang.String instring)
Given a string, tokenize it, and create an ArrayList as result. |
static java.util.List |
rowstring2urllist(java.lang.String instring)
Given a string with ; as delimeter, convert each elements into URL and stored in a list |
static void |
startWait(MainWindow window)
|
static void |
stopWait(MainWindow window)
|
static java.net.URL |
toURL(java.lang.String s)
Convert a string to a URL. |
static java.lang.String |
trimLeadingWhiteSpace(java.lang.String string)
Removes leading whitespaces in a string |
static java.lang.String |
trimLeadingWhiteSpace(java.lang.String string,
int length)
Removes leading whitespaces in a string |
static void |
writeLogEntry(java.lang.String logfile,
java.lang.String message)
Append a timestamp and a message to a log file |
static void |
writeTemplate(MainWindow window,
java.lang.String filename)
Writes content in template editor to a file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Utility()
Method Detail |
---|
public static javax.swing.JPanel createVerticalBoxPanel()
public static java.lang.String formatInt(int in, int targetLength)
in
- An integer to be formatted to right justified stringtargetLength
- The length of string after formatting
public static java.net.URL toURL(java.lang.String s) throws java.net.MalformedURLException
s
- The string to convert
java.net.MalformedURLException
public static java.lang.String addCRLF(java.lang.String s)
s
-
public static java.lang.String addLeadingWhiteSpace(java.lang.String string, int length)
string
- The string to add whitespaces to.length
- The number of whitespaces to add to the line.
public static java.lang.String addTrailingWhiteSpace(java.lang.String string, int length)
public static java.lang.String trimLeadingWhiteSpace(java.lang.String string, int length)
string
- The stringlength
- The number of whitespaces to delete
public static java.lang.String trimLeadingWhiteSpace(java.lang.String string)
string
- The string
public static java.lang.String addQuotes(java.lang.String string)
string
-
public static java.lang.String makeTestString(int size)
size
- The size of the string
public static java.util.ArrayList getKeyList(java.lang.String inFile) throws java.io.IOException
inFile
- Input filename.
java.io.IOException
public static java.util.ArrayList getSortedProjectList(java.lang.String propFile) throws java.io.IOException
propFile
- The LTDT tool property file with project=path entries
java.io.IOException
- , FileNotFoundExceptionpublic static java.lang.String getProjectLocation(java.lang.String projectName) throws java.io.IOException, java.io.FileNotFoundException
projectName
-
java.io.IOException
java.io.FileNotFoundException
public static java.lang.String getProjectName(java.lang.String projectLocation) throws java.io.IOException, java.io.FileNotFoundException
projectLocation
-
java.io.IOException
java.io.FileNotFoundException
public static boolean dirRWAllowed(java.lang.String dir)
dir
- Directory
public static void writeLogEntry(java.lang.String logfile, java.lang.String message) throws java.io.IOException
logfile
- message
-
java.io.IOException
public static java.lang.String getProjectPropertyFileName(java.util.Properties props)
props
-
public static java.lang.String getNewProjectPropertyFileName(java.lang.String newProjectLocation)
newProjectLocation
-
public static java.lang.String getProjectTemplateFileName(java.util.Properties props)
props
-
public static java.lang.String getNewProjectTemplateFileName(java.lang.String newProjectLocation)
newProjectLocation
-
public static java.lang.String getProjectWDDFileName(java.util.Properties props)
props
-
public static java.lang.String getNewProjectWDDFileName(java.lang.String newProjectLocation)
newProjectLocation
-
public static java.lang.String getProjectLogFileName(java.util.Properties props)
props
-
public static java.lang.String getNewProjectLogFileName(java.lang.String newProjectLocation)
newProjectLocation
-
public static void initializeEmptyProject(java.util.Properties props, MainWindow window)
props
- window
- public static java.lang.String list2stringLF(java.util.List dlist)
dlist
-
public static java.lang.String list2stringNLF(java.util.List dlist)
dlist
-
public static java.lang.String list2quotedSet(java.util.List dlist)
dlist
-
public static java.util.List rowstring2list(java.lang.String instring)
instring
-
public static java.util.List rowstring2urllist(java.lang.String instring) throws java.net.MalformedURLException
instring
-
java.net.MalformedURLException
public static java.util.List rowstring2listNotQuoted(java.lang.String instring)
instring
-
public static void writeTemplate(MainWindow window, java.lang.String filename) throws java.io.IOException
window
- filename
-
java.io.IOException
public static void startWait(MainWindow window)
public static void stopWait(MainWindow window)
public static java.lang.String reformatDescription(java.lang.String origDescription)
public static java.util.Properties getProperties(java.net.URL propFile) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |