Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

DeveloperAdapterFactory Class After Editing


package samples.model;

import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.rse.ui.view.AbstractSystemRemoteAdapterFactory;
import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
import org.eclipse.ui.views.properties.IPropertySource;

/**
 * This factory maps requests for an adapter object from a given remote object.
 */
public class DeveloperAdapterFactory 
	extends AbstractSystemRemoteAdapterFactory
	implements IAdapterFactory
{
	private TeamResourceAdapter teamAdapter = new TeamResourceAdapter();
	private DeveloperResourceAdapter developerAdapter = new DeveloperResourceAdapter();
	
	/**
	 * Constructor for DeveloperAdapterFactory.
	 */
	public DeveloperAdapterFactory()
	{
		super();
	}

	/**
	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(Object, Class)
	 */
	public Object getAdapter(Object adaptableObject, Class adapterType)
	{
		ISystemViewElementAdapter adapter = null;
		if (adaptableObject instanceof TeamResource)
		  adapter = teamAdapter;
		else if (adaptableObject instanceof DeveloperResource)
		  adapter = developerAdapter;
		// these lines are very important! 
		if ((adapter != null) && (adapterType == IPropertySource.class))
		  adapter.setPropertySourceInput(adaptableObject);
		return adapter;
	}
}


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire