From 89923f985291ae076f64c31797740e61eafaac46 Mon Sep 17 00:00:00 2001 From: David Dykstal Date: Wed, 19 Dec 2007 14:59:05 +0000 Subject: [PATCH] [cleanup] format only --- .../rse/core/filters/SystemFilterSimple.java | 720 ++++----- .../internal/core/filters/SystemFilter.java | 1401 ++++++++--------- 2 files changed, 1013 insertions(+), 1108 deletions(-) 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 71248a4e105..57e5c71f82f 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 @@ -18,6 +18,7 @@ *******************************************************************************/ package org.eclipse.rse.core.filters; + import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -29,7 +30,6 @@ import org.eclipse.rse.core.model.ISystemContainer; 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 @@ -50,23 +50,21 @@ import org.eclipse.rse.internal.core.filters.SystemFilter; *
  • The attributes relativeOrder, promptable and default * */ -public class SystemFilterSimple extends SystemFilter implements ISystemContainer -{ - - private String name = null; - private String type = null; - private boolean caseSensitive = false; - private boolean promptable = false; - private Object parent; - private boolean isStale; - private List filterStrings = new ArrayList(3); +public class SystemFilterSimple extends SystemFilter implements ISystemContainer { + + private String name = null; + private String type = null; + private boolean caseSensitive = false; + private boolean promptable = false; + private Object parent; + private boolean isStale; + private List filterStrings = new ArrayList(3); private HashMap cachedContents; /** * Constructor for SystemFilterSimpleImpl */ - public SystemFilterSimple(String name) - { + public SystemFilterSimple(String name) { //super(); this.name = name; // filterStringVector = new Vector(); @@ -81,160 +79,146 @@ public class SystemFilterSimple extends SystemFilter implements ISystemContainer // //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 - */ - public boolean isTransient() - { - return true; - } + /** + * 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 + */ + 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 */ - public void clone(ISystemFilter targetFilter) - { + public void clone(ISystemFilter targetFilter) { super.clone(targetFilter); targetFilter.setFilterStrings(getFilterStringsVector()); } - // ------------------------------------------------------- - // New methods to simplify life. Often a simple filter - // 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); + // ------------------------------------------------------- + // New methods to simplify life. Often a simple filter + // 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(); - } - /** - * Get the single (or the first) filter string. - * Returns null if setFilterString has not been called. - */ - public String getFilterString() - { - String result = filterStrings.isEmpty() ? null : (String)filterStrings.get(0); - return result; + } + + /** + * Get the single (or the first) filter string. + * Returns null if setFilterString has not been called. + */ + 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); - } + } + + /** + * Set the parent. Since we don't have any filter manager, we need + * some way to store context info for the adapter. Use this. + */ + public void setParent(Object parent) { + this.parent = parent; + } + + /** + * Get the parent as set in setParent(Object) + */ + public Object getParent() { + return parent; + } + + // ------------------------------------------------------- + // Functional methods overridden to do something simple... + // ------------------------------------------------------- + + /** + * Set the filter's name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the filter's name + */ + public String getName() { + return name; + } + + /** + * Set the filter's type + */ + public void setType(String type) { + this.type = type; + } + + /** + * Get the filter's type + */ + public String getType() { + return type; + } - /** - * Set the parent. Since we don't have any filter manager, we need - * some way to store context info for the adapter. Use this. - */ - public void setParent(Object parent) - { - this.parent = parent; - } - - /** - * Get the parent as set in setParent(Object) - */ - public Object getParent() - { - return parent; - } - - // ------------------------------------------------------- - // Functional methods overridden to do something simple... - // ------------------------------------------------------- - - /** - * Set the filter's name - */ - public void setName(String name) - { - this.name = name; - } - - /** - * Get the filter's name - */ - public String getName() - { - return name; - } - - /** - * Set the filter's type - */ - public void setType(String type) - { - this.type = type; - } - - /** - * Get the filter's type - */ - public String getType() - { - return type; - } - /** * Specify if filter strings in this filter are case sensitive. * Default is false. * @param value The new value of the StringsCaseSensitive attribute */ - public void setStringsCaseSensitive(boolean value) - { + public void setStringsCaseSensitive(boolean value) { this.caseSensitive = value; } /** * Are filter strings in this filter case sensitive? */ - public boolean isStringsCaseSensitive() - { - return caseSensitive; - } - + public boolean isStringsCaseSensitive() { + return caseSensitive; + } + /** * Are filter strings in this filter case sensitive? */ - public boolean areStringsCaseSensitive() - { - return caseSensitive; - } + public boolean areStringsCaseSensitive() { + return caseSensitive; + } /** * Is this a special filter that prompts the user when it is expanded? */ - public void setPromptable(boolean promptable) - { + public void setPromptable(boolean promptable) { this.promptable = promptable; } + /** * Is this a special filter that prompts the user when it is expanded? */ - public boolean isPromptable() - { + public boolean isPromptable() { return promptable; } - /** - * Return filter strings as an array of String objects. - */ - public String[] getFilterStrings() - { - String[] result = new String[filterStrings.size()]; - filterStrings.toArray(result); - return result; + /** + * Return filter strings as an array of String objects. + */ + public String[] getFilterStrings() { + String[] result = new String[filterStrings.size()]; + filterStrings.toArray(result); + return result; // if (filterStringArray == null) // { // filterStringArray = new String[filterStringVector.size()]; @@ -242,321 +226,347 @@ public class SystemFilterSimple extends SystemFilter implements ISystemContainer // filterStringArray[idx] = (String)filterStringVector.elementAt(idx); // } // return filterStringArray; - } - - /** - * Return filter strings as a Vector of String objects - */ - public Vector getFilterStringsVector() - { - Vector result = new Vector(filterStrings.size()); - result.addAll(filterStrings); - return result; + } + + /** + * Return filter strings as a Vector of String objects + */ + public Vector getFilterStringsVector() { + Vector result = new Vector(filterStrings.size()); + result.addAll(filterStrings); + return result; // return filterStringVector; - } - - /** - * Return how many filter strings are defined in this filter. - */ - public int getFilterStringCount() - { - return filterStrings.size(); + } + + /** + * Return how many filter strings are defined in this filter. + */ + public int getFilterStringCount() { + return filterStrings.size(); // return filterStringVector.size(); - } - - /** - * Set all the filter strings for this filter. - * @param newStrings Vector of String objects - */ - public void setFilterStrings(Vector newStrings) - { - filterStrings.clear(); - filterStrings.addAll(newStrings); + } + + /** + * Set all the filter strings for this filter. + * @param newStrings Vector of String objects + */ + public void setFilterStrings(Vector newStrings) { + filterStrings.clear(); + filterStrings.addAll(newStrings); // filterStringVector.clear(); // for (int idx=0; idx 0; -// return (filterStringVector.size() > 0); - } - - // --------------------- - // methods needed by ISystemFilter - // --------------------- - + return null; + } - // ------------------------------------------------------- - // Non-applicable methods overridden to do nothing... - // ------------------------------------------------------- + /** + * Return the children of this filter. + * This is the same as getFilterStrings() + */ + public Object[] getChildren() { + return getFilterStrings(); + } + + /** + * Returns true if this filter has any filter strings + */ + public boolean hasChildren() { + return filterStrings.size() > 0; +// return (filterStringVector.size() > 0); + } + + // --------------------- + // methods needed by ISystemFilter + // --------------------- + + // ------------------------------------------------------- + // Non-applicable methods overridden to do nothing... + // ------------------------------------------------------- /** * Get this filter's filter string objects as an array. * We return null, as we don't support SystemFilterString objects, * just String objects. */ - public ISystemFilterString[] getSystemFilterStrings() - { - return null; - } - + public ISystemFilterString[] getSystemFilterStrings() { + return null; + } + /** * Overridden to do nothing */ - public void setSupportsNestedFilters(boolean value) {} - - /** - * Does this support nested filters? No. Not for simple filtes. - */ - public boolean supportsNestedFilters() {return false;} - - /** - * Return true if this filter is a nested filter or not. - * Overridden to return false; - */ - public boolean isNested() { return false; } - - /** - * Update a new filter string's string value. - * Overridden to do nothing. - */ - public void updateFilterString(ISystemFilterString filterString, String newValue) {} - - /** - * Remove a filter string from this filter's list, given its SystemFilterString object. - * Overridden to do nothing - */ - public boolean removeFilterString(ISystemFilterString filterString) {return false;} - - /** - * Move a given filter string to a given zero-based location. - * Overridden to do nothing - */ - public void moveSystemFilterString(int pos, ISystemFilterString filterString) {} - + public void setSupportsNestedFilters(boolean value) { + } + + /** + * Does this support nested filters? No. Not for simple filtes. + */ + public boolean supportsNestedFilters() { + return false; + } + + /** + * Return true if this filter is a nested filter or not. + * Overridden to return false; + */ + public boolean isNested() { + return false; + } + + /** + * Update a new filter string's string value. + * Overridden to do nothing. + */ + public void updateFilterString(ISystemFilterString filterString, String newValue) { + } + + /** + * Remove a filter string from this filter's list, given its SystemFilterString object. + * Overridden to do nothing + */ + public boolean removeFilterString(ISystemFilterString filterString) { + return false; + } + + /** + * Move a given filter string to a given zero-based location. + * Overridden to do nothing + */ + public void moveSystemFilterString(int pos, ISystemFilterString filterString) { + } + /** * Overridden to do nothing */ - public void setRelativeOrder(int value) {} - + public void setRelativeOrder(int value) { + } + /** * Overridden to return -1 */ - public int getRelativeOrder() { return -1; } - + public int getRelativeOrder() { + return -1; + } + /** * Overridden to do nothing */ - public void setDefault(boolean value) {} - + public void setDefault(boolean value) { + } + /** * Overridden to return false */ - public boolean isDefault() {return false; } - + public boolean isDefault() { + return false; + } + /** * Overridden to do nothing */ - public void setParentFilter(ISystemFilter l) {} - + public void setParentFilter(ISystemFilter l) { + } + /** * Overridden to return null */ - public ISystemFilter getParentFilter() {return null;} - - /** - * Overridden to return null - */ - public Vector getSystemFilterNames() {return null;} - + public ISystemFilter getParentFilter() { + return null; + } + /** * Overridden to return null */ - public java.util.List getNestedFilters() {return null;} - - /** - * Overridden to return null - */ - public Vector getSystemFiltersVector() {return null;} - - /** - * Overridden to return null - */ - public ISystemFilter[] getSystemFilters() {return null;} - - /** - * Overridden to return 0 - */ - public int getSystemFilterCount() {return 0;} - + public Vector getSystemFilterNames() { + return null; + } + /** * Overridden to return null */ - public java.util.List getStrings() {return null;} - + public java.util.List getNestedFilters() { + return null; + } + /** * Overridden to return null - */ - public ISystemFilter getSystemFilter(String aliasName) {return null;} - - /** - * Overridden to return null - */ - public ISystemFilterPoolManagerProvider getProvider() {return null;} - - /** - * Overridden to return null - */ - public ISystemFilterPoolManager getSystemFilterPoolManager() {return null;} - - /** - * Overridden to return null - */ - public IFile getSaveFile() {return null;} - - /** - * Overridden to return null - */ - public String getSaveFileName() {return null;} - - /** - * Overridden to do nothing - */ - public void save() throws Exception {} - - /** - * Cache contents of a certain type. - * @param type the contents type. - * @param cachedContents the contents to cache. - */ - public void setContents(ISystemContentsType type, Object[] cachedContents) { - this.cachedContents.put(type, cachedContents); - isStale = false; - } - + */ + public Vector getSystemFiltersVector() { + return null; + } + + /** + * Overridden to return null + */ + public ISystemFilter[] getSystemFilters() { + return null; + } + + /** + * Overridden to return 0 + */ + public int getSystemFilterCount() { + return 0; + } + + /** + * Overridden to return null + */ + public java.util.List getStrings() { + return null; + } + + /** + * Overridden to return null + */ + public ISystemFilter getSystemFilter(String aliasName) { + return null; + } + + /** + * Overridden to return null + */ + public ISystemFilterPoolManagerProvider getProvider() { + return null; + } + + /** + * Overridden to return null + */ + public ISystemFilterPoolManager getSystemFilterPoolManager() { + return null; + } + + /** + * Overridden to return null + */ + public IFile getSaveFile() { + return null; + } + + /** + * Overridden to return null + */ + public String getSaveFileName() { + return null; + } + + /** + * Overridden to do nothing + */ + public void save() throws Exception { + } + + /** + * Cache contents of a certain type. + * @param type the contents type. + * @param cachedContents the contents to cache. + */ + public void setContents(ISystemContentsType type, Object[] cachedContents) { + this.cachedContents.put(type, cachedContents); + isStale = false; + } + /** * @see org.eclipse.rse.core.model.ISystemContainer#getContents(org.eclipse.rse.core.model.ISystemContentsType) */ public Object[] getContents(ISystemContentsType contentsType) { - return (Object[])cachedContents.get(contentsType); + return (Object[]) cachedContents.get(contentsType); } - + /** * @see org.eclipse.rse.core.model.ISystemContainer#hasContents(org.eclipse.rse.core.model.ISystemContentsType) */ - public boolean hasContents(ISystemContentsType contentsType) { + public boolean hasContents(ISystemContentsType contentsType) { if (cachedContents.containsKey(contentsType)) { - return true; - } - return false; + return true; + } + return false; } - + /** * @see org.eclipse.rse.core.model.ISystemContainer#isStale() */ public boolean isStale() { return isStale; } - + /** * @see org.eclipse.rse.core.model.ISystemContainer#markStale(boolean) */ - public void markStale(boolean isStale) - { + public void markStale(boolean isStale) { markStale(isStale, true); } - + /** * @see org.eclipse.rse.core.model.ISystemContainer#markStale(boolean) */ - public void markStale(boolean isStale, boolean clearCache) - { - this.isStale = isStale; - if (clearCache) - { - cachedContents.clear(); - } + public void markStale(boolean isStale, boolean clearCache) { + this.isStale = isStale; + if (clearCache) { + cachedContents.clear(); + } } - + } diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/filters/SystemFilter.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/filters/SystemFilter.java index 24e9f9976d1..bdefd2c2d41 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/filters/SystemFilter.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/filters/SystemFilter.java @@ -19,6 +19,7 @@ ********************************************************************************/ package org.eclipse.rse.internal.core.filters; + import java.io.File; import java.util.ArrayList; import java.util.Arrays; @@ -42,7 +43,6 @@ import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.internal.core.RSECoreMessages; import org.eclipse.rse.internal.references.SystemReferencedObject; - /** * A filter is an encapsulation of a unique name, and a list of filter strings. * Filters can be referenced. @@ -50,12 +50,11 @@ import org.eclipse.rse.internal.references.SystemReferencedObject; /** * @lastgen class SystemFilterImpl extends SystemReferencedObjectImpl implements SystemFilter, SystemReferencedObject, SystemFilterContainer, IAdaptable {} */ -public class SystemFilter extends SystemReferencedObject implements ISystemFilter, IAdaptable -{ - - private SystemFilterContainerCommonMethods helpers = null; - private ISystemFilterPool parentPool = null; - private List filterStrings = new ArrayList(3); +public class SystemFilter extends SystemReferencedObject implements ISystemFilter, IAdaptable { + + private SystemFilterContainerCommonMethods helpers = null; + private ISystemFilterPool parentPool = null; + private List filterStrings = new ArrayList(3); private String name = null; private String type = null; private boolean supportsNestedFilters = false; @@ -73,349 +72,332 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte private List nestedFilters = new ArrayList(3); // private List strings = null; private ISystemFilter _parentFilter; - + /** * Constructor. */ - protected SystemFilter() - { + protected SystemFilter() { super(); - helpers = new SystemFilterContainerCommonMethods(); + helpers = new SystemFilterContainerCommonMethods(); } + /* - * Private internal way to get filters. Makes it easy to change in future, if we don't use MOF. - */ - private List internalGetFilters() - { + * Private internal way to get filters. Makes it easy to change in future, if we don't use MOF. + */ + private List internalGetFilters() { return getNestedFilters(); } - /** - * Returns the type attribute. Intercepted to return SystemFilterConstants.DEFAULT_TYPE if it is currently null - */ - public String getType() - { - String type = getTypeGen(); - if (type == null) - return ISystemFilterConstants.DEFAULT_TYPE; - else - return type; - } /** * Returns the type attribute. Intercepted to return SystemFilterConstants.DEFAULT_TYPE if it is currently null */ - public String getTypeGen() - { - return type; - } - /* - * Creates a new nested system filter within this filter - * @param parentPool the SystemFilterPool that owns the root filter. - * @param data Optional transient data to be stored in the new filter. Can be null. - * @param aliasName The name to give the new filter. Must be unique for this pool. - * @param filterStrings The list of String objects that represent the filter strings. - * - public SystemFilter createSystemFilter(SystemFilterPool parentPool, Object data, String aliasName, Vector filterStrings) - { - SystemFilter newFilter = helpers.createSystemFilter(internalGetFilters(), parentPool, data, aliasName, filterStrings); - newFilter.setSupportsNestedFilters(true); // presumably it does since it is nested itself. - return newFilter; - }*/ + public String getType() { + String type = getTypeGen(); + if (type == null) + return ISystemFilterConstants.DEFAULT_TYPE; + else + return type; + } - /** - * Creates a new nested system filter within this filter. - * This filter will inherit/store the following attributes from this filter: - *

    - * @param aliasName The name to give the new filter. Must be unique for this pool. - * @param filterStrings The list of String objects that represent the filter strings. - */ - public ISystemFilter createSystemFilter(String aliasName, Vector filterStrings) - { - ISystemFilter newFilter = helpers.createSystemFilter(internalGetFilters(), getParentFilterPool(), aliasName, filterStrings); - newFilter.setSupportsNestedFilters(true); // presumably it does since it is nested itself. - newFilter.setSupportsDuplicateFilterStrings(supportsDuplicateFilterStrings()); - newFilter.setStringsCaseSensitive(areStringsCaseSensitive()); - return newFilter; - } - - /** - * Internal use method - */ - public void initializeFilterStrings() - { - List filterStrings = getStrings(); - Iterator i = filterStrings.iterator(); - while (i.hasNext()) - ((ISystemFilterString)i.next()).setParentSystemFilter(this); - } + /** + * Returns the type attribute. Intercepted to return SystemFilterConstants.DEFAULT_TYPE if it is currently null + */ + public String getTypeGen() { + return type; + } - /** - * 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 - */ - public void clone(ISystemFilter targetFilter) - { - // clone attributes - //targetFilter.setName(getName()); - targetFilter.setDefault(isDefault()); - targetFilter.setType(getType()); - targetFilter.setPromptable(isPromptable()); - targetFilter.setRelativeOrder(getRelativeOrder()); - targetFilter.setSupportsNestedFilters(isSupportsNestedFilters()); - targetFilter.setSupportsDuplicateFilterStrings(isSupportsDuplicateFilterStrings()); - targetFilter.setStringsNonChangable(isStringsNonChangable()); - targetFilter.setNonChangable(isNonChangable()); - targetFilter.setNonDeletable(isNonDeletable()); - targetFilter.setNonRenamable(isNonRenamable()); - if (isSetSingleFilterStringOnly()) - targetFilter.setSingleFilterStringOnly(isSingleFilterStringOnly()); - if (isSetStringsCaseSensitive()) - targetFilter.setStringsCaseSensitive(isStringsCaseSensitive()); - // clone filter strings - ISystemFilterString[] strings = getSystemFilterStrings(); - if (strings != null) { - for (int idx=0; idx + *
  • supportsNestedFilters + *
  • supportsDuplicateFilterStrings + *
  • stringsCaseSensitive + *
  • data + * + * @param aliasName The name to give the new filter. Must be unique for this pool. + * @param filterStrings The list of String objects that represent the filter strings. + */ + public ISystemFilter createSystemFilter(String aliasName, Vector filterStrings) { + ISystemFilter newFilter = helpers.createSystemFilter(internalGetFilters(), getParentFilterPool(), aliasName, filterStrings); + newFilter.setSupportsNestedFilters(true); // presumably it does since it is nested itself. + newFilter.setSupportsDuplicateFilterStrings(supportsDuplicateFilterStrings()); + newFilter.setStringsCaseSensitive(areStringsCaseSensitive()); + return newFilter; + } + + /** + * Internal use method + */ + public void initializeFilterStrings() { + List filterStrings = getStrings(); + Iterator i = filterStrings.iterator(); + while (i.hasNext()) + ((ISystemFilterString) i.next()).setParentSystemFilter(this); + } + + /** + * 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 + */ + public void clone(ISystemFilter targetFilter) { + // clone attributes + //targetFilter.setName(getName()); + targetFilter.setDefault(isDefault()); + targetFilter.setType(getType()); + targetFilter.setPromptable(isPromptable()); + targetFilter.setRelativeOrder(getRelativeOrder()); + targetFilter.setSupportsNestedFilters(isSupportsNestedFilters()); + targetFilter.setSupportsDuplicateFilterStrings(isSupportsDuplicateFilterStrings()); + targetFilter.setStringsNonChangable(isStringsNonChangable()); + targetFilter.setNonChangable(isNonChangable()); + targetFilter.setNonDeletable(isNonDeletable()); + targetFilter.setNonRenamable(isNonRenamable()); + if (isSetSingleFilterStringOnly()) targetFilter.setSingleFilterStringOnly(isSingleFilterStringOnly()); + if (isSetStringsCaseSensitive()) targetFilter.setStringsCaseSensitive(isStringsCaseSensitive()); + // clone filter strings + ISystemFilterString[] strings = getSystemFilterStrings(); + if (strings != null) { + for (int idx = 0; idx < strings.length; idx++) { + copySystemFilterString(targetFilter, strings[idx]); + } + } + // clone nested filters... + ISystemFilter[] filters = getSystemFilters(); + if (filters != null) for (int idx = 0; idx < filters.length; idx++) { + ISystemFilter newFilter = targetFilter.createSystemFilter(filters[idx].getName(), null); + filters[idx].clone(newFilter); // recursive call + } + } + + /** + * Copies a given filter string from this filter to another filter in this pool or another pool + * in this manager or another manager. + */ + public ISystemFilterString copySystemFilterString(ISystemFilter targetFilter, ISystemFilterString oldFilterString) { + ISystemFilterString newString = targetFilter.addFilterString(null); + oldFilterString.clone(newString); + return newString; + } + + /** + * From SystemFilterContainer. + * Same as calling getParentFilterPool(). It walks the parent chain until the pool is found. + */ + public ISystemFilterPool getSystemFilterPool() { + return getParentFilterPool(); + } + + /** + * 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 false. + * @see SystemFilterSimple + */ + public boolean isTransient() { + return false; + } + + /** + * Does this support nested filters? Calls mof-generated isSupportsNestedFilters. + */ + public boolean supportsNestedFilters() { + return isSupportsNestedFilters(); + } + + /** + * Does this support duplicate filter strings? Calls mof-generated isSupportsDuplicateFilterStrings. + */ + public boolean supportsDuplicateFilterStrings() { + return isSupportsDuplicateFilterStrings(); + } + + /** + * Return true if this filter is a nested filter or not. If not, its parent is the filter pool. + */ + public boolean isNested() { + return (getParentFilter() != 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 false. - * @see SystemFilterSimple - */ - public boolean isTransient() - { - return false; - } - - /** - * Does this support nested filters? Calls mof-generated isSupportsNestedFilters. - */ - public boolean supportsNestedFilters() - { - return isSupportsNestedFilters(); - } - /** - * Does this support duplicate filter strings? Calls mof-generated isSupportsDuplicateFilterStrings. - */ - public boolean supportsDuplicateFilterStrings() - { - return isSupportsDuplicateFilterStrings(); - } - - /** - * Return true if this filter is a nested filter or not. If not, its parent is the filter pool. - */ - public boolean isNested() - { - return (getParentFilter()!=null); - } /** * Are filter strings in this filter case sensitive? * If not set locally, queries the parent filter pool's atttribute. * @return The value of the StringsCaseSensitive attribute */ - public boolean isStringsCaseSensitive() - { + public boolean isStringsCaseSensitive() { if (!isSetStringsCaseSensitive()) - return getParentFilterPool().isStringsCaseSensitive(); + return getParentFilterPool().isStringsCaseSensitive(); else - return stringsCaseSensitive; + return stringsCaseSensitive; } + /** * Same as isStringsCaseSensitive() * @return The value of the StringsCaseSensitive attribute */ - public boolean areStringsCaseSensitive() - { - return isStringsCaseSensitive(); + public boolean areStringsCaseSensitive() { + return isStringsCaseSensitive(); } - /** - * Return Vector of String objects: the names of existing filters in this container. - * Needed by name validators for New and Rename actions to verify new name is unique. - */ - public Vector getSystemFilterNames() - { - return helpers.getSystemFilterNames(internalGetFilters()); - } - - /** - * Return the nested filters as a Vector - */ - public Vector getSystemFiltersVector() - { - return helpers.getSystemFiltersVector(internalGetFilters()); - } - /** - * Return the nested filters as an array - */ - public ISystemFilter[] getSystemFilters() - { - return helpers.getSystemFilters(internalGetFilters()); - } - /** - * Return how many filters are defined in this filter container - */ - public int getSystemFilterCount() - { - return internalGetFilters().size(); - } - - /** - * Return a filter object, given its aliasname. - * Can be used to test if an aliasname is already used (non-null return). - * @param aliasName unique aliasName (case insensitive) to search on. - * @return SystemFilter object with unique aliasName, or null if - * no filter object with this name exists. - */ - public ISystemFilter getSystemFilter(String aliasName) - { - return helpers.getSystemFilter(internalGetFilters(), aliasName); - } - /** - * Adds given filter to the list. - *

    PLEASE NOTE: - *

    - * @param filter SystemFilter object to add - * @return true if added, false if filter with this aliasname already existed. - */ - public boolean addSystemFilter(ISystemFilter filter) - { - return helpers.addSystemFilter(internalGetFilters(),filter); - } - /** - * Removes a given filter from the list. - * @param filter SystemFilter object to remove - */ - public void deleteSystemFilter(ISystemFilter filter) - { - helpers.deleteSystemFilter(internalGetFilters(),filter); - } - /** - * Rename a given filter in the list. - * @param filter SystemFilter object to remove - */ - public void renameSystemFilter(ISystemFilter filter, String newName) - { - helpers.renameSystemFilter(internalGetFilters(),filter, newName); - } - /** - * Updates a given filter in the list. - * @param filter SystemFilter object to update - * @param newName New name to assign it. Assumes unique checking already done. - * @param newStrings New strings to assign it. Replaces current strings. - */ - public void updateSystemFilter(ISystemFilter filter, String newName, String[] newStrings) - { - helpers.updateSystemFilter(internalGetFilters(), filter, newName, newStrings); - } - /** - * Duplicates a given filter in the list. - * @param filter SystemFilter object to clone - * @param aliasName New, unique, alias name to give this filter. Clone will fail if this is not unique. - */ - public ISystemFilter cloneSystemFilter(ISystemFilter filter, String aliasName) - { - return helpers.cloneSystemFilter(internalGetFilters(), filter, aliasName); - } - /** - * Return a given filter's zero-based location - */ - public int getSystemFilterPosition(ISystemFilter filter) - { - return helpers.getSystemFilterPosition(internalGetFilters(),filter); - } - - /** - * Move a given filter to a given zero-based location - */ - public void moveSystemFilter(int pos, ISystemFilter filter) - { - helpers.moveSystemFilter(internalGetFilters(), pos, filter); - } - /** - * Return the parent pool of this filter. For nested filters, we walk up the parent chain - * until we find the pool. - */ - public ISystemFilterPool getParentFilterPool() - { - return parentPool; - } - /** - * Internal use method to set the parent filter pool. - */ - public void setParentFilterPool(ISystemFilterPool parentPool) - { - this.parentPool = parentPool; - ISystemFilter[] filters = getSystemFilters(); - if (filters != null) - for (int idx=0; idxPLEASE NOTE: + *
      + *
    • createSystemFilter calls this method for you! + *
    • this is a no-op if a filter with the same aliasname already exists + *
    + * @param filter SystemFilter object to add + * @return true if added, false if filter with this aliasname already existed. + */ + public boolean addSystemFilter(ISystemFilter filter) { + return helpers.addSystemFilter(internalGetFilters(), filter); + } + + /** + * Removes a given filter from the list. + * @param filter SystemFilter object to remove + */ + public void deleteSystemFilter(ISystemFilter filter) { + helpers.deleteSystemFilter(internalGetFilters(), filter); + } + + /** + * Rename a given filter in the list. + * @param filter SystemFilter object to remove + */ + public void renameSystemFilter(ISystemFilter filter, String newName) { + helpers.renameSystemFilter(internalGetFilters(), filter, newName); + } + + /** + * Updates a given filter in the list. + * @param filter SystemFilter object to update + * @param newName New name to assign it. Assumes unique checking already done. + * @param newStrings New strings to assign it. Replaces current strings. + */ + public void updateSystemFilter(ISystemFilter filter, String newName, String[] newStrings) { + helpers.updateSystemFilter(internalGetFilters(), filter, newName, newStrings); + } + + /** + * Duplicates a given filter in the list. + * @param filter SystemFilter object to clone + * @param aliasName New, unique, alias name to give this filter. Clone will fail if this is not unique. + */ + public ISystemFilter cloneSystemFilter(ISystemFilter filter, String aliasName) { + return helpers.cloneSystemFilter(internalGetFilters(), filter, aliasName); + } + + /** + * Return a given filter's zero-based location + */ + public int getSystemFilterPosition(ISystemFilter filter) { + return helpers.getSystemFilterPosition(internalGetFilters(), filter); + } + + /** + * Move a given filter to a given zero-based location + */ + public void moveSystemFilter(int pos, ISystemFilter filter) { + helpers.moveSystemFilter(internalGetFilters(), pos, filter); + } + + /** + * Return the parent pool of this filter. For nested filters, we walk up the parent chain + * until we find the pool. + */ + public ISystemFilterPool getParentFilterPool() { + return parentPool; + } + + /** + * Internal use method to set the parent filter pool. + */ + public void setParentFilterPool(ISystemFilterPool parentPool) { + this.parentPool = parentPool; + ISystemFilter[] filters = getSystemFilters(); + if (filters != null) for (int idx = 0; idx < filters.length; idx++) + filters[idx].setParentFilterPool(parentPool); + // todo: decide if SystemFilterString objects need it too + } + + /** + * Return the ISystemFilterContainer parent of this filter. Will be either + * a SystemFilterPool or a SystemFilter if this is a nested filter. + */ + public ISystemFilterContainer getParentFilterContainer() { + ISystemFilter parentFilter = getParentFilter(); + return (parentFilter != null) ? (ISystemFilterContainer) parentFilter : (ISystemFilterContainer) getParentFilterPool(); + } + + /** + * Internal way to return emf-modelled list of filter strings. + * We use this so we can easily change to non-mof if we decide to. + */ // private List internalGetFilterStrings() // { // return getStrings(); // } - - /** - * Clear internal cache so it will be rebuilt on next request. - */ + /** + * Clear internal cache so it will be rebuilt on next request. + */ // protected void invalidateCache() // { // filterStringArray = null; @@ -423,20 +405,20 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte // filterStringVector = null; // setDirty(true); // } - - /** - * Returns the filter strings of this filter as an array of String objects. - * The array may be empty but will not be null. - */ - public String[] getFilterStrings() { - ISystemFilterString[] filterStrings = getSystemFilterStrings(); - String[] result = new String[filterStrings.length]; - for (int i = 0; i < filterStrings.length; i++) { + /** + * Returns the filter strings of this filter as an array of String objects. + * The array may be empty but will not be null. + */ + public String[] getFilterStrings() { + ISystemFilterString[] filterStrings = getSystemFilterStrings(); + String[] result = new String[filterStrings.length]; + for (int i = 0; i < filterStrings.length; i++) { ISystemFilterString filterString = filterStrings[i]; result[i] = filterString.getString(); } - return result; - } + return result; + } + // public String[] getFilterStrings() // { // if (filterStringArray == null) @@ -450,17 +432,18 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte // } // return filterStringArray; // } - - /** - * Return filter strings as a Vector of String objects. - * This vector may be empty but will never be null. - */ - public Vector getFilterStringsVector() { - String[] strings = getFilterStrings(); - List stringList = Arrays.asList(strings); - Vector result = new Vector(stringList); - return result; - } + + /** + * Return filter strings as a Vector of String objects. + * This vector may be empty but will never be null. + */ + public Vector getFilterStringsVector() { + String[] strings = getFilterStrings(); + List stringList = Arrays.asList(strings); + Vector result = new Vector(stringList); + return result; + } + // public Vector getFilterStringsVector() // { // if (filterStringVector == null) @@ -473,12 +456,11 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte // } // return filterStringVector; // } - + /** * Get this filter's filter strings as a Vector of FilterString objects - */ - public Vector getFilterStringObjectsVector() - { + */ + public Vector getFilterStringObjectsVector() { Vector result = new Vector(filterStrings.size()); result.addAll(filterStrings); return result; @@ -490,56 +472,48 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte // filterStringVector.addElement(i.next()); // return filterStringVector; } - - /** - * Return how many filter strings are defined in this filter. - */ - public int getFilterStringCount() - { - return filterStrings.size(); + + /** + * Return how many filter strings are defined in this filter. + */ + public int getFilterStringCount() { + return filterStrings.size(); // return internalGetFilterStrings().size(); - } - - /** - * Get a filter string given its string value - */ - public ISystemFilterString getSystemFilterString(String string) - { - ISystemFilterString[] strings = getSystemFilterStrings(); - ISystemFilterString match = null; - boolean cs = areStringsCaseSensitive(); - if (strings != null) - { - for (int idx=0; (match==null) && (idx 0) - return true; - else - return helpers.hasSystemFilters(internalGetFilters()); - } + // start with nested filters... + for (int idx = 0; idx < filters.size(); idx++) + vChildren.addElement(filters.elementAt(idx)); + // continue with resolved filter string objects... + for (int idx = 0; idx < strings.size(); idx++) { + String filterString = (String) strings.elementAt(idx); + vChildren.addElement(filterString); + } - /** - * Return the caller which instantiated the filter pool manager overseeing this filter framework instance - */ - public ISystemFilterPoolManagerProvider getProvider() - { - ISystemFilterPoolManager mgr = getSystemFilterPoolManager(); - if (mgr != null) - return mgr.getProvider(); - else - return null; - } - - /** - * Return the filter pool manager managing this collection of filter pools and their filters. - * To save space, we delegate this query to our parent filter pool. - */ - public ISystemFilterPoolManager getSystemFilterPoolManager() - { - ISystemFilterPool pool = getParentFilterPool(); - if (pool != null) - return pool.getSystemFilterPoolManager(); - else - return null; - } + // convert whole thing to an array... + Object[] children = new Object[vChildren.size()]; + for (int idx = 0; idx < vChildren.size(); idx++) + children[idx] = vChildren.elementAt(idx); - // ----------------------- - // SAVE/RESTORE METHODS... - // ----------------------- - - - + return children; + } + /** + * Returns true if this filter has any nested filters or any filter strings + */ + public boolean hasChildren() { + if (filterStrings.size() > 0) + return true; + else + return helpers.hasSystemFilters(internalGetFilters()); + } - /** - * Restore specific filter. Used when save policy is SAVE_POLICY_ONE_FILE_PER_FILTER - * @param folder the folder containing the saved file. - * @param name The name of the saved filter. The file name is derived from this. - * @param parentPool the SystemFilterPool that is the parent of this filter. Will be perpetuated to nested filters. - * @param namingPolicy Tells us how to derive file name from filter name. Can be null for default prefix name. - * @return SystemFilter object if restored ok, null if error encountered. If null, call getLastException(). - */ - public static ISystemFilter restore(IFolder folder, String name, ISystemFilterPool parentPool, - IRSEFilterNamingPolicy namingPolicy) - throws Exception - { - /* FIXME - String fileName = getRootSaveFileName(namingPolicy, name); - - List ext = mofHelpers.restore(folder,fileName); - - // should be exactly one... - Iterator iList = ext.iterator(); - SystemFilter filter = (SystemFilter)iList.next(); - if (parentPool != null) - filter.setParentFilterPool(parentPool); - ((SystemFilterImpl)filter).initializeFilterStrings(); - return filter; - */ - return null; - } + /** + * Return the caller which instantiated the filter pool manager overseeing this filter framework instance + */ + public ISystemFilterPoolManagerProvider getProvider() { + ISystemFilterPoolManager mgr = getSystemFilterPoolManager(); + if (mgr != null) + return mgr.getProvider(); + else + return null; + } + /** + * Return the filter pool manager managing this collection of filter pools and their filters. + * To save space, we delegate this query to our parent filter pool. + */ + public ISystemFilterPoolManager getSystemFilterPoolManager() { + ISystemFilterPool pool = getParentFilterPool(); + if (pool != null) + return pool.getSystemFilterPoolManager(); + else + return null; + } - /** - * Return the root save file name without the extension .xmi - */ - protected static String getRootSaveFileName(ISystemFilter filter) - { - return getRootSaveFileName(getNamingPolicy(filter), filter.getName()); - } - /** - * Return the root save file name without the extension .xmi - */ - protected static String getRootSaveFileName(IRSEFilterNamingPolicy namingPolicy, String name) - { - return namingPolicy.getFilterSaveFileName(name); - } + // ----------------------- + // SAVE/RESTORE METHODS... + // ----------------------- + /** + * Restore specific filter. Used when save policy is SAVE_POLICY_ONE_FILE_PER_FILTER + * @param folder the folder containing the saved file. + * @param name The name of the saved filter. The file name is derived from this. + * @param parentPool the SystemFilterPool that is the parent of this filter. Will be perpetuated to nested filters. + * @param namingPolicy Tells us how to derive file name from filter name. Can be null for default prefix name. + * @return SystemFilter object if restored ok, null if error encountered. If null, call getLastException(). + */ + public static ISystemFilter restore(IFolder folder, String name, ISystemFilterPool parentPool, IRSEFilterNamingPolicy namingPolicy) throws Exception { + /* FIXME + String fileName = getRootSaveFileName(namingPolicy, name); + + List ext = mofHelpers.restore(folder,fileName); + + // should be exactly one... + Iterator iList = ext.iterator(); + SystemFilter filter = (SystemFilter)iList.next(); + if (parentPool != null) + filter.setParentFilterPool(parentPool); + ((SystemFilterImpl)filter).initializeFilterStrings(); + return filter; + */ + return null; + } - /** - * Return naming policy - */ - protected static IRSEFilterNamingPolicy getNamingPolicy(ISystemFilter filter) - { - return filter.getParentFilterPool().getNamingPolicy(); - } + /** + * Return the root save file name without the extension .xmi + */ + protected static String getRootSaveFileName(ISystemFilter filter) { + return getRootSaveFileName(getNamingPolicy(filter), filter.getName()); + } - + /** + * Return the root save file name without the extension .xmi + */ + protected static String getRootSaveFileName(IRSEFilterNamingPolicy namingPolicy, String name) { + return namingPolicy.getFilterSaveFileName(name); + } - /** - * Ensure given path ends with path separator. - */ - public static String addPathTerminator(String path) - { - if (!path.endsWith(File.separator)) - path = path + File.separatorChar; - //else - // path = path; - return path; - } + /** + * Return naming policy + */ + protected static IRSEFilterNamingPolicy getNamingPolicy(ISystemFilter filter) { + return filter.getParentFilterPool().getNamingPolicy(); + } + + /** + * Ensure given path ends with path separator. + */ + public static String addPathTerminator(String path) { + if (!path.endsWith(File.separator)) path = path + File.separatorChar; + //else + // path = path; + return path; + } + + /** + * Return string identifying this filter + */ + public String toString() { + return getName(); + } - /** - * Return string identifying this filter - */ - public String toString() - { - return getName(); - } /** * @generated This field/method will be replaced during code generation */ - public String getName() - { + public String getName() { return name; } - - public String getDescription() - { + + public String getDescription() { return RSECoreMessages.RESID_MODELOBJECTS_FILTER_DESCRIPTION; } /** * @generated This field/method will be replaced during code generation. */ - public void setName(String newName) - { + public void setName(String newName) { name = newName; } /** * @generated This field/method will be replaced during code generation. */ - public void setType(String newType) - { + public void setType(String newType) { type = newType; setDirty(true); } @@ -903,19 +838,16 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte /** * @generated This field/method will be replaced during code generation */ - public boolean isSupportsNestedFilters() - { + public boolean isSupportsNestedFilters() { return supportsNestedFilters; } /** * @generated This field/method will be replaced during code generation. */ - public void setSupportsNestedFilters(boolean newSupportsNestedFilters) - { + public void setSupportsNestedFilters(boolean newSupportsNestedFilters) { boolean oldSupportsNestedFilters = supportsNestedFilters; - if (oldSupportsNestedFilters != newSupportsNestedFilters) - { + if (oldSupportsNestedFilters != newSupportsNestedFilters) { supportsNestedFilters = newSupportsNestedFilters; setDirty(true); } @@ -926,16 +858,14 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte * When saving one filter per file, this captures this filter's relative order * within the pool, as the file system cannot capture this. */ - public int getRelativeOrder() - { + public int getRelativeOrder() { return relativeOrder; } /** * @generated This field/method will be replaced during code generation. */ - public void setRelativeOrder(int newRelativeOrder) - { + public void setRelativeOrder(int newRelativeOrder) { relativeOrder = newRelativeOrder; } @@ -943,27 +873,23 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte * @generated This field/method will be replaced during code generation * Is this a vendor-supplied filter versus a user-defined filter */ - public boolean isDefault() - { + public boolean isDefault() { return default_; } /** * @generated This field/method will be replaced during code generation. */ - public void setDefault(boolean newDefault) - { + public void setDefault(boolean newDefault) { default_ = newDefault; } /** * @generated This field/method will be replaced during code generation. */ - public void setStringsCaseSensitive(boolean newStringsCaseSensitive) - { + public void setStringsCaseSensitive(boolean newStringsCaseSensitive) { boolean oldStringsCaseSensitive = stringsCaseSensitive; - if (oldStringsCaseSensitive != newStringsCaseSensitive) - { + if (oldStringsCaseSensitive != newStringsCaseSensitive) { stringsCaseSensitive = newStringsCaseSensitive; setDirty(true); } @@ -973,8 +899,7 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte /** * @generated This field/method will be replaced during code generation. */ - public void unsetStringsCaseSensitive() - { + public void unsetStringsCaseSensitive() { if (stringsCaseSensitive) { stringsCaseSensitive = false; setDirty(true); @@ -990,8 +915,7 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte /** * @generated This field/method will be replaced during code generation. */ - public boolean isSetStringsCaseSensitive() - { + public boolean isSetStringsCaseSensitive() { return stringsCaseSensitive; } @@ -999,24 +923,21 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte * @generated This field/method will be replaced during code generation * If true, the user is prompted when this filter is expanded */ - public boolean isPromptable() - { + public boolean isPromptable() { return promptable; } /** * @generated This field/method will be replaced during code generation. */ - public void setPromptable(boolean newPromptable) - { + public void setPromptable(boolean newPromptable) { promptable = newPromptable; } /** * @generated This field/method will be replaced during code generation */ - public ISystemFilter getParentFilter() - { + public ISystemFilter getParentFilter() { //FIXME return _parentFilter; //if (eContainerFeatureID != FiltersPackage.SYSTEM_FILTER__PARENT_FILTER) return null; @@ -1026,8 +947,7 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte /** * @generated This field/method will be replaced during code generation. */ - public void setParentFilter(ISystemFilter newParentFilter) - { + public void setParentFilter(ISystemFilter newParentFilter) { _parentFilter = newParentFilter; /* FIXME if (newParentFilter != eContainer || (eContainerFeatureID != FiltersPackage.SYSTEM_FILTER__PARENT_FILTER && newParentFilter != null)) @@ -1050,10 +970,8 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte /** * @generated This field/method will be replaced during code generation */ - public List getNestedFilters() - { - if (nestedFilters == null) - { + public List getNestedFilters() { + if (nestedFilters == null) { nestedFilters = new ArrayList(); //FIXME new EObjectContainmentWithInversejava.util.List(SystemFilter.class, this, FiltersPackage.SYSTEM_FILTER__NESTED_FILTERS, FiltersPackage.SYSTEM_FILTER__PARENT_FILTER); } @@ -1063,8 +981,7 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte /** * @generated This field/method will be replaced during code generation */ - public List getStrings() - { + public List getStrings() { // if (filterStrings == null) // { // filterStrings = new ArrayList(); @@ -1076,19 +993,16 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte /** * @generated This field/method will be replaced during code generation */ - public boolean isSupportsDuplicateFilterStrings() - { + public boolean isSupportsDuplicateFilterStrings() { return supportsDuplicateFilterStrings; } /** * @generated This field/method will be replaced during code generation. */ - public void setSupportsDuplicateFilterStrings(boolean newSupportsDuplicateFilterStrings) - { + public void setSupportsDuplicateFilterStrings(boolean newSupportsDuplicateFilterStrings) { boolean oldSupportsDuplicateFilterStrings = supportsDuplicateFilterStrings; - if (oldSupportsDuplicateFilterStrings != newSupportsDuplicateFilterStrings) - { + if (oldSupportsDuplicateFilterStrings != newSupportsDuplicateFilterStrings) { supportsDuplicateFilterStrings = newSupportsDuplicateFilterStrings; setDirty(true); } @@ -1097,48 +1011,42 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte /** * @generated This field/method will be replaced during code generation */ - public boolean isNonDeletable() - { + public boolean isNonDeletable() { return nonDeletable; } /** * @generated This field/method will be replaced during code generation. */ - public void setNonDeletable(boolean newNonDeletable) - { + public void setNonDeletable(boolean newNonDeletable) { nonDeletable = newNonDeletable; } /** * @generated This field/method will be replaced during code generation */ - public boolean isNonRenamable() - { + public boolean isNonRenamable() { return nonRenamable; } /** * @generated This field/method will be replaced during code generation. */ - public void setNonRenamable(boolean newNonRenamable) - { + public void setNonRenamable(boolean newNonRenamable) { nonRenamable = newNonRenamable; } /** * @generated This field/method will be replaced during code generation */ - public boolean isNonChangable() - { + public boolean isNonChangable() { return nonChangable; } /** * @generated This field/method will be replaced during code generation. */ - public void setNonChangable(boolean newNonChangable) - { + public void setNonChangable(boolean newNonChangable) { nonChangable = newNonChangable; } @@ -1147,19 +1055,16 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte * Are the filter strings within this filter non-changable by the user. If true, * strings can be deleted, added, edited or reordered. */ - public boolean isStringsNonChangable() - { + public boolean isStringsNonChangable() { return stringsNonChangable; } /** * @generated This field/method will be replaced during code generation. */ - public void setStringsNonChangable(boolean newStringsNonChangable) - { + public void setStringsNonChangable(boolean newStringsNonChangable) { boolean oldStringsNonChangable = stringsNonChangable; - if (oldStringsNonChangable != newStringsNonChangable) - { + if (oldStringsNonChangable != newStringsNonChangable) { stringsNonChangable = newStringsNonChangable; setDirty(true); } @@ -1170,16 +1075,14 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte * In what release was this created? Typically, will be the version and release * times 10, as in 40 or 51. */ - public int getRelease() - { + public int getRelease() { return release; } /** * @generated This field/method will be replaced during code generation. */ - public void setRelease(int newRelease) - { + public void setRelease(int newRelease) { release = newRelease; } @@ -1187,32 +1090,26 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte * Returns true if this filter is limited to a single filter string. If not set here, * it is queried from the parent pool. */ - public boolean isSingleFilterStringOnly() - { + public boolean isSingleFilterStringOnly() { if (isSetSingleFilterStringOnly()) - return singleFilterStringOnly; + return singleFilterStringOnly; else - return getSystemFilterPool().isSingleFilterStringOnly(); + return getSystemFilterPool().isSingleFilterStringOnly(); } - - public boolean isSingleFilterStringOnlyGen() - { + + public boolean isSingleFilterStringOnlyGen() { return singleFilterStringOnly; } - public void setSingleFilterStringOnly(boolean newSingleFilterStringOnly) - { + public void setSingleFilterStringOnly(boolean newSingleFilterStringOnly) { boolean oldSingleFilterStringOnly = singleFilterStringOnly; - if (oldSingleFilterStringOnly != newSingleFilterStringOnly) - { + if (oldSingleFilterStringOnly != newSingleFilterStringOnly) { singleFilterStringOnly = newSingleFilterStringOnly; setDirty(true); - } + } } - - public void unsetSingleFilterStringOnly() - { + public void unsetSingleFilterStringOnly() { if (singleFilterStringOnly) { singleFilterStringOnly = false; setDirty(true); @@ -1226,23 +1123,21 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte // } - public boolean isSetSingleFilterStringOnly() - { + public boolean isSetSingleFilterStringOnly() { return singleFilterStringOnly; } - - public boolean commit() - { + + public boolean commit() { ISystemProfile profile = getSystemFilterPoolManager().getSystemProfile(); boolean result = profile.commit(); return result; } - + public IRSEPersistableContainer getPersistableParent() { IRSEPersistableContainer result = getParentFilterContainer(); return result; } - + public IRSEPersistableContainer[] getPersistableChildren() { List children = new ArrayList(20); List nf = getNestedFilters(); // guaranteed to not be null, none of these should be simple filters @@ -1253,5 +1148,5 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte children.toArray(result); return result; } - + } \ No newline at end of file