1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-28 11:25:35 +02:00

[cleanup] format and javadoc

This commit is contained in:
David Dykstal 2006-09-15 19:43:50 +00:00
parent bfd81e0d2c
commit e609ef3517

View file

@ -40,63 +40,54 @@ import org.eclipse.ui.model.IWorkbenchAdapter;
import org.eclipse.ui.progress.IDeferredWorkbenchAdapter; import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
import org.eclipse.ui.views.properties.IPropertySource; import org.eclipse.ui.views.properties.IPropertySource;
/** /**
* This factory maps requests for an adapter object from a given * This factory maps requests for an adapter object from a given
* element object. * element object.
*/ */
public class SystemViewAdapterFactory implements IAdapterFactory public class SystemViewAdapterFactory implements IAdapterFactory {
{
private SystemViewRootInputAdapter rootAdapter = new SystemViewRootInputAdapter(); private SystemViewRootInputAdapter rootAdapter = new SystemViewRootInputAdapter();
private SystemViewConnectionAdapter connectionAdapter= new SystemViewConnectionAdapter(); private SystemViewConnectionAdapter connectionAdapter = new SystemViewConnectionAdapter();
private SystemViewSubSystemAdapter subsystemAdapter = new SystemViewSubSystemAdapter(); private SystemViewSubSystemAdapter subsystemAdapter = new SystemViewSubSystemAdapter();
private SystemViewFilterPoolAdapter filterPoolAdapter= new SystemViewFilterPoolAdapter(); private SystemViewFilterPoolAdapter filterPoolAdapter = new SystemViewFilterPoolAdapter();
private SystemViewFilterAdapter filterAdapter = new SystemViewFilterAdapter(); private SystemViewFilterAdapter filterAdapter = new SystemViewFilterAdapter();
private SystemViewFilterPoolReferenceAdapter filterPoolReferenceAdapter= new SystemViewFilterPoolReferenceAdapter(); private SystemViewFilterPoolReferenceAdapter filterPoolReferenceAdapter = new SystemViewFilterPoolReferenceAdapter();
private SystemViewFilterReferenceAdapter filterReferenceAdapter = new SystemViewFilterReferenceAdapter(); private SystemViewFilterReferenceAdapter filterReferenceAdapter = new SystemViewFilterReferenceAdapter();
private SystemViewMessageAdapter msgAdapter = new SystemViewMessageAdapter(); private SystemViewMessageAdapter msgAdapter = new SystemViewMessageAdapter();
private SystemViewPromptableAdapter promptAdapter = new SystemViewPromptableAdapter(); private SystemViewPromptableAdapter promptAdapter = new SystemViewPromptableAdapter();
private SystemViewNewConnectionPromptAdapter newConnPromptAdapter = new SystemViewNewConnectionPromptAdapter(); private SystemViewNewConnectionPromptAdapter newConnPromptAdapter = new SystemViewNewConnectionPromptAdapter();
private SystemTeamViewProfileAdapter profileAdapter= new SystemTeamViewProfileAdapter(); private SystemTeamViewProfileAdapter profileAdapter = new SystemTeamViewProfileAdapter();
private SystemTeamViewCategoryAdapter categoryAdapter; private SystemTeamViewCategoryAdapter categoryAdapter;
private SystemTeamViewSubSystemConfigurationAdapter subsysFactoryAdapter; private SystemTeamViewSubSystemConfigurationAdapter subsysFactoryAdapter;
private SystemViewFilterStringAdapter filterStringAdapter = new SystemViewFilterStringAdapter(); private SystemViewFilterStringAdapter filterStringAdapter = new SystemViewFilterStringAdapter();
/** /**
* @see IAdapterFactory#getAdapterList() * @see IAdapterFactory#getAdapterList()
*/ */
public Class[] getAdapterList() public Class[] getAdapterList() {
{ return new Class[] { ISystemViewElementAdapter.class, ISystemDragDropAdapter.class, IPropertySource.class, IWorkbenchAdapter.class, IActionFilter.class, IDeferredWorkbenchAdapter.class };
return new Class[] {
ISystemViewElementAdapter.class,
ISystemDragDropAdapter.class,
IPropertySource.class,
IWorkbenchAdapter.class,
IActionFilter.class,
IDeferredWorkbenchAdapter.class
};
} }
/** /**
* Called by our plugin's startup method to register our adaptable object types * Called by our plugin's startup method to register our adaptable object types
* with the platform. We prefer to do it here to isolate/encapsulate all factory * with the platform. We prefer to do it here to isolate/encapsulate all factory
* logic in this one place. * logic in this one place.
* @param manager the adapter manager controlling this factory
*/ */
public void registerWithManager(IAdapterManager manager) public void registerWithManager(IAdapterManager manager) {
{ manager.registerAdapters(this, ISystemViewInputProvider.class);
manager.registerAdapters(this, ISystemViewInputProvider.class); manager.registerAdapters(this, ISystemProfile.class);
manager.registerAdapters(this, ISystemProfile.class);
manager.registerAdapters(this, IHost.class); manager.registerAdapters(this, IHost.class);
manager.registerAdapters(this, ISubSystem.class); manager.registerAdapters(this, ISubSystem.class);
manager.registerAdapters(this, ISystemFilter.class); manager.registerAdapters(this, ISystemFilter.class);
manager.registerAdapters(this, ISystemFilterPool.class); manager.registerAdapters(this, ISystemFilterPool.class);
manager.registerAdapters(this, ISystemFilterPoolReference.class); manager.registerAdapters(this, ISystemFilterPoolReference.class);
manager.registerAdapters(this, ISystemFilterReference.class); manager.registerAdapters(this, ISystemFilterReference.class);
manager.registerAdapters(this, ISystemFilterString.class); manager.registerAdapters(this, ISystemFilterString.class);
manager.registerAdapters(this, ISystemMessageObject.class); manager.registerAdapters(this, ISystemMessageObject.class);
manager.registerAdapters(this, ISystemPromptableObject.class); manager.registerAdapters(this, ISystemPromptableObject.class);
manager.registerAdapters(this, SystemTeamViewCategoryNode.class); manager.registerAdapters(this, SystemTeamViewCategoryNode.class);
manager.registerAdapters(this, SystemTeamViewSubSystemConfigurationNode.class); manager.registerAdapters(this, SystemTeamViewSubSystemConfigurationNode.class);
// FIXME - UDAs no longer in core // FIXME - UDAs no longer in core
@ -104,91 +95,83 @@ public class SystemViewAdapterFactory implements IAdapterFactory
//manager.registerAdapters(this, SystemTeamViewCompileCommandNode.class); //manager.registerAdapters(this, SystemTeamViewCompileCommandNode.class);
//manager.registerAdapters(this, SystemUDActionElement.class); //manager.registerAdapters(this, SystemUDActionElement.class);
} }
/** /**
* @see IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class) * @see IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
*/ */
public Object getAdapter(Object adaptableObject, Class adapterType) public Object getAdapter(Object adaptableObject, Class adapterType) {
{ Object adapter = null;
Object adapter = null; if (adaptableObject instanceof ISystemViewElementAdapter)
if (adaptableObject instanceof ISystemViewElementAdapter) adapter = adaptableObject;
adapter = adaptableObject; else if (adaptableObject instanceof ISystemDragDropAdapter)
else if (adaptableObject instanceof ISystemDragDropAdapter) adapter = adaptableObject;
adapter = adaptableObject; else if (adaptableObject instanceof ISystemViewInputProvider)
else if (adaptableObject instanceof ISystemViewInputProvider) adapter = rootAdapter;
adapter = rootAdapter; else if (adaptableObject instanceof ISystemProfile)
else if (adaptableObject instanceof ISystemProfile) adapter = profileAdapter;
adapter = profileAdapter; else if (adaptableObject instanceof IHost)
else if (adaptableObject instanceof IHost) adapter = connectionAdapter;
adapter = connectionAdapter; else if (adaptableObject instanceof ISubSystem)
else if (adaptableObject instanceof ISubSystem) adapter = subsystemAdapter;
adapter = subsystemAdapter; else if (adaptableObject instanceof ISystemFilterPoolReference)
else if (adaptableObject instanceof ISystemFilterPoolReference) adapter = filterPoolReferenceAdapter;
adapter = filterPoolReferenceAdapter; else if (adaptableObject instanceof ISystemFilterPool)
else if (adaptableObject instanceof ISystemFilterPool) adapter = filterPoolAdapter;
adapter = filterPoolAdapter; else if (adaptableObject instanceof ISystemFilterReference)
else if (adaptableObject instanceof ISystemFilterReference) adapter = filterReferenceAdapter;
adapter = filterReferenceAdapter; else if (adaptableObject instanceof ISystemFilterString)
else if (adaptableObject instanceof ISystemFilterString) adapter = filterStringAdapter;
adapter = filterStringAdapter; else if (adaptableObject instanceof ISystemFilter)
else if (adaptableObject instanceof ISystemFilter) adapter = filterAdapter;
adapter = filterAdapter; else if (adaptableObject instanceof ISystemMessageObject)
else if (adaptableObject instanceof ISystemMessageObject) adapter = msgAdapter;
adapter = msgAdapter; else if (adaptableObject instanceof ISystemPromptableObject) {
else if (adaptableObject instanceof ISystemPromptableObject) {
if (adaptableObject instanceof SystemNewConnectionPromptObject) { if (adaptableObject instanceof SystemNewConnectionPromptObject) {
adapter = newConnPromptAdapter; adapter = newConnPromptAdapter;
} } else {
else { adapter = promptAdapter;
adapter = promptAdapter; }
} } else if (adaptableObject instanceof SystemTeamViewCategoryNode)
} adapter = getCategoryAdapter();
else if (adaptableObject instanceof SystemTeamViewCategoryNode) else if (adaptableObject instanceof SystemTeamViewSubSystemConfigurationNode) adapter = getSubSystemConfigurationAdapter();
adapter = getCategoryAdapter();
else if (adaptableObject instanceof SystemTeamViewSubSystemConfigurationNode)
adapter = getSubSystemConfigurationAdapter();
/** FIXME - UDAs no longer in core /** FIXME - UDAs no longer in core
else if (adaptableObject instanceof SystemTeamViewCompileTypeNode) else if (adaptableObject instanceof SystemTeamViewCompileTypeNode)
adapter = getCompileTypeAdapter(); adapter = getCompileTypeAdapter();
else if (adaptableObject instanceof SystemTeamViewCompileCommandNode) else if (adaptableObject instanceof SystemTeamViewCompileCommandNode)
adapter = getCompileCommandAdapter(); adapter = getCompileCommandAdapter();
else if (adaptableObject instanceof SystemUDActionElement) else if (adaptableObject instanceof SystemUDActionElement)
adapter = getUserActionAdapter(); adapter = getUserActionAdapter();
*/ */
if ((adapter != null) && (adapterType == IPropertySource.class)) if ((adapter != null) && (adapterType == IPropertySource.class)) {
{ ((ISystemViewElementAdapter) adapter).setPropertySourceInput(adaptableObject);
((ISystemViewElementAdapter)adapter).setPropertySourceInput(adaptableObject); } else if (adapter == null) {
} SystemBasePlugin.logWarning("No adapter found for object of type: " + adaptableObject.getClass().getName());
else if (adapter == null) }
{
SystemBasePlugin.logWarning("No adapter found for object of type: " + adaptableObject.getClass().getName());
}
return adapter; return adapter;
} }
/** /**
* Because we use singletons for our adapters, it is possible to speed up * Because we use singletons for our adapters, it is possible to speed up
* access to them by simply returning them from here. * access to them by simply returning them from here.
* <p> * <p>
* This method returns the RSE adapter for root inputs to the RSE * This method returns the RSE adapter for root inputs to the RSE
* @return SystemViewRootInputAdapter * @return SystemViewRootInputAdapter
*/ */
public SystemViewRootInputAdapter getRootInputAdapter() public SystemViewRootInputAdapter getRootInputAdapter() {
{ return rootAdapter;
return rootAdapter; }
}
/** /**
* Because we use singletons for our adapters, it is possible to speed up * Because we use singletons for our adapters, it is possible to speed up
* access to them by simply returning them from here. * access to them by simply returning them from here.
* <p> * <p>
* This method returns the RSE adapter for connection objects * This method returns the RSE adapter for connection objects
* @return SystemViewConnectionAdapter * @return SystemViewConnectionAdapter
*/ */
public SystemViewConnectionAdapter getConnectionAdapter() public SystemViewConnectionAdapter getConnectionAdapter() {
{
return connectionAdapter; return connectionAdapter;
} }
@ -199,155 +182,143 @@ public class SystemViewAdapterFactory implements IAdapterFactory
* This method returns the RSE adapter for profile objects * This method returns the RSE adapter for profile objects
* @return SystemViewProfileAdapter * @return SystemViewProfileAdapter
*/ */
public SystemTeamViewProfileAdapter getProfileAdapter() public SystemTeamViewProfileAdapter getProfileAdapter() {
{
return profileAdapter; return profileAdapter;
} }
/** /**
* Because we use singletons for our adapters, it is possible to speed up * Because we use singletons for our adapters, it is possible to speed up
* access to them by simply returning them from here. * access to them by simply returning them from here.
* <p> * <p>
* This method returns the RSE adapter for filters * This method returns the RSE adapter for filters
* @return SystemViewFilterAdapter * @return SystemViewFilterAdapter
*/ */
public SystemViewFilterAdapter getFilterAdapter() public SystemViewFilterAdapter getFilterAdapter() {
{
return filterAdapter; return filterAdapter;
} }
/** /**
* Because we use singletons for our adapters, it is possible to speed up * Because we use singletons for our adapters, it is possible to speed up
* access to them by simply returning them from here. * access to them by simply returning them from here.
* <p> * <p>
* This method returns the RSE adapter for filter pools * This method returns the RSE adapter for filter pools
* @return SystemViewFilterPoolAdapter * @return SystemViewFilterPoolAdapter
*/ */
public SystemViewFilterPoolAdapter getFilterPoolAdapter() public SystemViewFilterPoolAdapter getFilterPoolAdapter() {
{
return filterPoolAdapter; return filterPoolAdapter;
} }
/** /**
* Because we use singletons for our adapters, it is possible to speed up * Because we use singletons for our adapters, it is possible to speed up
* access to them by simply returning them from here. * access to them by simply returning them from here.
* <p> * <p>
* This method returns the RSE adapter for filter pool references, which * This method returns the RSE adapter for filter pool references, which
* are what we actually see in the RSE. * are what we actually see in the RSE.
* @return SystemViewFilterPoolReferenceAdapter * @return SystemViewFilterPoolReferenceAdapter
*/ */
public SystemViewFilterPoolReferenceAdapter getFilterPoolReferenceAdapter() public SystemViewFilterPoolReferenceAdapter getFilterPoolReferenceAdapter() {
{
return filterPoolReferenceAdapter; return filterPoolReferenceAdapter;
} }
/** /**
* Because we use singletons for our adapters, it is possible to speed up * Because we use singletons for our adapters, it is possible to speed up
* access to them by simply returning them from here. * access to them by simply returning them from here.
* <p> * <p>
* This method returns the RSE adapter for filter references, which are * This method returns the RSE adapter for filter references, which are
* what we actually see in the RSE * what we actually see in the RSE
* @return SystemViewFilterReferenceAdapter * @return SystemViewFilterReferenceAdapter
*/ */
public SystemViewFilterReferenceAdapter getFilterReferenceAdapter() public SystemViewFilterReferenceAdapter getFilterReferenceAdapter() {
{
return filterReferenceAdapter; return filterReferenceAdapter;
} }
/** /**
* Because we use singletons for our adapters, it is possible to speed up * Because we use singletons for our adapters, it is possible to speed up
* access to them by simply returning them from here. * access to them by simply returning them from here.
* <p> * <p>
* This method returns the RSE adapter for messages shown in the RSE as child objects * This method returns the RSE adapter for messages shown in the RSE as child objects
* @return SystemViewMessageAdapter * @return SystemViewMessageAdapter
*/ */
public SystemViewMessageAdapter getMsgAdapter() public SystemViewMessageAdapter getMsgAdapter() {
{
return msgAdapter; return msgAdapter;
} }
/** /**
* Because we use singletons for our adapters, it is possible to speed up * Because we use singletons for our adapters, it is possible to speed up
* access to them by simply returning them from here. * access to them by simply returning them from here.
* <p> * <p>
* This method returns the RSE adapter for promptable objects the run an action when expanded * This method returns the RSE adapter for promptable objects the run an action when expanded
* @return SystemViewPromptableAdapter * @return SystemViewPromptableAdapter
*/ */
public SystemViewPromptableAdapter getPromptAdapter() public SystemViewPromptableAdapter getPromptAdapter() {
{
return promptAdapter; return promptAdapter;
} }
/** /**
* Because we use singletons for our adapters, it is possible to speed up * Because we use singletons for our adapters, it is possible to speed up
* access to them by simply returning them from here. * access to them by simply returning them from here.
* <p> * <p>
* This method returns the RSE adapter for subsystems * This method returns the RSE adapter for subsystems
* @return SystemViewSubSystemAdapter * @return SystemViewSubSystemAdapter
*/ */
public SystemViewSubSystemAdapter getSubSystemAdapter() public SystemViewSubSystemAdapter getSubSystemAdapter() {
{
return subsystemAdapter; return subsystemAdapter;
} }
/** /**
* Return adapter for category nodes in team view * @return adapter for category nodes in team view
*/ */
public SystemTeamViewCategoryAdapter getCategoryAdapter() public SystemTeamViewCategoryAdapter getCategoryAdapter() {
{ if (categoryAdapter == null) categoryAdapter = new SystemTeamViewCategoryAdapter();
if (categoryAdapter == null)
categoryAdapter = new SystemTeamViewCategoryAdapter();
return categoryAdapter; return categoryAdapter;
} }
/** /**
* Return adapter for subsystem factory nodes in team view * @return adapter for subsystem factory nodes in team view
*/ */
public SystemTeamViewSubSystemConfigurationAdapter getSubSystemConfigurationAdapter() public SystemTeamViewSubSystemConfigurationAdapter getSubSystemConfigurationAdapter() {
{ if (subsysFactoryAdapter == null) subsysFactoryAdapter = new SystemTeamViewSubSystemConfigurationAdapter();
if (subsysFactoryAdapter == null)
subsysFactoryAdapter = new SystemTeamViewSubSystemConfigurationAdapter();
return subsysFactoryAdapter; return subsysFactoryAdapter;
} }
// FIXME user actions and compile commands no longer coupled with core // FIXME user actions and compile commands no longer coupled with core
// /** // /**
// * Return adapter for user actions nodes in team view // * Return adapter for user actions nodes in team view
// */ // */
// public SystemTeamViewUserActionAdapter getUserActionAdapter() // public SystemTeamViewUserActionAdapter getUserActionAdapter()
// { // {
// if (userActionAdapter == null) // if (userActionAdapter == null)
// userActionAdapter = new SystemTeamViewUserActionAdapter(); // userActionAdapter = new SystemTeamViewUserActionAdapter();
// return userActionAdapter; // return userActionAdapter;
// } // }
// //
// /** // /**
// * Return adapter for compile type nodes in team view // * Return adapter for compile type nodes in team view
// */ // */
// public SystemTeamViewCompileTypeAdapter getCompileTypeAdapter() // public SystemTeamViewCompileTypeAdapter getCompileTypeAdapter()
// { // {
// if (compileTypeAdapter == null) // if (compileTypeAdapter == null)
// compileTypeAdapter = new SystemTeamViewCompileTypeAdapter(); // compileTypeAdapter = new SystemTeamViewCompileTypeAdapter();
// return compileTypeAdapter; // return compileTypeAdapter;
// } // }
// /** // /**
// * Return adapter for compile command nodes in team view // * Return adapter for compile command nodes in team view
// */ // */
// public SystemTeamViewCompileCommandAdapter getCompileCommandAdapter() // public SystemTeamViewCompileCommandAdapter getCompileCommandAdapter()
// { // {
// if (compileCmdAdapter == null) // if (compileCmdAdapter == null)
// compileCmdAdapter = new SystemTeamViewCompileCommandAdapter(); // compileCmdAdapter = new SystemTeamViewCompileCommandAdapter();
// return compileCmdAdapter; // return compileCmdAdapter;
// } // }
/** /**
* Because we use singletons for our adapters, it is possible to speed up * Because we use singletons for our adapters, it is possible to speed up
* access to them by simply returning them from here. * access to them by simply returning them from here.
* <p> * <p>
* This method returns the RSE adapter for filter strings * This method returns the RSE adapter for filter strings
* @return SystemViewFilterStringAdapter * @return SystemViewFilterStringAdapter
*/ */
public SystemViewFilterStringAdapter getFilterStringAdapter() public SystemViewFilterStringAdapter getFilterStringAdapter() {
{
return filterStringAdapter; return filterStringAdapter;
} }
} }