Package net.officefloor.eclipse.bridge
Class EclipseEnvironmentBridge
- java.lang.Object
-
- net.officefloor.eclipse.bridge.EclipseEnvironmentBridge
-
- All Implemented Interfaces:
EnvironmentBridge
public class EclipseEnvironmentBridge extends java.lang.Object implements EnvironmentBridge
EclipseEnvironmentBridge
.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.officefloor.gef.bridge.EnvironmentBridge
EnvironmentBridge.PreferenceEvent, EnvironmentBridge.PreferenceListener, EnvironmentBridge.SelectionHandler
-
-
Constructor Summary
Constructors Constructor Description EclipseEnvironmentBridge()
Initialise for nonIJavaProject
specific bridging.EclipseEnvironmentBridge(org.eclipse.jdt.core.IJavaProject javaProject)
Instantiate forIJavaProject
specific bridging.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPreferenceListener(EnvironmentBridge.PreferenceListener listener)
void
dispose()
Disposes of resources.java.lang.ClassLoader
getClassLoader()
Obtains theClassLoader
.OfficeFloorCompiler
getOfficeFloorCompiler()
Obtains theOfficeFloorCompiler
.java.lang.String
getPreference(java.lang.String preferenceId)
Obtains the preference.void
init(org.eclipse.swt.widgets.Shell parentShell)
Initialise.boolean
isClassOnClassPath(java.lang.String className)
Indicates ifClass
on theClass
path.boolean
isResourceOnClassPath(java.lang.String resourcePath)
Indicates if the resource is on theClass
path.boolean
isSuperType(java.lang.String className, java.lang.String superTypeName)
Indicates if super type.<T> java.lang.Class<? extends T>
loadClass(java.lang.String className, java.lang.Class<T> superType)
Loads theClass
.void
resetPreference(java.lang.String preferenceId)
Resets the preference to default value.void
selectClass(java.lang.String searchText, java.lang.String superTypeName, EnvironmentBridge.SelectionHandler handler)
Selects aClass
.void
selectClassPathResource(java.lang.String searchText, EnvironmentBridge.SelectionHandler handler)
Selects a resource from theClass
path.void
setPreference(java.lang.String preferenceId, java.lang.String value)
Specifies the preference value.
-
-
-
Constructor Detail
-
EclipseEnvironmentBridge
public EclipseEnvironmentBridge(org.eclipse.jdt.core.IJavaProject javaProject)
Instantiate forIJavaProject
specific bridging.- Parameters:
javaProject
-IJavaProject
.
-
EclipseEnvironmentBridge
public EclipseEnvironmentBridge()
Initialise for nonIJavaProject
specific bridging.
-
-
Method Detail
-
init
public void init(org.eclipse.swt.widgets.Shell parentShell)
Initialise.- Parameters:
parentShell
- ParentShell
.
-
dispose
public void dispose() throws java.io.IOException
Disposes of resources.- Throws:
java.io.IOException
- If fails to dispose.
-
isClassOnClassPath
public boolean isClassOnClassPath(java.lang.String className) throws java.lang.Exception
Description copied from interface:EnvironmentBridge
Indicates ifClass
on theClass
path.- Specified by:
isClassOnClassPath
in interfaceEnvironmentBridge
- Parameters:
className
- Name of theClass
.- Returns:
true
ifClass
on theClass
path.- Throws:
java.lang.Exception
- If fails to determine if onClass
path.
-
isSuperType
public boolean isSuperType(java.lang.String className, java.lang.String superTypeName) throws java.lang.Exception
Description copied from interface:EnvironmentBridge
Indicates if super type.- Specified by:
isSuperType
in interfaceEnvironmentBridge
- Parameters:
className
- Name ofClass
.superTypeName
- Super typeClass
.- Returns:
true
if super typeClass
.- Throws:
java.lang.Exception
- If fails to determine if super type.
-
selectClass
public void selectClass(java.lang.String searchText, java.lang.String superTypeName, EnvironmentBridge.SelectionHandler handler)
Description copied from interface:EnvironmentBridge
Selects aClass
.- Specified by:
selectClass
in interfaceEnvironmentBridge
- Parameters:
searchText
- Search text to find theClass
.superTypeName
- Super type of theClass
.handler
-EnvironmentBridge.SelectionHandler
.
-
loadClass
public <T> java.lang.Class<? extends T> loadClass(java.lang.String className, java.lang.Class<T> superType) throws java.lang.Exception
Description copied from interface:EnvironmentBridge
Loads theClass
.- Specified by:
loadClass
in interfaceEnvironmentBridge
- Type Parameters:
T
- Super type.- Parameters:
className
- Name ofClass
.superType
- Super type required ofClass
.- Returns:
Class
.- Throws:
java.lang.Exception
- If fails to load theClass
.
-
getClassLoader
public java.lang.ClassLoader getClassLoader() throws java.lang.Exception
Description copied from interface:EnvironmentBridge
Obtains theClassLoader
.- Specified by:
getClassLoader
in interfaceEnvironmentBridge
- Returns:
ClassLoader
.- Throws:
java.lang.Exception
- If fails to obtainClassLoader
.
-
getOfficeFloorCompiler
public OfficeFloorCompiler getOfficeFloorCompiler() throws java.lang.Exception
Description copied from interface:EnvironmentBridge
Obtains theOfficeFloorCompiler
.- Specified by:
getOfficeFloorCompiler
in interfaceEnvironmentBridge
- Returns:
OfficeFloorCompiler
.- Throws:
java.lang.Exception
- If fails to obtainOfficeFloorCompiler
.
-
isResourceOnClassPath
public boolean isResourceOnClassPath(java.lang.String resourcePath) throws java.lang.Exception
Description copied from interface:EnvironmentBridge
Indicates if the resource is on theClass
path.- Specified by:
isResourceOnClassPath
in interfaceEnvironmentBridge
- Parameters:
resourcePath
- Resource path.- Returns:
true
if the resource is on theClass
path.- Throws:
java.lang.Exception
- If fails to determine if onClass
path.
-
selectClassPathResource
public void selectClassPathResource(java.lang.String searchText, EnvironmentBridge.SelectionHandler handler)
Description copied from interface:EnvironmentBridge
Selects a resource from theClass
path.- Specified by:
selectClassPathResource
in interfaceEnvironmentBridge
- Parameters:
searchText
- Search text to find theClass
path resource.handler
-EnvironmentBridge.SelectionHandler
.
-
getPreference
public java.lang.String getPreference(java.lang.String preferenceId)
Description copied from interface:EnvironmentBridge
Obtains the preference.- Specified by:
getPreference
in interfaceEnvironmentBridge
- Parameters:
preferenceId
- Preference identifier.- Returns:
- Preference value or
null
if no configured.
-
setPreference
public void setPreference(java.lang.String preferenceId, java.lang.String value)
Description copied from interface:EnvironmentBridge
Specifies the preference value.- Specified by:
setPreference
in interfaceEnvironmentBridge
- Parameters:
preferenceId
- Preference identifier.value
- Value for the preference.
-
resetPreference
public void resetPreference(java.lang.String preferenceId)
Description copied from interface:EnvironmentBridge
Resets the preference to default value.- Specified by:
resetPreference
in interfaceEnvironmentBridge
- Parameters:
preferenceId
- Preference identifier.
-
addPreferenceListener
public void addPreferenceListener(EnvironmentBridge.PreferenceListener listener)
Description copied from interface:EnvironmentBridge
- Specified by:
addPreferenceListener
in interfaceEnvironmentBridge
- Parameters:
listener
-EnvironmentBridge.PreferenceListener
.
-
-