|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.ide.util.IdeUtil
public final class IdeUtil
Method Summary | |
---|---|
static void |
addAll(java.util.Collection target, java.util.Iterator toAdd) Adds all objects in the Iterator to target. |
static void |
addAll(java.util.Collection target, java.lang.Object[] toAdd) Adds all objects in toAdd to target. |
static void |
addComboBoxDocumentListener(javax.swing.JComboBox jcomboBox, javax.swing.event.DocumentListener documentListener) |
static void |
centerTreeSelection(javax.swing.JTree tree) Centers the current tree selection within its scroll pane. |
static void |
centerWindow(java.awt.Container parent, java.awt.Component child) Center a component over another. |
static void |
comboBoxSelectItem(javax.swing.JComboBox comboBox, java.lang.Object item) |
static boolean |
containsAny(java.util.AbstractCollection set, java.util.Collection collection) |
static java.lang.String[] |
convertStringToStringArray(java.lang.String s) |
static java.lang.String[] |
convertStringToStringArray(java.lang.String s, boolean allowQuotedStrings, boolean keepQuotes) |
static void |
copyToClipboard(java.lang.String s) |
static java.lang.String |
decodeHTMLReservedCharacters(java.lang.String s) Replaces the HTML reserved characters that have been previously encoded with the appropriate entity. |
static void |
expandAllTreeRows(javax.swing.JTree tree) Expands all the rows in the specified JTree . |
static void |
expandTreeToDepth(javax.swing.JTree tree, int depth) Expands the rows in the specified JTree up to the specified tree depth; all other rows are collapsed. |
static java.awt.Window |
findActiveModalWindow() Finds the window in the container hierarchy which is visible, modal and active. |
static java.awt.Dialog |
findDialog(java.awt.Component component) Finds the first parent of the specified Component that is an instance of Dialog . |
static java.awt.Frame |
findFrame(java.awt.Component component) |
static java.lang.String |
getDigitsFromString(java.lang.String inString) Takes a string and strips out any non-digit characters and returns an int |
static java.lang.String |
getDocumentVersion(java.net.URL url) Deprecated. since 11.0 with no replacement. This API is product specific and should not be in the IDE api. |
static java.lang.String |
getIdeEncoding() Retrieves the IDE-wide encoding. |
static java.lang.String |
getIdeIanaEncoding() Retrieves the IDE-wide IANA encoding. |
static java.awt.Frame |
getMainWindow() |
static java.lang.String |
getProgramName() |
static java.lang.String |
getProgramShortName() |
static java.lang.String |
getSubString(java.lang.String sIn, char c, boolean bBefore) Returns the string before the first occurence of c if bBefore is true or the string after the first occurence of c if bBefore is false |
static javax.swing.Icon |
grayIcon(javax.swing.Icon icon) |
static void |
invokeAfterRepaint(java.lang.Runnable runnable) Deprecated. This method was introduced to fix the "gray rectangle" problem in Swing. Now the issue is fixed in Java 1.6 (sun bug no: 4967886), we no longer need this method. Clients are requested to use SwingUtilities.invokeLater if they feel the need to use this method. For now, this method is same as SwingUtilities.invokeLater. If the runnable is is doing lots of processing or significant work in the event dispatch thread, then it should happen in a separate thread. Clients can use SwingWorker for that. |
static boolean |
isHeadless() Use to determine if the Ide is running in headless mode |
static boolean |
isJavaIdentifier(java.lang.String name) Returns true if the specified String is a valid Java identifier. |
static boolean |
isJavaKeyword(java.lang.String name) Returns true if the specified String is a Java keyword. |
static boolean |
isJavaReservedWord(java.lang.String name) Returns true if the specified String is a Java reserved word. |
static boolean |
isPackageIdentifier(java.lang.String name) Returns true if the specified String is a valid package identifier. |
static java.lang.String |
list2String(java.util.List list) |
static java.awt.Window |
modalDialogOwner() Finds the window in the container hierarchy which is visible, modal and active. |
static java.awt.Component |
moveFocusAway() Since the JDK sends inconsistent focus messages when a focused component is removed from the screen, it is often necessary to move that focus away before to move a component to another container or to remove the component. |
static java.lang.String |
prepad(java.lang.String s, char c, int len) Return a string where the beginning of the string has been padded to obtain a desired length. |
static java.lang.String |
removeChars(java.lang.String sIn, java.lang.String sRemove) Return a sIn without any character found is sRemove |
static java.lang.String |
replaceHTMLReservedCharacters(java.lang.String s) Replaces the HTML reserved characters with the appropriate entity. |
static void |
runNow(java.lang.Runnable r) |
static void |
setIdeEncoding(java.lang.String encoding) Sets the IDE-wide encoding. |
static void |
setMainWindow(javax.swing.JFrame frame) |
static void |
setProgramName(java.lang.String name) |
static void |
setProgramShortName(java.lang.String name) |
static void |
setStartupWindow(javax.swing.JFrame frame) The startup window is a JFrame upon which dialogs and other UI may be parented before the showing of the main window. |
static void |
string2List(java.lang.String string, java.util.List list) |
static void |
tryToRestoreFocus(java.awt.Component cPreferred) This method tries to set the focus on cPreferred . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void centerWindow(java.awt.Container parent, java.awt.Component child)
public static void centerTreeSelection(javax.swing.JTree tree)
JTree
is null or is not hosted in a JScrollPane
, the this method does nothing.tree
- The JTree
whose selection is to be centered.public static void expandAllTreeRows(javax.swing.JTree tree)
JTree
. This method assumes that the JTree
is in single-selection mode; if any row was selected prior to expanding all rows, then that row will remain selected after all rows have been expanded.public static void expandTreeToDepth(javax.swing.JTree tree, int depth)
JTree
up to the specified tree depth; all other rows are collapsed. The depth of a row is defined as the length of the TreePath
's path for that row.
This method assumes that the JTree
is in single-selection mode; if any row was selected prior to expanding all rows, then that row will remain selected after all rows have been expanded.
tree
- the JTree
to expand.depth
- the desired expansion depth; a depth of <=0
expands all rows in the tree.public static java.awt.Dialog findDialog(java.awt.Component component)
Component
that is an instance of Dialog
. If the component itself is a Dialog
, then it is returned. If the component is null
then null
is returned.public static java.awt.Frame findFrame(java.awt.Component component)
public static boolean isJavaKeyword(java.lang.String name)
true
if the specified String
is a Java keyword.name
- the String
to test.public static boolean isJavaReservedWord(java.lang.String name)
true
if the specified String
is a Java reserved word. A Java reserved word is either a keyword, a boolean literal, or the null literal.name
- the String
to test.public static boolean isJavaIdentifier(java.lang.String name)
true
if the specified String
is a valid Java identifier.name
- the String
to test.public static boolean isPackageIdentifier(java.lang.String name)
true
if the specified String
is a valid package identifier.public static java.lang.String list2String(java.util.List list)
public static void string2List(java.lang.String string, java.util.List list)
public static java.lang.String[] convertStringToStringArray(java.lang.String s)
public static java.lang.String[] convertStringToStringArray(java.lang.String s, boolean allowQuotedStrings, boolean keepQuotes)
public static java.lang.String getSubString(java.lang.String sIn, char c, boolean bBefore)
public static java.lang.String removeChars(java.lang.String sIn, java.lang.String sRemove)
public static java.lang.String prepad(java.lang.String s, char c, int len)
s
- the String
to pad.c
- the character to use when padding.len
- the desired length of the string.public static void addAll(java.util.Collection target, java.lang.Object[] toAdd)
target
- the Collection to which the elements are added.toAdd
- the objects to add to the target. Cannot be null.public static void addAll(java.util.Collection target, java.util.Iterator toAdd)
target
- the Collection to which the elements are added.toAdd
- the objects to add to the target. Cannot be null.public static boolean containsAny(java.util.AbstractCollection set, java.util.Collection collection)
@Deprecated
public static java.lang.String getDocumentVersion(java.net.URL url)
url
and determines the version number. If the document is an XML file, the version number is taken from the XML namespace URI, assuming that the namespace URI follows the format used by JDeveloper. A namespace URI is expected to a have a format like this: http://xmlns.oracle.com/jdeveloper/#####/... where ##### is the version string and ... is any text after the version string to identify the specific document type.null
if the version could not be determined. Note that if the file pointed to by the url
does not exists, this method assumes this is a new file that will be written using the current product version.public static void addComboBoxDocumentListener(javax.swing.JComboBox jcomboBox, javax.swing.event.DocumentListener documentListener)
public static void comboBoxSelectItem(javax.swing.JComboBox comboBox, java.lang.Object item)
public static javax.swing.Icon grayIcon(javax.swing.Icon icon)
public static void runNow(java.lang.Runnable r)
public static void copyToClipboard(java.lang.String s)
public static java.awt.Frame getMainWindow()
public static void setMainWindow(javax.swing.JFrame frame)
public static void setStartupWindow(javax.swing.JFrame frame)
public static java.lang.String getProgramName()
public static void setProgramName(java.lang.String name)
public static java.lang.String getProgramShortName()
public static void setProgramShortName(java.lang.String name)
public static java.lang.String getIdeEncoding()
public static void setIdeEncoding(java.lang.String encoding)
public static java.lang.String getIdeIanaEncoding()
public static java.lang.String replaceHTMLReservedCharacters(java.lang.String s)
s
- string to decodepublic static java.lang.String decodeHTMLReservedCharacters(java.lang.String s)
s
- string to decodepublic static java.awt.Component moveFocusAway()
tryToRestoreFocus(java.awt.Component)
public static void tryToRestoreFocus(java.awt.Component cPreferred)
cPreferred
. If cPreferred
is null, not visible or disabled, it will focus the top editor. If there is no editor, it tries to activate the first dockable. If there is no dockable visible, it will focus the main window.moveFocusAway()
public static final java.awt.Window modalDialogOwner()
public static final java.awt.Window findActiveModalWindow()
public static java.lang.String getDigitsFromString(java.lang.String inString)
inString
-
@Deprecated
public static void invokeAfterRepaint(java.lang.Runnable runnable)
SwingUtilities.invokeLater(Runnable)
except that the runnable
is started after all the pending repaints.runnable
-SwingUtils.invokeAfterRepaint(java.lang.Runnable)
public static boolean isHeadless()
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |