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,13 +40,11 @@ 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();
@ -67,24 +65,17 @@ public class SystemViewAdapterFactory implements IAdapterFactory
/** /**
* @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);
@ -104,11 +95,11 @@ 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;
@ -138,15 +129,12 @@ public class SystemViewAdapterFactory implements IAdapterFactory
if (adaptableObject instanceof SystemNewConnectionPromptObject) { if (adaptableObject instanceof SystemNewConnectionPromptObject) {
adapter = newConnPromptAdapter; adapter = newConnPromptAdapter;
} } else {
else {
adapter = promptAdapter; adapter = promptAdapter;
} }
} } else if (adaptableObject instanceof SystemTeamViewCategoryNode)
else if (adaptableObject instanceof SystemTeamViewCategoryNode)
adapter = getCategoryAdapter(); adapter = getCategoryAdapter();
else if (adaptableObject instanceof SystemTeamViewSubSystemConfigurationNode) else if (adaptableObject instanceof SystemTeamViewSubSystemConfigurationNode) adapter = getSubSystemConfigurationAdapter();
adapter = getSubSystemConfigurationAdapter();
/** FIXME - UDAs no longer in core /** FIXME - UDAs no longer in core
else if (adaptableObject instanceof SystemTeamViewCompileTypeNode) else if (adaptableObject instanceof SystemTeamViewCompileTypeNode)
@ -157,12 +145,9 @@ public class SystemViewAdapterFactory implements IAdapterFactory
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) {
else if (adapter == null)
{
SystemBasePlugin.logWarning("No adapter found for object of type: " + adaptableObject.getClass().getName()); SystemBasePlugin.logWarning("No adapter found for object of type: " + adaptableObject.getClass().getName());
} }
return adapter; return adapter;
@ -175,8 +160,7 @@ public class SystemViewAdapterFactory implements IAdapterFactory
* 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;
} }
@ -187,8 +171,7 @@ public class SystemViewAdapterFactory implements IAdapterFactory
* 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,8 +182,7 @@ 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;
} }
@ -211,8 +193,7 @@ public class SystemViewAdapterFactory implements IAdapterFactory
* 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;
} }
@ -223,8 +204,7 @@ public class SystemViewAdapterFactory implements IAdapterFactory
* 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;
} }
@ -236,8 +216,7 @@ public class SystemViewAdapterFactory implements IAdapterFactory
* 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;
} }
@ -249,8 +228,7 @@ public class SystemViewAdapterFactory implements IAdapterFactory
* 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;
} }
@ -261,8 +239,7 @@ public class SystemViewAdapterFactory implements IAdapterFactory
* 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;
} }
@ -273,8 +250,7 @@ public class SystemViewAdapterFactory implements IAdapterFactory
* 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;
} }
@ -285,27 +261,23 @@ public class SystemViewAdapterFactory implements IAdapterFactory
* 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;
} }
@ -346,8 +318,7 @@ public class SystemViewAdapterFactory implements IAdapterFactory
* 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;
} }
} }