diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilter.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilter.java index d7ff35daad9..583a93caca3 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilter.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. + * Copyright (c) 2003, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -12,7 +12,7 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David Dykstal (IBM) - cleanup format and javadoc *******************************************************************************/ package org.eclipse.rse.core.filters; @@ -24,40 +24,15 @@ import org.eclipse.rse.core.model.IRSEModelObject; import org.eclipse.rse.core.references.IRSEReferencedObject; /** - * A representation of the model object 'System Filter'. * A filter consists of filter strings and may be contained in a filter pool. - * Filter pools will be referenced by subsystems. + * Filter pools are referenced by subsystems. * Subsystems are responsible for interpreting the filters. Filters, in and * of themselves, provide no interpretation of themselves when applied * to the resources managed by a subsystem. - *
- * The following features are supported: - *
- * If the meaning of the 'Relative Order' attribute isn't clear, - * there really should be more of a description here... + * The relative order of a filter is intended to be used + * by a persistence mechanism to keep the filters in a particular order + * when restoring them into a filter pool. Filters with higher numbers should + * occur later in the pool. It may be employed in the absence of another + * mechanism for maintaining order. *
* * @return the value of the 'Relative Order' attribute. @@ -150,6 +128,11 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai /** * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#getRelativeOrder Relative Order}' attribute. * + * The relative order of a filter is intended to be used + * by a persistence mechanism to keep the filters in a particular order + * when restoring them into a filter pool. Filters with higher numbers should + * occur later in the pool. It may be employed in the absence of another + * mechanism for maintaining order. * * @param value the new value of the 'Relative Order' attribute. * @see #getRelativeOrder() @@ -160,8 +143,11 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai * Returns the value of the 'Default' attribute. * *- * If the meaning of the 'Default' attribute isn't clear, - * there really should be more of a description here... + * This filter is a "default" filter in this filter pool. + * The meaning of "default" is determined by the subsystem in which it is deployed. + * It typically means that the filter is supplied by the subsystem at the time the subsystem is created. + * That is, the filter is "vendor supplied". + * There is no restriction on the number of default filters in a pool. *
* * @return the value of the 'Default' attribute. @@ -172,6 +158,11 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai /** * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isDefault Default}' attribute. * + * Make this filter is a "default" filter in this filter pool. + * The meaning of "default" is determined by the subsystem in which it is deployed. + * It typically means that the filter is supplied by the subsystem at the time the subsystem is created. + * That is, the filter is "vendor supplied". + * There is no restriction on the number of default filters in a pool. * * @param value the new value of the 'Default' attribute. * @see #isDefault() @@ -187,6 +178,10 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai * case sensitive. * This attribute is optional and may be known (set) or unknown (unset). * + *+ * If unset the value + * returned is from the parent filter pool. + *
* * @return the value of the 'Strings Case Sensitive' attribute. * @see #isSetStringsCaseSensitive() @@ -204,6 +199,9 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai * case sensitive. * This attribute is optional and may be known (set) or unknown (unset). * + *+ * This will cause this attribute to be set in this filter. + *
* * @param value the new value of the 'Strings Case Sensitive' attribute. * @see #isSetStringsCaseSensitive() @@ -220,6 +218,8 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai * to indicate whether or not comparisons involving the filter should be considered * case sensitive. * This attribute is optional and may be known (set) or unknown (unset). + *+ * Causes this filter to use the value specified by the parent filter pool. *
* * @see #isSetStringsCaseSensitive() @@ -236,6 +236,9 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai * to indicate whether or not comparisons involving the filter should be considered * case sensitive. * This attribute is optional and may be known (set) or unknown (unset). + *+ * This will be true if this attribute is explicitly specified for this filter. It will be false if this + * is being inherited from the parent filter pool. *
* * @return whether the value of the 'Strings Case Sensitive' attribute is set. @@ -452,8 +455,8 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai * filter contains only one string. May, alternatively, be enforced * by the filter implementation. *- * This attribute may be set or unset. If unset then this value must not be - * relied upon. + * This attribute may be set or unset. If unset this value will be inherited + * from the parent filter pool. *
* * @return the value of the 'Single Filter String Only' attribute. @@ -472,8 +475,8 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai * filter contains only one string. May, alternatively, be enforced * by the filter implementation. *- * This attribute may be set or unset. If unset then this value must not be - * relied upon. + * This causes the attribute to be set for this filter, ignoring the value + * specified for the parent filter pool. *
* * @param value the new value of the 'Single Filter String Only' attribute. @@ -486,6 +489,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai /** * Unsets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isSingleFilterStringOnly Single Filter String Only}' attribute. * + * This causes the value of this attribute to be inherited from the parent filter pool. * * @see #isSetSingleFilterStringOnly() * @see #isSingleFilterStringOnly() @@ -496,6 +500,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai /** * Returns whether the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isSingleFilterStringOnly Single Filter String Only}' attribute is set. * + * If true then the value of this attribute is set in this filter. If false it is inherited from the parent filter pool. * * @return whether the value of the 'Single Filter String Only' attribute is set. * @see #unsetSingleFilterStringOnly() @@ -550,7 +555,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai * * @return the value of the 'Strings' containment reference list. */ - java.util.List getStrings(); + List getStrings(); /** * @return the parent pool of this filter. For nested filters, this will walk up the parent chain diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPool.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPool.java index b08169a5f2b..f922e4bd62b 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPool.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPool.java @@ -194,19 +194,20 @@ public interface ISystemFilterPool extends IRSEPersistableReferencedObject, ISys void setDefault(boolean value); /** - * @generated This field/method will be replaced during code generation + * Sets the attribute for this filter pool that determines whether strings of + * filters contained in this pool are case sensitive or not. If not set + * this attribute is inherited from the containing filter pool manager. * @param value The new value of the StringsCaseSensitive attribute */ void setStringsCaseSensitive(boolean value); /** - * @generated This field/method will be replaced during code generation - * Unsets the StringsCaseSensitive attribute + * Unsets the StringsCaseSensitive attribute. Causes the case sensitivity of the + * filter pool to be determined by its filter pool manager. */ void unsetStringsCaseSensitive(); /** - * @generated This field/method will be replaced during code generation * @return true if the StringsCaseSensitive attribute has been set */ boolean isSetStringsCaseSensitive(); @@ -247,8 +248,8 @@ public interface ISystemFilterPool extends IRSEPersistableReferencedObject, ISys * Returns the value of the 'Single Filter String Only' attribute. * *- * If the meaning of the 'Single Filter String Only' attribute isn't clear, - * there really should be more of a description here... + * If true then filters in this filter pool can have only a single filter string unless the + * filter has overriden this attribute. *
* * @return the value of the 'Single Filter String Only' attribute. @@ -261,6 +262,8 @@ public interface ISystemFilterPool extends IRSEPersistableReferencedObject, ISys /** * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilterPool#isSingleFilterStringOnly Single Filter String Only}' attribute. * + * If set to true filters in this filter pool can hold only a single filter string unless overridden by the filter itself. + * If false then the filter may hold more than one filter string. * * @param value the new value of the 'Single Filter String Only' attribute. * @see #isSetSingleFilterStringOnly() @@ -273,6 +276,7 @@ public interface ISystemFilterPool extends IRSEPersistableReferencedObject, ISys /** * Unsets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilterPool#isSingleFilterStringOnly Single Filter String Only}' attribute. * + * Causes the value of the single filter string attribute to be inherited from the containing filter pool manager. * * @see #isSetSingleFilterStringOnly() * @see #isSingleFilterStringOnly() @@ -284,6 +288,8 @@ public interface ISystemFilterPool extends IRSEPersistableReferencedObject, ISys /** * Returns whether the value of the '{@link org.eclipse.rse.core.filters.ISystemFilterPool#isSingleFilterStringOnly Single Filter String Only}' attribute is set. * + * This will be true if this attribute has been set for this filter pool. It will be false if this + * attribute is inherited from the filter pool manager. * * @return whether the value of the 'Single Filter String Only' attribute is set. * @see #unsetSingleFilterStringOnly() diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/SystemFilterSimple.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/SystemFilterSimple.java index 57e5c71f82f..9e2875f536f 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/SystemFilterSimple.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/SystemFilterSimple.java @@ -31,13 +31,11 @@ import org.eclipse.rse.core.model.ISystemContentsType; import org.eclipse.rse.internal.core.filters.SystemFilter; /** - * A lightweight override of the full-fledged persistable implementation of SystemFilter. - * This class replaces the heavy-weight MOF implementations with simple non-MOF - * implementations. + * A lightweight implementation of ISystemFilter. *- * This flavour of SystemFilter implementation is for those cases where a simple in-memory - * SystemFilter is needed temporarily, perhaps to populate a GUI widget say, and the filter - * does not need to be savable/restorable. As a result there is no mof, and no need for a + * This flavor is for those cases where a simple in-memory + * ISystemFilter is needed temporarily, perhaps to populate a GUI widget say, and the filter + * does not need to be savable/restorable. As a result there is no need for a * parent SystemFilterPool or SystemFilterPoolManager. The class is small, simple and * directly instantiable. *
@@ -56,43 +54,27 @@ public class SystemFilterSimple extends SystemFilter implements ISystemContainer private String type = null; private boolean caseSensitive = false; private boolean promptable = false; - private Object parent; - private boolean isStale; + private boolean isStale = true; + private Object parent = null; private List filterStrings = new ArrayList(3); - private HashMap cachedContents; + private HashMap cachedContents = new HashMap(); /** - * Constructor for SystemFilterSimpleImpl + * Constructor for SystemFilterSimple */ public SystemFilterSimple(String name) { - //super(); this.name = name; -// filterStringVector = new Vector(); - isStale = true; - cachedContents = new HashMap(); } -// protected void invalidateCache() -// { -// filterStringArray = null; -// filterStringObjectArray = null; -// //filterStringVector = null; -// } - - /** - * Return true if this a transient or simple filter that is only created temporary "on the fly" - * and not intended to be saved or part of the filter framework. Eg it has no manager or provider. - *
- * We always return true
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.internal.core.filters.SystemFilter#isTransient()
*/
public boolean isTransient() {
return true;
}
- /**
- * Clones a given filter to the given target filter.
- * All filter strings, and all nested filters, are copied.
- * @param targetFilter new filter into which we copy all our data
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.internal.core.filters.SystemFilter#clone(org.eclipse.rse.core.filters.ISystemFilter)
*/
public void clone(ISystemFilter targetFilter) {
super.clone(targetFilter);
@@ -104,15 +86,13 @@ public class SystemFilterSimple extends SystemFilter implements ISystemContainer
// contains a single filter string so these methods
// make it easier to set/get that filter string
// -------------------------------------------------------
+
/**
* Set the single filter string
*/
public void setFilterString(String filterString) {
filterStrings.clear();
filterStrings.add(filterString);
-// filterStringVector.clear();
-// filterStringVector.addElement(filterString);
-// invalidateCache();
}
/**
@@ -122,10 +102,6 @@ public class SystemFilterSimple extends SystemFilter implements ISystemContainer
public String getFilterString() {
String result = filterStrings.isEmpty() ? null : (String) filterStrings.get(0);
return result;
-// if (filterStringVector.size() == 0)
-// return null;
-// else
-// return (String)filterStringVector.elementAt(0);
}
/**
@@ -219,13 +195,6 @@ public class SystemFilterSimple extends SystemFilter implements ISystemContainer
String[] result = new String[filterStrings.size()];
filterStrings.toArray(result);
return result;
-// if (filterStringArray == null)
-// {
-// filterStringArray = new String[filterStringVector.size()];
-// for (int idx=0; idx