mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-19 06:55:23 +02:00
formatting
This commit is contained in:
parent
891609edee
commit
48487d25a8
1 changed files with 134 additions and 145 deletions
|
@ -15,6 +15,7 @@
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.filters;
|
package org.eclipse.rse.internal.filters;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IAdaptable;
|
import org.eclipse.core.runtime.IAdaptable;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Platform;
|
||||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||||
|
@ -29,121 +30,115 @@ import org.eclipse.rse.filters.ISystemFilterReference;
|
||||||
import org.eclipse.rse.internal.references.SystemPersistableReferencingObject;
|
import org.eclipse.rse.internal.references.SystemPersistableReferencingObject;
|
||||||
import org.eclipse.rse.references.ISystemPersistableReferencedObject;
|
import org.eclipse.rse.references.ISystemPersistableReferencedObject;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A shadow object of a master filter pool
|
* A shadow object of a master filter pool
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @lastgen class SystemFilterPoolReferenceImpl extends SystemPersistableReferencingObjectImpl implements SystemFilterPoolReference, SystemFilterContainerReference, IAdaptable {}
|
* @lastgen class SystemFilterPoolReferenceImpl extends SystemPersistableReferencingObjectImpl implements SystemFilterPoolReference, SystemFilterContainerReference, IAdaptable {}
|
||||||
*/
|
*/
|
||||||
public class SystemFilterPoolReference extends SystemPersistableReferencingObject
|
public class SystemFilterPoolReference extends SystemPersistableReferencingObject implements ISystemFilterPoolReference, ISystemFilterContainerReference, IAdaptable {
|
||||||
implements ISystemFilterPoolReference, ISystemFilterContainerReference, IAdaptable
|
private SystemFilterContainerReferenceCommonMethods containerHelper = null;
|
||||||
{
|
|
||||||
private SystemFilterContainerReferenceCommonMethods containerHelper = null;
|
|
||||||
protected static final String DELIMITER = "___";
|
protected static final String DELIMITER = "___";
|
||||||
protected static final int DELIMITER_LENGTH = 3;
|
protected static final int DELIMITER_LENGTH = 3;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor. Typically called by MOF factory method.
|
* Default constructor. Typically called by MOF factory method.
|
||||||
*/
|
*/
|
||||||
protected SystemFilterPoolReference()
|
protected SystemFilterPoolReference() {
|
||||||
{
|
|
||||||
super();
|
super();
|
||||||
containerHelper = new SystemFilterContainerReferenceCommonMethods(this);
|
containerHelper = new SystemFilterContainerReferenceCommonMethods(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the reference manager which is managing this filter reference
|
* Return the reference manager which is managing this filter reference
|
||||||
* framework object.
|
* framework object.
|
||||||
*/
|
*/
|
||||||
public ISystemFilterPoolReferenceManager getFilterPoolReferenceManager()
|
public ISystemFilterPoolReferenceManager getFilterPoolReferenceManager() {
|
||||||
{
|
return (ISystemFilterPoolReferenceManager) getParentReferenceManager();
|
||||||
return (ISystemFilterPoolReferenceManager)getParentReferenceManager();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the object which instantiated the pool reference manager object.
|
* Return the object which instantiated the pool reference manager object.
|
||||||
* Makes it easy to get back to the point of origin, given any filter reference
|
* Makes it easy to get back to the point of origin, given any filter reference
|
||||||
* framework object
|
* framework object
|
||||||
*/
|
*/
|
||||||
public ISystemFilterPoolReferenceManagerProvider getProvider()
|
public ISystemFilterPoolReferenceManagerProvider getProvider() {
|
||||||
{
|
ISystemFilterPoolReferenceManager mgr = getFilterPoolReferenceManager();
|
||||||
ISystemFilterPoolReferenceManager mgr = getFilterPoolReferenceManager();
|
if (mgr != null)
|
||||||
if (mgr != null)
|
return mgr.getProvider();
|
||||||
return mgr.getProvider();
|
else
|
||||||
else
|
return null;
|
||||||
return null;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the method required by the IAdaptable interface.
|
* This is the method required by the IAdaptable interface.
|
||||||
* Given an adapter class type, return an object castable to the type, or
|
* Given an adapter class type, return an object castable to the type, or
|
||||||
* null if this is not possible.
|
* null if this is not possible.
|
||||||
*/
|
*/
|
||||||
public Object getAdapter(Class adapterType)
|
public Object getAdapter(Class adapterType) {
|
||||||
{
|
return Platform.getAdapterManager().getAdapter(this, adapterType);
|
||||||
return Platform.getAdapterManager().getAdapter(this, adapterType);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return name of the filter pool we reference
|
|
||||||
* The name is stored qualified by the manager name,
|
|
||||||
* so we first have to strip that off.
|
|
||||||
*/
|
|
||||||
public String getReferencedFilterPoolName()
|
|
||||||
{
|
|
||||||
String savedName = super.getReferencedObjectName();
|
|
||||||
String poolName = null;
|
|
||||||
int idx = savedName.indexOf(DELIMITER);
|
|
||||||
if (idx >= 0)
|
|
||||||
poolName = savedName.substring(idx+DELIMITER_LENGTH);
|
|
||||||
else
|
|
||||||
poolName = savedName;
|
|
||||||
return poolName;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Return name of the filter pool manager containing the pool we reference.
|
|
||||||
* The pool name is stored qualified by the manager name,
|
|
||||||
* so we get it from there.
|
|
||||||
*/
|
|
||||||
public String getReferencedFilterPoolManagerName()
|
|
||||||
{
|
|
||||||
String savedName = super.getReferencedObjectName();
|
|
||||||
String mgrName = null;
|
|
||||||
int idx = savedName.indexOf(DELIMITER);
|
|
||||||
if (idx >= 0)
|
|
||||||
mgrName = savedName.substring(0,idx);
|
|
||||||
else
|
|
||||||
mgrName = savedName;
|
|
||||||
return mgrName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reset the name of the filter pool we reference.
|
|
||||||
* Called on filter pool rename operations
|
|
||||||
*/
|
|
||||||
public void resetReferencedFilterPoolName(String newName)
|
|
||||||
{
|
|
||||||
super.setReferencedObjectName(newName);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the filter pool that we reference.
|
|
||||||
* This also calls addReference(this) on that pool!
|
|
||||||
*/
|
|
||||||
public void setReferenceToFilterPool(ISystemFilterPool pool)
|
|
||||||
{
|
|
||||||
super.setReferencedObject((ISystemPersistableReferencedObject)pool);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return referenced filter pool object
|
|
||||||
*/
|
|
||||||
public ISystemFilterPool getReferencedFilterPool()
|
|
||||||
{
|
|
||||||
return (ISystemFilterPool)getReferencedObject();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return name of the filter pool we reference
|
||||||
|
* The name is stored qualified by the manager name,
|
||||||
|
* so we first have to strip that off.
|
||||||
|
*/
|
||||||
|
public String getReferencedFilterPoolName() {
|
||||||
|
String savedName = super.getReferencedObjectName();
|
||||||
|
String poolName = null;
|
||||||
|
int idx = savedName.indexOf(DELIMITER);
|
||||||
|
if (idx >= 0)
|
||||||
|
poolName = savedName.substring(idx + DELIMITER_LENGTH);
|
||||||
|
else
|
||||||
|
poolName = savedName;
|
||||||
|
return poolName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return name of the filter pool manager containing the pool we reference.
|
||||||
|
* The pool name is stored qualified by the manager name,
|
||||||
|
* so we get it from there.
|
||||||
|
*/
|
||||||
|
public String getReferencedFilterPoolManagerName() {
|
||||||
|
String savedName = super.getReferencedObjectName();
|
||||||
|
String mgrName = null;
|
||||||
|
int idx = savedName.indexOf(DELIMITER);
|
||||||
|
if (idx >= 0)
|
||||||
|
mgrName = savedName.substring(0, idx);
|
||||||
|
else
|
||||||
|
mgrName = savedName;
|
||||||
|
return mgrName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset the name of the filter pool we reference.
|
||||||
|
* Called on filter pool rename operations
|
||||||
|
*/
|
||||||
|
public void resetReferencedFilterPoolName(String newName) {
|
||||||
|
super.setReferencedObjectName(newName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the filter pool that we reference.
|
||||||
|
* This also calls addReference(this) on that pool!
|
||||||
|
*/
|
||||||
|
public void setReferenceToFilterPool(ISystemFilterPool pool) {
|
||||||
|
super.setReferencedObject((ISystemPersistableReferencedObject) pool);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return referenced filter pool object. If the reference is unresolved it will
|
||||||
|
* attempt to resolve it.
|
||||||
|
*/
|
||||||
|
public ISystemFilterPool getReferencedFilterPool() {
|
||||||
|
ISystemFilterPool filterPool = (ISystemFilterPool) getReferencedObject();
|
||||||
|
if (filterPool == null) {
|
||||||
|
|
||||||
|
}
|
||||||
|
return filterPool;
|
||||||
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------
|
// -------------------------------------------------------------
|
||||||
// Methods common with SystemFilterPoolReferenceImpl, and hence
|
// Methods common with SystemFilterPoolReferenceImpl, and hence
|
||||||
// abstracted out into SystemFilterContainerReference...
|
// abstracted out into SystemFilterContainerReference...
|
||||||
|
@ -157,10 +152,10 @@ public class SystemFilterPoolReference extends SystemPersistableReferencingObjec
|
||||||
* true that we only hold a SystemFilter. Hence, this is the same
|
* true that we only hold a SystemFilter. Hence, this is the same
|
||||||
* as calling getReferenceFilter and casting the result.
|
* as calling getReferenceFilter and casting the result.
|
||||||
*/
|
*/
|
||||||
public ISystemFilterContainer getReferencedSystemFilterContainer()
|
public ISystemFilterContainer getReferencedSystemFilterContainer() {
|
||||||
{
|
|
||||||
return getReferencedFilterPool();
|
return getReferencedFilterPool();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build and return an array of SystemFilterReference objects.
|
* Build and return an array of SystemFilterReference objects.
|
||||||
* Each object is created new. There is one for each of the filters
|
* Each object is created new. There is one for each of the filters
|
||||||
|
@ -169,67 +164,61 @@ public class SystemFilterPoolReference extends SystemPersistableReferencingObjec
|
||||||
* return a fresh one if something changes in the underlying
|
* return a fresh one if something changes in the underlying
|
||||||
* filter list.
|
* filter list.
|
||||||
*/
|
*/
|
||||||
public ISystemFilterReference[] getSystemFilterReferences(ISubSystem subSystem)
|
public ISystemFilterReference[] getSystemFilterReferences(ISubSystem subSystem) {
|
||||||
{
|
|
||||||
return containerHelper.getSystemFilterReferences(subSystem);
|
return containerHelper.getSystemFilterReferences(subSystem);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Create a single filter refererence to a given filter.
|
|
||||||
* If there already is a reference to this filter, it is returned.
|
|
||||||
* If not, a new reference is created and appended to the end of the existing filter reference array.
|
|
||||||
* @see #getExistingSystemFilterReference(ISystemFilter)
|
|
||||||
*/
|
|
||||||
public ISystemFilterReference getSystemFilterReference(ISubSystem subSystem, ISystemFilter filter)
|
|
||||||
{
|
|
||||||
//return containerHelper.generateFilterReference(filter);
|
|
||||||
return containerHelper.generateAndRecordFilterReference(subSystem, filter);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Return an existing reference to a given system filter.
|
|
||||||
* If no reference currently exists to this filter, returns null.
|
|
||||||
* @see #getSystemFilterReference(ISystemFilter)
|
|
||||||
*/
|
|
||||||
public ISystemFilterReference getExistingSystemFilterReference(ISubSystem subSystem, ISystemFilter filter)
|
|
||||||
{
|
|
||||||
return containerHelper.getExistingSystemFilterReference(subSystem, filter);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if the referenced pool or filter has filters.
|
* Create a single filter refererence to a given filter.
|
||||||
*/
|
* If there already is a reference to this filter, it is returned.
|
||||||
public boolean hasFilters()
|
* If not, a new reference is created and appended to the end of the existing filter reference array.
|
||||||
{
|
* @see #getExistingSystemFilterReference(ISystemFilter)
|
||||||
return containerHelper.hasFilters();
|
*/
|
||||||
}
|
public ISystemFilterReference getSystemFilterReference(ISubSystem subSystem, ISystemFilter filter) {
|
||||||
|
//return containerHelper.generateFilterReference(filter);
|
||||||
|
return containerHelper.generateAndRecordFilterReference(subSystem, filter);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return count of the number of filters in the referenced pool or filter
|
* Return an existing reference to a given system filter.
|
||||||
*/
|
* If no reference currently exists to this filter, returns null.
|
||||||
public int getFilterCount()
|
* @see #getSystemFilterReference(ISystemFilter)
|
||||||
{
|
*/
|
||||||
return containerHelper.getFilterCount();
|
public ISystemFilterReference getExistingSystemFilterReference(ISubSystem subSystem, ISystemFilter filter) {
|
||||||
}
|
return containerHelper.getExistingSystemFilterReference(subSystem, filter);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the name of the SystemFilter or SystemFilterPool that we reference.
|
* Return true if the referenced pool or filter has filters.
|
||||||
* For such objects this is what we show in the GUI.
|
*/
|
||||||
*/
|
public boolean hasFilters() {
|
||||||
public String getName()
|
return containerHelper.hasFilters();
|
||||||
{
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return count of the number of filters in the referenced pool or filter
|
||||||
|
*/
|
||||||
|
public int getFilterCount() {
|
||||||
|
return containerHelper.getFilterCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the name of the SystemFilter or SystemFilterPool that we reference.
|
||||||
|
* For such objects this is what we show in the GUI.
|
||||||
|
*/
|
||||||
|
public String getName() {
|
||||||
return getReferencedFilterPoolName();
|
return getReferencedFilterPoolName();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return fully qualified name that includes the filter pool managers name
|
* Return fully qualified name that includes the filter pool managers name
|
||||||
*/
|
*/
|
||||||
public String getFullName()
|
public String getFullName() {
|
||||||
{
|
return super.getReferencedObjectName();
|
||||||
return super.getReferencedObjectName();
|
}
|
||||||
}
|
|
||||||
|
public boolean commit() {
|
||||||
public boolean commit()
|
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
// return RSEUIPlugin.getThePersistenceManager().commit(getProvider().);
|
// return RSEUIPlugin.getThePersistenceManager().commit(getProvider().);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue