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 nonIJavaProjectspecific bridging.EclipseEnvironmentBridge(org.eclipse.jdt.core.IJavaProject javaProject)Instantiate forIJavaProjectspecific bridging.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPreferenceListener(EnvironmentBridge.PreferenceListener listener)voiddispose()Disposes of resources.java.lang.ClassLoadergetClassLoader()Obtains theClassLoader.OfficeFloorCompilergetOfficeFloorCompiler()Obtains theOfficeFloorCompiler.java.lang.StringgetPreference(java.lang.String preferenceId)Obtains the preference.voidinit(org.eclipse.swt.widgets.Shell parentShell)Initialise.booleanisClassOnClassPath(java.lang.String className)Indicates ifClasson theClasspath.booleanisResourceOnClassPath(java.lang.String resourcePath)Indicates if the resource is on theClasspath.booleanisSuperType(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.voidresetPreference(java.lang.String preferenceId)Resets the preference to default value.voidselectClass(java.lang.String searchText, java.lang.String superTypeName, EnvironmentBridge.SelectionHandler handler)Selects aClass.voidselectClassPathResource(java.lang.String searchText, EnvironmentBridge.SelectionHandler handler)Selects a resource from theClasspath.voidsetPreference(java.lang.String preferenceId, java.lang.String value)Specifies the preference value.
-
-
-
Constructor Detail
-
EclipseEnvironmentBridge
public EclipseEnvironmentBridge(org.eclipse.jdt.core.IJavaProject javaProject)
Instantiate forIJavaProjectspecific bridging.- Parameters:
javaProject-IJavaProject.
-
EclipseEnvironmentBridge
public EclipseEnvironmentBridge()
Initialise for nonIJavaProjectspecific bridging.
-
-
Method Detail
-
init
public void init(org.eclipse.swt.widgets.Shell parentShell)
Initialise.- Parameters:
parentShell- ParentShell.
-
dispose
public void dispose() throws java.io.IOExceptionDisposes of resources.- Throws:
java.io.IOException- If fails to dispose.
-
isClassOnClassPath
public boolean isClassOnClassPath(java.lang.String className) throws java.lang.ExceptionDescription copied from interface:EnvironmentBridgeIndicates ifClasson theClasspath.- Specified by:
isClassOnClassPathin interfaceEnvironmentBridge- Parameters:
className- Name of theClass.- Returns:
trueifClasson theClasspath.- Throws:
java.lang.Exception- If fails to determine if onClasspath.
-
isSuperType
public boolean isSuperType(java.lang.String className, java.lang.String superTypeName) throws java.lang.ExceptionDescription copied from interface:EnvironmentBridgeIndicates if super type.- Specified by:
isSuperTypein interfaceEnvironmentBridge- Parameters:
className- Name ofClass.superTypeName- Super typeClass.- Returns:
trueif 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:EnvironmentBridgeSelects aClass.- Specified by:
selectClassin 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.ExceptionDescription copied from interface:EnvironmentBridgeLoads theClass.- Specified by:
loadClassin 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.ExceptionDescription copied from interface:EnvironmentBridgeObtains theClassLoader.- Specified by:
getClassLoaderin interfaceEnvironmentBridge- Returns:
ClassLoader.- Throws:
java.lang.Exception- If fails to obtainClassLoader.
-
getOfficeFloorCompiler
public OfficeFloorCompiler getOfficeFloorCompiler() throws java.lang.Exception
Description copied from interface:EnvironmentBridgeObtains theOfficeFloorCompiler.- Specified by:
getOfficeFloorCompilerin interfaceEnvironmentBridge- Returns:
OfficeFloorCompiler.- Throws:
java.lang.Exception- If fails to obtainOfficeFloorCompiler.
-
isResourceOnClassPath
public boolean isResourceOnClassPath(java.lang.String resourcePath) throws java.lang.ExceptionDescription copied from interface:EnvironmentBridgeIndicates if the resource is on theClasspath.- Specified by:
isResourceOnClassPathin interfaceEnvironmentBridge- Parameters:
resourcePath- Resource path.- Returns:
trueif the resource is on theClasspath.- Throws:
java.lang.Exception- If fails to determine if onClasspath.
-
selectClassPathResource
public void selectClassPathResource(java.lang.String searchText, EnvironmentBridge.SelectionHandler handler)Description copied from interface:EnvironmentBridgeSelects a resource from theClasspath.- Specified by:
selectClassPathResourcein interfaceEnvironmentBridge- Parameters:
searchText- Search text to find theClasspath resource.handler-EnvironmentBridge.SelectionHandler.
-
getPreference
public java.lang.String getPreference(java.lang.String preferenceId)
Description copied from interface:EnvironmentBridgeObtains the preference.- Specified by:
getPreferencein interfaceEnvironmentBridge- Parameters:
preferenceId- Preference identifier.- Returns:
- Preference value or
nullif no configured.
-
setPreference
public void setPreference(java.lang.String preferenceId, java.lang.String value)Description copied from interface:EnvironmentBridgeSpecifies the preference value.- Specified by:
setPreferencein interfaceEnvironmentBridge- Parameters:
preferenceId- Preference identifier.value- Value for the preference.
-
resetPreference
public void resetPreference(java.lang.String preferenceId)
Description copied from interface:EnvironmentBridgeResets the preference to default value.- Specified by:
resetPreferencein interfaceEnvironmentBridge- Parameters:
preferenceId- Preference identifier.
-
addPreferenceListener
public void addPreferenceListener(EnvironmentBridge.PreferenceListener listener)
Description copied from interface:EnvironmentBridge- Specified by:
addPreferenceListenerin interfaceEnvironmentBridge- Parameters:
listener-EnvironmentBridge.PreferenceListener.
-
-