|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.formaria.editor.netbeans.project.pages.EditorUtility
public class EditorUtility
A utility class to help interact with the NetBeans editors
Copyright (c) Formaria Ltd., 1998-2004
License: see license.txt
| Field Summary |
|---|
| Fields inherited from interface org.formaria.editor.project.pages.IEditorUtility |
|---|
FRAME_HEIGHT, FRAME_WIDTH |
| Constructor Summary | |
|---|---|
EditorUtility()
|
|
| Method Summary | |
|---|---|
boolean |
activateEditor(PageResource pageRes,
boolean activate)
Activate the source code editor for this page |
void |
addJar(EditorProject currentProject,
java.net.URL jarUrl)
Add a jar reference to the project class path. |
boolean |
canImportDbTable(java.awt.datatransfer.DataFlavor transferFlavor)
Indicates whether database table can be imported from a given data flavor |
void |
copy(java.io.InputStream is,
java.io.OutputStream os)
|
void |
copyToClipboard(java.lang.String text)
Copies the given text to the internal netbeans clipboard |
Page |
getCachedPage(EditorProject currentProject,
PageResource pageRes)
If the page xml has been cached we want to use that xml to generate the page otherwise we just return the page contained in the pageRes object |
java.sql.Connection |
getDbConnection(java.lang.Object obj)
Retrieve database connection from obj |
java.lang.String |
getDbConnectionName(java.lang.Object obj)
Get database connection name |
java.lang.String |
getDbDriver(java.lang.Object obj)
Get database driver name |
java.lang.String |
getDbDriverFile(java.lang.Object tableNode)
Get the path to the file (zip, jar) containing the jdbc driver used to connect the the database. |
java.lang.String |
getDbPassword(java.lang.Object obj)
Get database connection password |
java.lang.String |
getDbTableName(java.lang.Object obj)
Get the table name |
java.lang.ClassLoader |
getEditorClassLoader(EditorProject project)
Gets the class loader being used by the editor to load resources of the specified project. |
javax.swing.JEditorPane |
getEditorPane(java.awt.Container cont)
Search the container for an instance of JEditorPane |
javax.swing.JEditorPane |
getEditorPane(java.lang.String fileName)
Search the container for an instance of JEditorPane |
java.lang.Object[] |
getHandlerMethods(EditorProject currentProject,
java.lang.String fileName)
Get a list of the methods provided by the page class |
Modifiable |
getPageDataObject(EditorProject currentProject,
java.lang.String name)
Retrieve the PageDataObject for the page with the passed name |
java.lang.String |
getPlatform()
|
java.net.URL[] |
getProjectURLs(EditorProject project)
Gets the classpath URLs of the given project. |
boolean |
hasMethod(EditorProject currentProject,
java.lang.String fileName,
java.lang.String methodName)
Check if a method is already contained within the direct superclass |
void |
insertTextAtCaret(java.lang.Object sce,
java.lang.String newText)
|
boolean |
isEclipse()
Is this an eclipse plugin? |
boolean |
isValid(java.lang.Object sourceCodeEditor)
|
java.awt.Image |
loadImage(java.lang.String name)
|
boolean |
locateMethod(Project currentProject,
PageResource pageRes,
java.lang.Object sce,
java.lang.String methodName,
java.lang.String searchText,
boolean addNew,
boolean ctrlDown)
|
void |
markDirty(EditorProject project)
Mark the project as dirty |
boolean |
openSourceFile(EditorProject currentProject,
PageResource pageResource,
java.lang.String fileName)
|
void |
requestActive(java.lang.Object sourceEditor)
|
protected java.lang.String |
retrieveDriverFile(java.lang.String driverName,
java.lang.Object driverListNodeChildren)
Tries to retrievs the name of the file that contains the specified driver |
boolean |
setSourceCodeEditor(PageResource pageRes,
java.lang.String fileName)
Set the source code editor for the pageResource |
void |
showErrorMessage(java.lang.String msg,
java.lang.String title)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EditorUtility()
| Method Detail |
|---|
public java.sql.Connection getDbConnection(java.lang.Object obj)
getDbConnection in interface IEditorUtilityobj - the object from which the database connection
is to be obtained
public java.lang.String getDbDriverFile(java.lang.Object tableNode)
getDbDriverFile in interface IEditorUtilitytableNode - the table node object from which the db driver path
will be otained.
protected java.lang.String retrieveDriverFile(java.lang.String driverName,
java.lang.Object driverListNodeChildren)
throws java.lang.Exception
driverName - the name of the driver
java.lang.Exceptionpublic java.lang.String getDbConnectionName(java.lang.Object obj)
getDbConnectionName in interface IEditorUtilityobj - the object from which the connection name is to
be obtained
public java.lang.String getDbDriver(java.lang.Object obj)
getDbDriver in interface IEditorUtilityobj - the object from which the
driver name is to be obtained
public java.lang.String getDbPassword(java.lang.Object obj)
getDbPassword in interface IEditorUtilityobj - the object from which the password is
to be obtained
public java.lang.String getDbTableName(java.lang.Object obj)
getDbTableName in interface IEditorUtilityobj - the object from which the table name is to be obtained
public boolean canImportDbTable(java.awt.datatransfer.DataFlavor transferFlavor)
canImportDbTable in interface IEditorUtilitytransferFlavors - the data formats available
true if database table can be imported,
false otherwise
public boolean setSourceCodeEditor(PageResource pageRes,
java.lang.String fileName)
setSourceCodeEditor in interface IEditorUtility
public boolean activateEditor(PageResource pageRes,
boolean activate)
activateEditor in interface IEditorUtilitypageRes - the page resource that owns the sourceactivate - force the source editor to display if true
public javax.swing.JEditorPane getEditorPane(java.awt.Container cont)
getEditorPane in interface IEditorUtilitycont - the container to search
public javax.swing.JEditorPane getEditorPane(java.lang.String fileName)
getEditorPane in interface IEditorUtilitycont - the container to search
public Modifiable getPageDataObject(EditorProject currentProject,
java.lang.String name)
getPageDataObject in interface IEditorUtilityname - the name of the page whose PageDataObject we wish to retrieve
public java.net.URL[] getProjectURLs(EditorProject project)
getProjectURLs in interface IEditorUtilityproject - project whose classpath entries will be returned
public java.lang.ClassLoader getEditorClassLoader(EditorProject project)
getEditorClassLoader in interface IEditorUtilityproject - project the classloader of which is to be obtained
public Page getCachedPage(EditorProject currentProject,
PageResource pageRes)
getCachedPage in interface IEditorUtilitypageRes - the pageResource we're checking
public void requestActive(java.lang.Object sourceEditor)
requestActive in interface IEditorUtility
public boolean locateMethod(Project currentProject,
PageResource pageRes,
java.lang.Object sce,
java.lang.String methodName,
java.lang.String searchText,
boolean addNew,
boolean ctrlDown)
locateMethod in interface IEditorUtility
public void insertTextAtCaret(java.lang.Object sce,
java.lang.String newText)
insertTextAtCaret in interface IEditorUtilitypublic boolean isValid(java.lang.Object sourceCodeEditor)
isValid in interface IEditorUtility
public boolean openSourceFile(EditorProject currentProject,
PageResource pageResource,
java.lang.String fileName)
openSourceFile in interface IEditorUtility
public boolean hasMethod(EditorProject currentProject,
java.lang.String fileName,
java.lang.String methodName)
hasMethod in interface IEditorUtilitycurrentProject - the current projectfileName - the full file name for the enclosing classmethodName - the bare method name e.g. 'showPrevious'
public java.lang.Object[] getHandlerMethods(EditorProject currentProject,
java.lang.String fileName)
getHandlerMethods in interface IEditorUtilitycurrentProject - the current projectfileName - the full file name for the enclosing class
public void copy(java.io.InputStream is,
java.io.OutputStream os)
copy in interface IEditorUtilitypublic java.awt.Image loadImage(java.lang.String name)
loadImage in interface IEditorUtilitypublic void copyToClipboard(java.lang.String text)
copyToClipboard in interface IEditorUtilitytext - the text to be copiedpublic java.lang.String getPlatform()
getPlatform in interface IEditorUtility
public void showErrorMessage(java.lang.String msg,
java.lang.String title)
showErrorMessage in interface IEditorUtility
public void addJar(EditorProject currentProject,
java.net.URL jarUrl)
addJar in interface IEditorUtilitycurrentProject - the current projectjarUrl - the jar to addpublic boolean isEclipse()
isEclipse in interface IEditorUtilitypublic void markDirty(EditorProject project)
markDirty in interface IEditorUtilityproject - the current project
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||