1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00
cdt/rse/doc/org.eclipse.rse.doc.isv/guide/tutorial/DeveloperSubSystemConfiguration2.html

112 lines
3.8 KiB
HTML
Executable file

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2002, 2006. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<LINK REL="STYLESHEET" HREF="../../book.css" TYPE="text/css">
<title>DeveloperSubSystemFactory Class After Editing For Filter Support</title>
</head>
<body>
<h1>DeveloperSubSystemFactory Class After Editing For Filter Support</h1>
<pre><samp>
package samples.subsystems;
import java.util.Vector;
import org.eclipse.rse.core.subsystems.IConnectorService;
import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.SubSystemConfiguration;
import org.eclipse.rse.core.filters.ISystemFilter;
import org.eclipse.rse.core.filters.ISystemFilterPool;
import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
import org.eclipse.rse.core.filters.ISystemFilter;
import org.eclipse.rse.core.model.IHost;
import samples.RSESamplesPlugin;
/**
* This is our subsystem factory, which creates instances of our subsystems,
* and supplies the subsystem and filter actions to their popup menus.
*/
public class DeveloperSubSystemConfiguration extends SubSystemConfiguration {
/**
* Constructor for DeveloperSubSystemConfiguration.
*/
public DeveloperSubSystemConfiguration() {
super();
}
/**
* Create an instance of our subsystem.
*/
public ISubSystem createSubSystemInternal(IHost conn) {
return new DeveloperSubSystem(conn, getConnectorService(conn));
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.subsystems.ISubSystemConfiguration#getConnectorService(org.eclipse.rse.core.model.IHost)
*/
public IConnectorService getConnectorService(IHost host) {
return DeveloperConnectorServiceManager.getInstance()
.getConnectorService(host, IDeveloperSubSystem.class);
}
/**
* Intercept of parent method that creates an initial default filter pool.
* We intercept so that we can create an initial filter in that pool, which will
* list all teams.
*/
protected ISystemFilterPool createDefaultFilterPool(ISystemFilterPoolManager mgr)
{
ISystemFilterPool defaultPool = null;
try {
defaultPool = mgr.createSystemFilterPool(getDefaultFilterPoolName(mgr.getName(), getId()), true); // true=>is deletable by user
Vector strings = new Vector();
strings.add("*");
I<strong>SystemFilter filter = mgr.createSystemFilter(defaultPool,
RSESamplesPlugin.getResourceString("filter.default.name"),
strings);
filter.setType("team");</strong>
} catch (Exception exc) {}
return defaultPool;
}
/**
* Intercept of parent method so we can supply our own value shown in the property
* sheet for the "type" property when a filter is selected within our subsystem.
*
* Requires this line in rseSamplesResources.properties: property.type.teamfilter=Team filter
*/
public String getTranslatedFilterTypeProperty(ISystemFilter selectedFilter)
{
<strong>String type = selectedFilter.getType();
if (type == null)
type = "team";
if (type.equals("team"))
return RSESamplesPlugin.getResourceString("property.type.teamfilter");
else
return RSESamplesPlugin.getResourceString("property.type.devrfilter");</strong>
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsUserId()
*/
public boolean supportsUserId() {
return false;
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsServerLaunchProperties(org.eclipse.rse.core.model.IHost)
*/
public boolean supportsServerLaunchProperties(IHost host) {
return false;
}
}
</samp></pre>
</body>
</html>