Package net.officefloor.gef.bridge
Interface EnvironmentBridge
-
- All Known Implementing Classes:
ClassLoaderEnvironmentBridge
,EclipseEnvironmentBridge
public interface EnvironmentBridge
Bridges the editor to the environment.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
EnvironmentBridge.PreferenceEvent
Preference event.static interface
EnvironmentBridge.PreferenceListener
Preference listener.static interface
EnvironmentBridge.SelectionHandler
Handles selection result.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addPreferenceListener(EnvironmentBridge.PreferenceListener listener)
java.lang.ClassLoader
getClassLoader()
Obtains theClassLoader
.OfficeFloorCompiler
getOfficeFloorCompiler()
Obtains theOfficeFloorCompiler
.java.lang.String
getPreference(java.lang.String preferenceId)
Obtains the preference.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 superType)
Indicates if super type.<S> java.lang.Class<? extends S>
loadClass(java.lang.String className, java.lang.Class<S> superType)
Loads theClass
.void
resetPreference(java.lang.String preferenceId)
Resets the preference to default value.void
selectClass(java.lang.String searchText, java.lang.String superType, 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.
-
-
-
Method Detail
-
isClassOnClassPath
boolean isClassOnClassPath(java.lang.String className) throws java.lang.Exception
Indicates ifClass
on theClass
path.- Parameters:
className
- Name of theClass
.- Returns:
true
ifClass
on theClass
path.- Throws:
java.lang.Exception
- If fails to determine if onClass
path.
-
isSuperType
boolean isSuperType(java.lang.String className, java.lang.String superType) throws java.lang.Exception
Indicates if super type.- Parameters:
className
- Name ofClass
.superType
- Super typeClass
.- Returns:
true
if super typeClass
.- Throws:
java.lang.Exception
- If fails to determine if super type.
-
loadClass
<S> java.lang.Class<? extends S> loadClass(java.lang.String className, java.lang.Class<S> superType) throws java.lang.Exception
Loads theClass
.- Type Parameters:
S
- Super type.- Parameters:
className
- Name ofClass
.superType
- Super type required ofClass
.- Returns:
Class
.- Throws:
java.lang.Exception
- If fails to load theClass
.
-
getClassLoader
java.lang.ClassLoader getClassLoader() throws java.lang.Exception
Obtains theClassLoader
.- Returns:
ClassLoader
.- Throws:
java.lang.Exception
- If fails to obtainClassLoader
.
-
getOfficeFloorCompiler
OfficeFloorCompiler getOfficeFloorCompiler() throws java.lang.Exception
Obtains theOfficeFloorCompiler
.- Returns:
OfficeFloorCompiler
.- Throws:
java.lang.Exception
- If fails to obtainOfficeFloorCompiler
.
-
selectClass
void selectClass(java.lang.String searchText, java.lang.String superType, EnvironmentBridge.SelectionHandler handler)
Selects aClass
.- Parameters:
searchText
- Search text to find theClass
.superType
- Super type of theClass
.handler
-EnvironmentBridge.SelectionHandler
.
-
isResourceOnClassPath
boolean isResourceOnClassPath(java.lang.String resourcePath) throws java.lang.Exception
Indicates if the resource is on theClass
path.- 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
void selectClassPathResource(java.lang.String searchText, EnvironmentBridge.SelectionHandler handler)
Selects a resource from theClass
path.- Parameters:
searchText
- Search text to find theClass
path resource.handler
-EnvironmentBridge.SelectionHandler
.
-
getPreference
java.lang.String getPreference(java.lang.String preferenceId)
Obtains the preference.- Parameters:
preferenceId
- Preference identifier.- Returns:
- Preference value or
null
if no configured.
-
setPreference
void setPreference(java.lang.String preferenceId, java.lang.String value)
Specifies the preference value.- Parameters:
preferenceId
- Preference identifier.value
- Value for the preference.
-
resetPreference
void resetPreference(java.lang.String preferenceId)
Resets the preference to default value.- Parameters:
preferenceId
- Preference identifier.
-
addPreferenceListener
void addPreferenceListener(EnvironmentBridge.PreferenceListener listener)
- Parameters:
listener
-EnvironmentBridge.PreferenceListener
.
-
-