|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.aptana.ide.core.ui.CoreUIUtils
public final class CoreUIUtils
Functions useful for retrieving interesting information for plug-ins and the environment, but tailored to UI-related functions
| Field Summary | |
|---|---|
static boolean |
inEclipse32orHigher
Are we in Eclipse 3.2? |
static java.lang.String |
LICENSED_UPDATE_SITE_HOST_NAME
LICENSED_UPDATE_SITE_HOST_NAME |
static boolean |
runningOnMac
runningOnMac |
static boolean |
runningOnWindows
runningOnWindows |
static java.lang.String |
URL_SEPARATOR
Separates URL segments |
| Method Summary | |
|---|---|
static java.lang.String |
appendProtocol(java.lang.String path)
Appends the file:// protocol, if none found |
static void |
attachSaveListener(IVirtualFile file,
java.io.File f,
org.eclipse.ui.IEditorPart editorPart)
Watches the local file for changes and saves them back to the IVirtualFile when the editor is saved |
static org.eclipse.ui.IEditorInput |
createJavaFileEditorInput(java.io.File file)
Creates a new JavaFileEditorInput |
static org.eclipse.ui.IEditorInput |
createNonExistingFileEditorInput(java.io.File file,
java.lang.String fileName)
Creates a new NonExistingFileEditorInput |
static boolean |
editVirtualFileManagerProperties(IVirtualFileManager vfm)
editVirtualFileManagerProperties |
static void |
fixConnection(IVirtualFileManager manager)
Presents a dialog allow the user to "fix" a connection |
static org.eclipse.ui.IEditorPart |
getActiveEditor()
Returns the IEditorPart for the current editor |
static java.lang.String |
getActiveEditorURI()
Returns the URI for the current editor (effectively the file path transformed into file://) |
static java.net.URL |
getBundlePathAsFile(java.net.URI url)
Converts a URI with a bundle name in it to a entry ID. |
static java.io.File |
getConfigurationDirectory()
Returns a file handle to the folder links to osgi.configuration.area. |
static java.lang.String |
getEncryptedProValue()
Gets the encrypted pro value |
static org.eclipse.jface.resource.ImageDescriptor |
getImageDescriptor(java.lang.String pluginId,
java.lang.String imageFilePath)
Retrieves the image descriptor associated with resource from the image descriptor registry. |
static java.lang.String[] |
getOpenEditorPaths()
getOpenEditorPaths |
static java.lang.String |
getPathFromEditorInput(org.eclipse.ui.IEditorInput input)
Returns the current path to the source file from an editor input. |
static java.lang.String |
getPathFromURI(java.lang.String sourceURI)
Gets the file path from a URI |
static org.eclipse.core.runtime.IPath |
getPathOfIFileLocation(org.eclipse.core.resources.IFile file)
|
static java.io.File |
getPluginFile(org.eclipse.core.runtime.Plugin plugin)
Retrieves the location of the plug-in |
static java.lang.String |
getPluginLocation(org.eclipse.core.runtime.Plugin plugin)
Retrieves the location of the plug-in |
static java.net.URL |
getResolvedURL(org.osgi.framework.Bundle b,
java.lang.String fullPath)
Returns the URL as a local URL |
static java.lang.String |
getStringOfIFileLocation(org.eclipse.core.resources.IFile file)
Calls IFile.getLocation if it exists and uses an Eclipse internal mechanism if the file is deleted. |
static java.lang.String |
getURI(java.io.File file)
Returns a URI from a file |
static java.lang.String |
getURI(java.io.File file,
boolean urlEncode)
Returns a URI from a file |
static java.lang.String |
getURI(org.eclipse.ui.IEditorInput input)
Returns a valid URI from the passed in editor input. |
static java.lang.String |
getURI(org.eclipse.ui.IEditorPart editor)
Returns the URI for the current editor (effectively the file path transformed into file://) |
static java.lang.String |
getURI(org.eclipse.core.runtime.IPath path)
getURI |
static java.lang.String |
getURI(java.lang.String path)
Returns a valid URI from the passed in path. |
static java.lang.String |
getUserName()
Gets the user's name from preferences or the system, whichever is defined |
static org.eclipse.ui.IWorkbenchPart |
getViewInternal(java.lang.String id,
java.lang.String secondaryId)
getViewInternal |
static org.eclipse.ui.IWorkbenchPart[] |
getViewsInternal(java.lang.String id)
Gets all views with the primary part id, and any secondary part id |
static org.eclipse.ui.IWorkbenchPart[] |
getViewsInternal(java.lang.String id,
java.lang.String secondaryId)
getViewInternal |
static java.lang.String |
getWorkspaceDirectory()
getWorkspaceDirectory |
static boolean |
isFeatureEnabled(java.lang.String featureId)
Returns true if a feature with this id is enabled |
static boolean |
isFeatureInstalled(java.lang.String featureId)
Returns true if a feature with this id is enabled |
static boolean |
isInstalledAsPlugin()
Are we installed as a plugin into Eclipse? |
static boolean |
isURI(java.lang.String path)
Does the current path contain a protocol? |
static java.lang.String |
joinURI(java.lang.String uriPrefix,
java.lang.String uriSuffix)
joinURI |
static java.lang.String |
joinURI(java.net.URL url,
java.lang.String uriSuffix)
joinURI |
static java.lang.String |
joinUrlPath(java.lang.String[] segments)
Joins the URL from segments |
static void |
logAndDialogError(org.eclipse.swt.widgets.Shell shell,
org.eclipse.core.runtime.Plugin plugin,
java.lang.String title,
java.lang.String message)
Logs an error |
static void |
logAndDialogError(org.eclipse.swt.widgets.Shell shell,
org.eclipse.core.runtime.Plugin plugin,
java.lang.String title,
java.lang.String message,
java.lang.Throwable th)
Logs an error |
static void |
openBrowserURL(java.lang.String browserUrl)
Opens the url in an external browser according to the browser returned from IWorkbenchBrowserSupport.getExternalBrowser(). |
static void |
openBrowserURLWithAllInfo(java.lang.String browserUrl,
boolean startWithQuestionMark,
java.lang.String from)
Opens a browser url with all the added info |
static void |
openBrowserURLWithInfo(java.lang.String browserUrl,
boolean startWithQuestionMark,
java.lang.String from)
Opens a browser url with added info |
static void |
openFileInEditor(IVirtualFile file,
org.eclipse.ui.IEditorDescriptor editorDesc)
openFileInEditor |
static void |
placeDialogInScreenCenter(org.eclipse.swt.widgets.Shell parent,
org.eclipse.swt.widgets.Shell shell)
Puts the respective dialog in the center of the screen |
static void |
registerFileExtension(java.lang.String editorID,
java.lang.String filename,
java.lang.String extension)
registerFileExtension |
static java.net.URI |
replaceBundleNameWithId(java.net.URI url)
Converts a URI with a bundle name in it to a entry ID. |
static java.lang.String |
resolveBundleUrl(java.lang.String stringUrl)
|
static java.io.File |
saveRemoteFileAsLocal(IVirtualFile file)
Saves a remote file as a local file |
static void |
showError(java.lang.String message,
java.lang.Exception e)
|
static void |
showError(java.lang.String message,
java.lang.Exception e,
boolean log)
|
static void |
showMessage(java.lang.String message)
|
static java.lang.String[] |
splitUrlPath(java.lang.String urlPath)
Splits the URL into segments |
static java.net.URL |
trimURLSegments(java.net.URL url,
int segments)
Trims the specified # of segments from the end of the URL |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String LICENSED_UPDATE_SITE_HOST_NAME
public static boolean runningOnMac
public static boolean runningOnWindows
public static boolean inEclipse32orHigher
public static java.lang.String URL_SEPARATOR
| Method Detail |
|---|
public static org.eclipse.jface.resource.ImageDescriptor getImageDescriptor(java.lang.String pluginId,
java.lang.String imageFilePath)
pluginId - the Id of the plug-in to grab the image fromimageFilePath - the image descriptor to retrieve
public static void placeDialogInScreenCenter(org.eclipse.swt.widgets.Shell parent,
org.eclipse.swt.widgets.Shell shell)
parent - shell - public static java.lang.String getPluginLocation(org.eclipse.core.runtime.Plugin plugin)
plugin - The plug-in to search
public static java.io.File getPluginFile(org.eclipse.core.runtime.Plugin plugin)
plugin - The plug-in to search
public static java.lang.String getWorkspaceDirectory()
public static java.lang.String getStringOfIFileLocation(org.eclipse.core.resources.IFile file)
file -
public static org.eclipse.core.runtime.IPath getPathOfIFileLocation(org.eclipse.core.resources.IFile file)
file -
getStringOfIFileLocation(IFile file)public static java.lang.String getPathFromEditorInput(org.eclipse.ui.IEditorInput input)
input - the editor input
public static java.lang.String appendProtocol(java.lang.String path)
path -
public static java.lang.String getURI(java.io.File file)
file - the file to pull from
public static java.lang.String getURI(java.io.File file,
boolean urlEncode)
file - the file to pull fromurlEncode - do we url encode the file name
public static java.lang.String getURI(org.eclipse.core.runtime.IPath path)
path -
public static java.lang.String getURI(org.eclipse.ui.IEditorInput input)
input -
public static boolean isURI(java.lang.String path)
path -
public static java.lang.String getURI(java.lang.String path)
path -
public static java.lang.String getURI(org.eclipse.ui.IEditorPart editor)
editor -
public static org.eclipse.ui.IEditorPart getActiveEditor()
public static java.lang.String getActiveEditorURI()
public static java.lang.String[] getOpenEditorPaths()
public static org.eclipse.ui.IWorkbenchPart getViewInternal(java.lang.String id,
java.lang.String secondaryId)
id - secondaryId -
public static org.eclipse.ui.IWorkbenchPart[] getViewsInternal(java.lang.String id)
id -
public static org.eclipse.ui.IWorkbenchPart[] getViewsInternal(java.lang.String id,
java.lang.String secondaryId)
id - secondaryId -
public static java.lang.String getPathFromURI(java.lang.String sourceURI)
sourceURI - the source URI
public static java.lang.String getUserName()
public static void logAndDialogError(org.eclipse.swt.widgets.Shell shell,
org.eclipse.core.runtime.Plugin plugin,
java.lang.String title,
java.lang.String message)
shell - plugin - title - the title of the dialogmessage - the message to log
public static void logAndDialogError(org.eclipse.swt.widgets.Shell shell,
org.eclipse.core.runtime.Plugin plugin,
java.lang.String title,
java.lang.String message,
java.lang.Throwable th)
shell - plugin - title - the title of the dialogmessage - the message to logth - public static org.eclipse.ui.IEditorInput createJavaFileEditorInput(java.io.File file)
file -
public static org.eclipse.ui.IEditorInput createNonExistingFileEditorInput(java.io.File file,
java.lang.String fileName)
file - fileName -
public static java.lang.String joinURI(java.net.URL url,
java.lang.String uriSuffix)
url - uriSuffix -
public static java.lang.String joinURI(java.lang.String uriPrefix,
java.lang.String uriSuffix)
uriPrefix - uriSuffix -
public static java.net.URL trimURLSegments(java.net.URL url,
int segments)
url - segments -
public static java.lang.String[] splitUrlPath(java.lang.String urlPath)
urlPath -
public static java.lang.String joinUrlPath(java.lang.String[] segments)
segments -
public static void registerFileExtension(java.lang.String editorID,
java.lang.String filename,
java.lang.String extension)
editorID - filename - The name of the file to associate with the given editor ID. Use * if any file for the given extension
will workextension - The file extensions without the leading '.' to associate with the given editor IDpublic static java.net.URI replaceBundleNameWithId(java.net.URI url)
url -
public static java.net.URL getBundlePathAsFile(java.net.URI url)
url -
public static java.net.URL getResolvedURL(org.osgi.framework.Bundle b,
java.lang.String fullPath)
b - fullPath -
public static java.io.File getConfigurationDirectory()
public static java.lang.String resolveBundleUrl(java.lang.String stringUrl)
stringUrl -
public static void openFileInEditor(IVirtualFile file,
org.eclipse.ui.IEditorDescriptor editorDesc)
file - editorDesc -
public static void attachSaveListener(IVirtualFile file,
java.io.File f,
org.eclipse.ui.IEditorPart editorPart)
file - f - editorPart - public static java.io.File saveRemoteFileAsLocal(IVirtualFile file)
file -
public static void fixConnection(IVirtualFileManager manager)
manager - public static boolean editVirtualFileManagerProperties(IVirtualFileManager vfm)
vfm -
public static void showError(java.lang.String message,
java.lang.Exception e)
message - e -
public static void showError(java.lang.String message,
java.lang.Exception e,
boolean log)
message - e - log - public static void showMessage(java.lang.String message)
message - public static boolean isInstalledAsPlugin()
public static void openBrowserURLWithInfo(java.lang.String browserUrl,
boolean startWithQuestionMark,
java.lang.String from)
browserUrl - -
base url that will be directly appened with ? plus infostartWithQuestionMark - -
true to append a ?, false to start appending with &from - -
location triggering
public static void openBrowserURLWithAllInfo(java.lang.String browserUrl,
boolean startWithQuestionMark,
java.lang.String from)
browserUrl - -
base url that will be directly appened with ? plus ALL infostartWithQuestionMark - -
true to append a ?, false to start appending with &from - -
location triggeringpublic static java.lang.String getEncryptedProValue()
public static void openBrowserURL(java.lang.String browserUrl)
browserUrl - -
url to openpublic static boolean isFeatureEnabled(java.lang.String featureId)
featureId -
public static boolean isFeatureInstalled(java.lang.String featureId)
featureId -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||