1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 23:25:26 +02:00

[222270][api][breaking] Clean up interfaces in org.eclipse.rse.core.filters

https://bugs.eclipse.org/bugs/show_bug.cgi?id=222270
This commit is contained in:
David Dykstal 2008-03-13 02:40:27 +00:00
parent c978a62c0e
commit 054297d712
40 changed files with 741 additions and 2594 deletions

View file

@ -1,77 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002, 2007 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
*******************************************************************************/
package org.eclipse.rse.core.filters;
/**
* Allows tool writers to specify the naming standards for the
* persistence files and folders involved with filters.
* <p>
* Note that not all methods will be used for all saving policies.
* <p>
* @see org.eclipse.rse.core.filters.SystemFilterNamingPolicy#getNamingPolicy()
*/
public interface IRSEFilterNamingPolicy {
/**
* Get the unqualified save file name for the given SystemFilterPoolManager object name.
* Do NOT include the extension, as .xmi will be added.
*/
public String getManagerSaveFileName(String managerName);
/**
* Get the unqualified save file name for the given SystemFilterPoolReferenceManager object name.
* Do NOT include the extension, as .xmi will be added.
*/
public String getReferenceManagerSaveFileName(String managerName);
/**
* Get the unqualified save file name for the given SystemFilterPool object name.
* Do NOT include the extension, as .xmi will be added.
*/
public String getFilterPoolSaveFileName(String poolName);
/**
* Get the file name prefix for all pool files.
* Used to deduce the saved pools by examining the file system
*/
public String getFilterPoolSaveFileNamePrefix();
/**
* Get the folder name for the given SystemFilterPool object name.
*/
public String getFilterPoolFolderName(String poolName);
/**
* Get the folder name prefix for all pool folders.
* Used to deduce the saved pools by examining the file system
*/
public String getFilterPoolFolderNamePrefix();
/**
* Get the unqualified save file name for the given SystemFilter object name
* Do NOT include the extension, as .xmi will be added.
*/
public String getFilterSaveFileName(String filterName);
/**
* Get the file name prefix for all filter files.
* Used to deduce the saved pools by examining the file system
*/
public String getFilterSaveFileNamePrefix();
}

View file

@ -17,9 +17,6 @@
package org.eclipse.rse.core.filters;
import java.util.List;
import java.util.Vector;
import org.eclipse.rse.core.model.IRSEModelObject;
import org.eclipse.rse.core.references.IRSEReferencedObject;
@ -35,83 +32,70 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai
/**
* Returns the value of the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* This is the name of the filter. It may be present in the user interface and is also
* used to refer to the filter when it is persisted.
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Name</em>' attribute.
* @see #setName(String)
*/
String getName();
public String getName();
/**
* Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#getName <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* This is the name of the filter. It may be present in the user interface and is also
* used to refer to the filter when it is persisted.
* <!-- end-user-doc -->
* @param value the new value of the '<em>Name</em>' attribute.
* @see #getName()
*/
void setName(String value);
public void setName(String value);
/**
* Returns the value of the '<em><b>Type</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* Filters may be further typed for use by subsystems. The type is also uninterpreted by the
* filter. The type may be used to select a parser/interpreter for the filter strings.
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Type</em>' attribute.
* @see #setType(String)
*/
String getType();
public String getType();
/**
* Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#getType <em>Type</em>}' attribute.
* <!-- begin-user-doc -->
* Filters may be further typed for use by subsystems. The type is also uninterpreted by the
* filter. The type may be used to select a parser/interpreter for the filter strings.
* <!-- end-user-doc -->
* @param value the new value of the '<em>Type</em>' attribute.
* @see #getType()
*/
void setType(String value);
public void setType(String value);
/**
* Returns the value of the '<em><b>Supports Nested Filters</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* Specifies whether filters may be nested or not. If nested the intent is to apply this filter
* to the results of the parent filter - further restricting the resources selected by the
* parent filter. However, it is up to the subsystem to interpret exactly what "nesting" means.
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Supports Nested Filters</em>' attribute.
* @see #setSupportsNestedFilters(boolean)
*/
boolean isSupportsNestedFilters();
public boolean isSupportsNestedFilters();
/**
* Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isSupportsNestedFilters <em>Supports Nested Filters</em>}' attribute.
* <!-- begin-user-doc -->
* <p>
* Specifies whether filters may be nested or not. If nested the intent is to apply this filter
* to the results of the parent filter - further restricting the resources selected by the
* parent filter. However, it is up to the subsystem to interpret exactly what "nesting" means.
* </p>
* <!-- end-user-doc -->
* @param value the new value of the '<em>Supports Nested Filters</em>' attribute.
* @see #isSupportsNestedFilters()
*/
void setSupportsNestedFilters(boolean value);
public void setSupportsNestedFilters(boolean value);
/**
* Returns the value of the '<em><b>Relative Order</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* The relative order of a filter is intended to be used
* by a persistence mechanism to keep the filters in a particular order
@ -119,29 +103,25 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai
* occur later in the pool. It may be employed in the absence of another
* mechanism for maintaining order.
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Relative Order</em>' attribute.
* @see #setRelativeOrder(int)
*/
int getRelativeOrder();
public int getRelativeOrder();
/**
* Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#getRelativeOrder <em>Relative Order</em>}' attribute.
* <!-- begin-user-doc -->
* 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.
* <!-- end-user-doc -->
* @param value the new value of the '<em>Relative Order</em>' attribute.
* @see #getRelativeOrder()
*/
void setRelativeOrder(int value);
public void setRelativeOrder(int value);
/**
* Returns the value of the '<em><b>Default</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* This filter is a "default" filter in this filter pool.
* The meaning of "default" is determined by the subsystem in which it is deployed.
@ -149,29 +129,25 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai
* That is, the filter is "vendor supplied".
* There is no restriction on the number of default filters in a pool.
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Default</em>' attribute.
* @see #setDefault(boolean)
*/
boolean isDefault();
public boolean isDefault();
/**
* Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isDefault <em>Default</em>}' attribute.
* <!-- begin-user-doc -->
* 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.
* <!-- end-user-doc -->
* @param value the new value of the '<em>Default</em>' attribute.
* @see #isDefault()
*/
void setDefault(boolean value);
public void setDefault(boolean value);
/**
* Returns the value of the '<em><b>Strings Case Sensitive</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* An attribute that may be used by the subystems when interpreting the filter. Used
* to indicate whether or not comparisons involving the filter should be considered
@ -182,17 +158,15 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai
* If unset the value
* returned is from the parent filter pool.
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Strings Case Sensitive</em>' attribute.
* @see #isSetStringsCaseSensitive()
* @see #unsetStringsCaseSensitive()
* @see #setStringsCaseSensitive(boolean)
*/
boolean isStringsCaseSensitive();
public boolean isStringsCaseSensitive();
/**
* Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isStringsCaseSensitive <em>Strings Case Sensitive</em>}' attribute.
* <!-- begin-user-doc -->
* <p>
* An attribute that may be used by the subystems when interpreting the filter. Used
* to indicate whether or not comparisons involving the filter should be considered
@ -202,7 +176,6 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai
* <p>
* This will cause this attribute to be set in this filter.
* </p>
* <!-- end-user-doc -->
* @param value the new value of the '<em>Strings Case Sensitive</em>' attribute.
* @see #isSetStringsCaseSensitive()
* @see #unsetStringsCaseSensitive()
@ -212,7 +185,6 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai
/**
* Unsets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isStringsCaseSensitive <em>Strings Case Sensitive</em>}' attribute.
* <!-- begin-user-doc -->
* <p>
* An attribute that may be used by the subystems when interpreting the filter. Used
* to indicate whether or not comparisons involving the filter should be considered
@ -221,16 +193,14 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai
* </p><p>
* Causes this filter to use the value specified by the parent filter pool.
* </p>
* <!-- end-user-doc -->
* @see #isSetStringsCaseSensitive()
* @see #isStringsCaseSensitive()
* @see #setStringsCaseSensitive(boolean)
*/
void unsetStringsCaseSensitive();
public void unsetStringsCaseSensitive();
/**
* Returns whether the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isStringsCaseSensitive <em>Strings Case Sensitive</em>}' attribute is set.
* <!-- begin-user-doc -->
* <p>
* An attribute that may be used by the subystems when interpreting the filter. Used
* to indicate whether or not comparisons involving the filter should be considered
@ -240,17 +210,15 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai
* 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.
* </p>
* <!-- end-user-doc -->
* @return whether the value of the '<em>Strings Case Sensitive</em>' attribute is set.
* @see #unsetStringsCaseSensitive()
* @see #isStringsCaseSensitive()
* @see #setStringsCaseSensitive(boolean)
*/
boolean isSetStringsCaseSensitive();
public boolean isSetStringsCaseSensitive();
/**
* Returns the value of the '<em><b>Promptable</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* An attribute that may be used by the subystems when interpreting the filter.
* Typically used to indicate whether or not some sort of prompting is to occur when the
@ -258,15 +226,13 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai
* the start of a wizard or dialog. It may also have an effect on whether
* the state of the filter is saved when the workbench is shut down.
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Promptable</em>' attribute.
* @see #setPromptable(boolean)
*/
boolean isPromptable();
public boolean isPromptable();
/**
* Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isPromptable <em>Promptable</em>}' attribute.
* <!-- begin-user-doc -->
* <p>
* An attribute that may be used by the subystems when interpreting the filter.
* Typically used to indicate whether or not some sort of prompting is to occur when the
@ -274,25 +240,22 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai
* the start of a wizard or dialog. It may also have an effect on whether
* the state of the filter is saved when the workbench is shut down.
* </p>
* <!-- end-user-doc -->
* @param value the new value of the '<em>Promptable</em>' attribute.
* @see #isPromptable()
*/
void setPromptable(boolean value);
public void setPromptable(boolean value);
/**
* Returns the value of the '<em><b>Supports Duplicate Filter Strings</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* This attribute may be used by subsystems when interpreting the filter.
* Typically used when adding filter strings to the filter or as a hint when
* applying the filter to the resources understood by the subsystem.
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Supports Duplicate Filter Strings</em>' attribute.
* @see #setSupportsDuplicateFilterStrings(boolean)
*/
boolean isSupportsDuplicateFilterStrings();
public boolean isSupportsDuplicateFilterStrings();
/**
* Does this support duplicate filter strings?
@ -302,153 +265,130 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai
/**
* Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isSupportsDuplicateFilterStrings <em>Supports Duplicate Filter Strings</em>}' attribute.
* <!-- begin-user-doc -->
* <p>
* This attribute may be used by subsystems when interpreting the filter.
* Typically used when adding filter strings to the filter or as a hint when
* applying the filter to the resources understood by the subsystem.
* </p>
* <!-- end-user-doc -->
* @param value the new value of the '<em>Supports Duplicate Filter Strings</em>' attribute.
* @see #isSupportsDuplicateFilterStrings()
*/
void setSupportsDuplicateFilterStrings(boolean value);
public void setSupportsDuplicateFilterStrings(boolean value);
/**
* Returns the value of the '<em><b>Non Deletable</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* An attribute that can be used when managing filters in filter pools.
* Some filters should not be deleted.
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Non Deletable</em>' attribute.
* @see #setNonDeletable(boolean)
*/
boolean isNonDeletable();
public boolean isNonDeletable();
/**
* Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isNonDeletable <em>Non Deletable</em>}' attribute.
* <!-- begin-user-doc -->
* <p>
* An attribute that can be used when managing filters in filter pools.
* Some filters should not be deleted.
* </p>
* <!-- end-user-doc -->
* @param value the new value of the '<em>Non Deletable</em>' attribute.
* @see #isNonDeletable()
*/
void setNonDeletable(boolean value);
public void setNonDeletable(boolean value);
/**
* Returns the value of the '<em><b>Non Renamable</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* An attribute that can be used when managing filters in filter pools.
* Some filters should not be renamed.
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Non Renamable</em>' attribute.
* @see #setNonRenamable(boolean)
*/
boolean isNonRenamable();
public boolean isNonRenamable();
/**
* Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isNonRenamable <em>Non Renamable</em>}' attribute.
* <!-- begin-user-doc -->
* <p>
* An attribute that can be used when managing filters in filter pools.
* Some filters should not be renamed.
* </p>
* <!-- end-user-doc -->
* @param value the new value of the '<em>Non Renamable</em>' attribute.
* @see #isNonRenamable()
*/
void setNonRenamable(boolean value);
public void setNonRenamable(boolean value);
/**
* Returns the value of the '<em><b>Non Changable</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* An attribute that can be used when managing filters in filter pools.
* Some filters should not be modifiable.
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Non Changable</em>' attribute.
* @see #setNonChangable(boolean)
*/
boolean isNonChangable();
public boolean isNonChangable();
/**
* Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isNonChangable <em>Non Changable</em>}' attribute.
* <!-- begin-user-doc -->
* <p>
* An attribute that can be used when managing filters in filter pools.
* Some filters should not be modifiable.
* </p>
* <!-- end-user-doc -->
* @param value the new value of the '<em>Non Changable</em>' attribute.
* @see #isNonChangable()
*/
void setNonChangable(boolean value);
public void setNonChangable(boolean value);
/**
* Returns the value of the '<em><b>Strings Non Changable</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* An attribute that can be used when managing filters in filter pools.
* Some filters contain filter strings that should not be modifiable.
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Strings Non Changable</em>' attribute.
* @see #setStringsNonChangable(boolean)
*/
boolean isStringsNonChangable();
public boolean isStringsNonChangable();
/**
* Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isStringsNonChangable <em>Strings Non Changable</em>}' attribute.
* <!-- begin-user-doc -->
* <p>
* An attribute that can be used when managing filters in filter pools.
* Some filters contain filter strings that should not be modifiable.
* </p>
* <!-- end-user-doc -->
* @param value the new value of the '<em>Strings Non Changable</em>' attribute.
* @see #isStringsNonChangable()
*/
void setStringsNonChangable(boolean value);
public void setStringsNonChangable(boolean value);
/**
* Returns the value of the '<em><b>Release</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* This is an attribute specifying the release level of the
* filter. This will be persisted in the filter definition and
* can be used to migrate the internal form of the filter.
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Release</em>' attribute.
* @see #setRelease(int)
*/
int getRelease();
public int getRelease();
/**
* Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#getRelease <em>Release</em>}' attribute.
* <!-- begin-user-doc -->
* <p>
* This is an attribute specifying the release level of the
* filter. This will be persisted in the filter definition and
* can be used to migrate the internal form of the filter.
* </p>
* <!-- end-user-doc -->
* @param value the new value of the '<em>Release</em>' attribute.
* @see #getRelease()
*/
void setRelease(int value);
public void setRelease(int value);
/**
* Returns the value of the '<em><b>Single Filter String Only</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* This attribute specifies that the filter may contain only a single
* filter string. Used by a filter manager to ensure that the
@ -458,17 +398,15 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai
* This attribute may be set or unset. If unset this value will be inherited
* from the parent filter pool.
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Single Filter String Only</em>' attribute.
* @see #isSetSingleFilterStringOnly()
* @see #unsetSingleFilterStringOnly()
* @see #setSingleFilterStringOnly(boolean)
*/
boolean isSingleFilterStringOnly();
public boolean isSingleFilterStringOnly();
/**
* Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isSingleFilterStringOnly <em>Single Filter String Only</em>}' attribute.
* <!-- begin-user-doc -->
* <p>
* This attribute specifies that the filter may contain only a single
* filter string. Used by a filter manager to ensure that the
@ -478,84 +416,71 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai
* This causes the attribute to be set for this filter, ignoring the value
* specified for the parent filter pool.
* </p>
* <!-- end-user-doc -->
* @param value the new value of the '<em>Single Filter String Only</em>' attribute.
* @see #isSetSingleFilterStringOnly()
* @see #unsetSingleFilterStringOnly()
* @see #isSingleFilterStringOnly()
*/
void setSingleFilterStringOnly(boolean value);
public void setSingleFilterStringOnly(boolean value);
/**
* Unsets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isSingleFilterStringOnly <em>Single Filter String Only</em>}' attribute.
* <!-- begin-user-doc -->
* This causes the value of this attribute to be inherited from the parent filter pool.
* <!-- end-user-doc -->
* @see #isSetSingleFilterStringOnly()
* @see #isSingleFilterStringOnly()
* @see #setSingleFilterStringOnly(boolean)
*/
void unsetSingleFilterStringOnly();
public void unsetSingleFilterStringOnly();
/**
* Returns whether the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isSingleFilterStringOnly <em>Single Filter String Only</em>}' attribute is set.
* <!-- begin-user-doc -->
* If true then the value of this attribute is set in this filter. If false it is inherited from the parent filter pool.
* <!-- end-user-doc -->
* @return whether the value of the '<em>Single Filter String Only</em>' attribute is set.
* @see #unsetSingleFilterStringOnly()
* @see #isSingleFilterStringOnly()
* @see #setSingleFilterStringOnly(boolean)
*/
boolean isSetSingleFilterStringOnly();
public boolean isSetSingleFilterStringOnly();
/**
* Returns the value of the '<em><b>Nested Filters</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.rse.core.filters.ISystemFilter}.
* It is bidirectional and its opposite is '{@link org.eclipse.rse.core.filters.ISystemFilter#getParentFilter <em>Parent Filter</em>}'.
* <!-- begin-user-doc -->
* <p>
* If this filter can contain child filters this will return the list of children.
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Nested Filters</em>' containment reference list.
* @see org.eclipse.rse.core.filters.ISystemFilter#getParentFilter
*/
List getNestedFilters();
public ISystemFilter[] getNestedFilters();
/**
* Returns the value of the '<em><b>Parent Filter</b></em>' container reference.
* It is bidirectional and its opposite is '{@link org.eclipse.rse.core.filters.ISystemFilter#getNestedFilters <em>Nested Filters</em>}'.
* <!-- begin-user-doc -->
* <p>
* If this filter can be nested inside another this will return the parent filter. Will be
* null if there is no parent.
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Parent Filter</em>' container reference.
* @see #setParentFilter(ISystemFilter)
* @see org.eclipse.rse.core.filters.ISystemFilter#getNestedFilters
*/
ISystemFilter getParentFilter();
public ISystemFilter getParentFilter();
/**
* Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#getParentFilter <em>Parent Filter</em>}' container reference.
* <!-- begin-user-doc -->
* This is used by a filter manager to set the parent filter when one filter is nested inside another.
* <!-- end-user-doc -->
* @param value the new value of the '<em>Parent Filter</em>' container reference.
* @see #getParentFilter()
*/
void setParentFilter(ISystemFilter value);
public void setParentFilter(ISystemFilter value);
/**
* Returns the value of the '<em><b>Strings</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.rse.core.filters.ISystemFilterString}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Strings</em>' containment reference list.
*/
List getStrings();
public ISystemFilterString[] getStrings();
/**
* @return the parent pool of this filter. For nested filters, this will walk up the parent chain
@ -570,13 +495,6 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai
*/
public void setParentFilterPool(ISystemFilterPool parentPool);
/**
* Set this filter's filter strings by giving a Vector of String objects.
* This will construct the filter strings objects.
* @param strings the vector of String objects.
*/
public void setFilterStrings(Vector strings);
/**
* Set this filter's filter strings by giving an array of String objects.
* This will construct the filter strings objects.
@ -585,22 +503,14 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai
public void setFilterStrings(String[] strings);
/**
* @return this filter's filter strings as a Vector of String objects
*/
public Vector getFilterStringsVector();
/**
* @return this filter's filter strings as a Vector of IFilterString objects
*/
public Vector getFilterStringObjectsVector();
/**
* @return this filter's filter strings as an array of String objects
* @return this filter's filter strings as an array of String objects. This array will
* not be null, but may be empty.
*/
public String[] getFilterStrings();
/**
* @return this filter's filter string objects as an array of IFilterString objects
* @return this filter's filter string objects as an array of IFilterString objects.
* This array will not be null, but may be empty.
*/
public ISystemFilterString[] getSystemFilterStrings();

View file

@ -16,8 +16,6 @@
*******************************************************************************/
package org.eclipse.rse.core.filters;
import java.util.Vector;
import org.eclipse.rse.core.model.IRSEPersistableContainer;
/**
@ -44,7 +42,7 @@ public interface ISystemFilterContainer extends IRSEPersistableContainer {
* @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);
public ISystemFilter createSystemFilter(String aliasName, String[] filterStrings);
/**
* Adds given filter to the list without populating the filter strings.
@ -57,12 +55,7 @@ public interface ISystemFilterContainer extends IRSEPersistableContainer {
* @return Vector of String objects: the names of existing filters in this container.
* Typically used by name validators for New and Rename actions to verify new name is unique.
*/
public Vector getSystemFilterNames();
/**
* @return a Vector of the ISystemFilter objects contained in this filter container.
*/
public Vector getSystemFiltersVector();
public String[] getSystemFilterNames();
/**
* @return an array of the ISystemFilter objects contained in this filter container.

View file

@ -17,8 +17,6 @@
package org.eclipse.rse.core.filters;
import java.util.List;
import org.eclipse.rse.core.model.IRSEModelObject;
import org.eclipse.rse.core.references.IRSEPersistableReferencedObject;
@ -33,18 +31,6 @@ public interface ISystemFilterPool extends IRSEPersistableReferencedObject, ISys
*/
public ISystemFilterPoolManagerProvider getProvider();
/**
* Set the naming policy used when saving data to disk.
* @see org.eclipse.rse.core.filters.IRSEFilterNamingPolicy
*/
public void setNamingPolicy(IRSEFilterNamingPolicy namingPolicy);
/**
* Get the naming policy currently used when saving data to disk.
* @see org.eclipse.rse.core.filters.IRSEFilterNamingPolicy
*/
public IRSEFilterNamingPolicy getNamingPolicy();
/**
* @return true if filters in this pool support nested filters.
*/
@ -121,16 +107,6 @@ public interface ISystemFilterPool extends IRSEPersistableReferencedObject, ISys
*/
public void orderSystemFilters(String[] names);
/**
* Set the save file policy. See constants in SystemFilterConstants. One of:
* <ul>
* <li>SAVE_POLICY_ONE_FILE_PER_POOL
* <li>SAVE_POLICY_ONE_FILE_PER_FILTER
* </ul>
* This method is called by the SystemFilterPoolManager.
*/
public void setSavePolicy(int policy);
/**
* @return the id of the filter pool. Used for referencing this filter pool from filter pool references.
*/
@ -211,9 +187,9 @@ public interface ISystemFilterPool extends IRSEPersistableReferencedObject, ISys
public boolean isSetStringsCaseSensitive();
/**
* @return The list of Filters references
* @return An array of filters in this pool
*/
public List getFilters();
public ISystemFilter[] getFilters();
/**
* @return The value of the SupportsDuplicateFilterStrings attribute

View file

@ -18,67 +18,16 @@
package org.eclipse.rse.core.filters;
import java.util.Vector;
import org.eclipse.rse.core.model.IRSEPersistableContainer;
import org.eclipse.rse.core.model.ISystemProfile;
/**
* A filter pool manager manages filter pools.
* <p>
* Each filter pool that is managed becomes a folder on disk.
* <p>
* To create a filter pool manager instance, use the factory methods
* in SystemFilterPoolManagerImpl in the ...impl package.
* You must pass a folder that represents the anchor point for the
* pools managed by this manager instance.
* <p>
* Depending on your tools' needs, you have four choices about how
* the filter pools and filters are persisted to disk. The decision is
* made at the time you instantiate the pool manager and is one of the
* following constants from the {@link SystemFilterConstants} interface:
* <ul>
* <li>SAVE_POLICY_ONE_FILE_PER_MANAGER - one file: mgrName.xmi
* <li>SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL - one file and folder per pool
* <li>SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER - one file per pool, all files in one folder
* <li>SAVE_POLICY_ONE_FILE_PER_FILTER - one file per filter, one folder per pool
* </ul>
* <p>
* With the policy of one file per pool, there are two possibilities regarding
* the folder structure:
* <ul>
* <li>Each pool gets its own subfolder, and the pool's xmi file goes in
* the pool's unique subfolder: SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL
* <li>There are no subfolders per pool, all the xmi pool files go in the
* same folder as specified when creating this manager instance:
* SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER
* </ul>
* <p>
* With the policy of one file per filter, each filter pool must have its own folder.
* <p>
* With an instantiated filter pool manager (most tools will only need
* one such instance), you now simply call its methods to work with
* filter pools. For example, use it to:
* <ul>
* <li>Restore all filter pools from disk
* <li>Save all, or individual, filter pools to disk
* <li>Get a list of existing filter pools
* <li>Create filter pools
* <li>Delete filter pools
* <li>Re-order filter pools
* <li>Clone filter pools
* <li>Rename filter pools
* <li>Save all, or individual, filter pools
* </ul>
* All the underlying file system work is handled for you.
* <p>
* Further, this is the front door for working with filters too. By forcing all
* filter related activity through a single point like this, we can ensure that
* all changes are saved to disk, and events are fired properly.
*/
/**
* @lastgen interface SystemFilterPoolManager {}
*/
public interface ISystemFilterPoolManager extends IRSEPersistableContainer {
// ---------------------------------
// ATTRIBUTE METHODS
@ -166,11 +115,6 @@ public interface ISystemFilterPoolManager extends IRSEPersistableContainer {
*/
public String[] getSystemFilterPoolNames();
/**
* Get vector of filter pool names currently existing.
*/
public Vector getSystemFilterPoolNamesVector();
/**
* Return array of SystemFilterPools managed by this manager.
*/
@ -312,11 +256,11 @@ public interface ISystemFilterPoolManager extends IRSEPersistableContainer {
* @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(ISystemFilterContainer parent, String aliasName, Vector filterStrings) throws Exception;
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, String[] filterStrings) throws Exception;
/**
* Creates a new system filter that is typed.
* Same as {@link #createSystemFilter(ISystemFilterContainer, String, Vector)} but
* Same as {@link #createSystemFilter(ISystemFilterContainer, String, String[])} but
* takes a filter type as an additional parameter.
* <p>
* A filter's type is an arbitrary string that is not interpreted or used by the base framework. This
@ -328,11 +272,11 @@ public interface ISystemFilterPoolManager extends IRSEPersistableContainer {
* @param filterStrings The list of String objects that represent the filter strings.
* @param type The type of this filter
*/
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, Vector filterStrings, String type) throws Exception;
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, String[] filterStrings, String type) throws Exception;
/**
* Creates a new system filter that is typed and promptable
* Same as {@link #createSystemFilter(ISystemFilterContainer, String ,Vector, String)} but
* Same as {@link #createSystemFilter(ISystemFilterContainer, String ,String[], String)} but
* takes a boolean indicating if it is promptable.
* <p>
* A promptable filter is one in which the user is prompted for information at expand time.
@ -345,7 +289,7 @@ public interface ISystemFilterPoolManager extends IRSEPersistableContainer {
* @param type The type of this filter
* @param promptable Pass true if this is a promptable filter
*/
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, Vector filterStrings, String type, boolean promptable) throws Exception;
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, String[] filterStrings, String type, boolean promptable) throws Exception;
/**
* Delete an existing system filter.
@ -567,12 +511,6 @@ public interface ISystemFilterPoolManager extends IRSEPersistableContainer {
*/
void setStringsCaseSensitive(boolean value);
/**
* @generated This field/method will be replaced during code generation
* @return The list of Pools references
*/
java.util.List getPools();
/**
* @generated This field/method will be replaced during code generation
* @return The value of the SupportsDuplicateFilterStrings attribute

View file

@ -17,9 +17,6 @@
package org.eclipse.rse.core.filters;
import java.util.Vector;
import org.eclipse.core.resources.IFolder;
import org.eclipse.rse.core.references.IRSEBasePersistableReferenceManager;
import org.eclipse.rse.core.subsystems.ISubSystem;
@ -258,40 +255,4 @@ public interface ISystemFilterPoolReferenceManager extends IRSEBasePersistableRe
*/
public int getSystemFilterReferencePosition(ISubSystem subSystem, ISystemFilter filter);
// -------------------------
// SAVE / RESTORE METHODS...
// -------------------------
/**
* After restoring this from disk, there is only the referenced object name,
* not the referenced object pointer, for each referencing object.
* <p>
* This method is called after restore and for each restored object in the list must:
* <ol>
* <li>Do what is necessary to find the referenced object, and set the internal reference pointer.
* <li>Call addReference(this) on that object so it can maintain it's in-memory list
* of all referencing objects.
* <li>Set the important transient variables
* </ol>
* @param relatedPoolMgrProvider the creator of the filter pool managers that hold filter pools we reference
* @param provider the host of this reference manager, so you can later call getProvider
* @return A Vector of SystemFilterPoolReferences that were not successfully resolved, or null if all
* were resolved.
*/
public Vector resolveReferencesAfterRestore(ISystemFilterPoolManagerProvider relatedPoolMgrProvider, ISystemFilterPoolReferenceManagerProvider provider);
/**
* Save all the filter pool references to disk.
* Use only if not doing your own saving, else override or set save policy to none.
*/
public void save() throws Exception;
/**
* Return the folder that this manager is contained in.
*/
public IFolder getFolder();
/**
* Reset the folder that this manager is contained in.
*/
public void resetManagerFolder(IFolder newFolder);
}

View file

@ -26,9 +26,6 @@ import org.eclipse.rse.core.subsystems.ISubSystem;
* Represents a shadow or reference to a system filter.
* Such references are only transient, not savable to disk.
*/
/**
* @lastgen interface SystemFilterReference extends SystemReferencingObject, SystemFilterContainerReference {}
*/
public interface ISystemFilterReference extends IRSEReferencingObject, ISystemFilterContainerReference, ISystemContainer {
/**
* Return the reference manager which is managing this filter reference
@ -51,7 +48,7 @@ public interface ISystemFilterReference extends IRSEReferencingObject, ISystemFi
/**
* Sets the subsystem that contains this reference
* @param subSystem
* @param subSystem the subsystem that holds this reference
*/
public void setSubSystem(ISubSystem subSystem);

View file

@ -1,47 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002, 2007 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
*******************************************************************************/
package org.eclipse.rse.core.filters;
/**
* A save policy dictates how filter framework artifacts are persisted to disk.
*/
public interface ISystemFilterSavePolicies {
/**
* No saving. All save/restoring handled elsewhere.
*/
public static final int SAVE_POLICY_NONE = -1;
/**
* Save all filter pools and all filters in one file, with same name as the manager
*/
public static final int SAVE_POLICY_ONE_FILE_PER_MANAGER = 0;
/**
* Save all filters in each filter pool in one file per pool, with the same name as the pool.
* Each pool also has its own unique folder.
*/
public static final int SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL = 1;
/**
* Save all filters in each filter pool in one file per pool, with the same name as the pool
* All pool files go into the same folder.
*/
public static final int SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER = 2;
/**
* Save each filter in each filter pool in its own file, with the same name as the filter
*/
public static final int SAVE_POLICY_ONE_FILE_PER_FILTER = 3;
}

View file

@ -15,12 +15,6 @@ import org.eclipse.rse.logging.Logger;
public interface ISystemFilterStartHere {
/**
* Factory method to return an instance populated with defaults.
* You can then simply override whatever is desired via setXXX methods.
*/
public IRSEFilterNamingPolicy createSystemFilterNamingPolicy();
/**
* Factory to create a filter pool manager, when you do NOT want it to worry about
* saving and restoring the filter data to disk. Rather, you will save and restore
@ -50,8 +44,7 @@ public interface ISystemFilterStartHere {
* this manager will contain references to.
* @param name the name of the filter pool reference manager. This is not currently
* used, but you may find a use for it.
* @param namingPolicy the naming policy object which will return the name of that one file.
*/
public ISystemFilterPoolReferenceManager createSystemFilterPoolReferenceManager(ISystemFilterPoolReferenceManagerProvider caller, ISystemFilterPoolManagerProvider relatedPoolMgrProvider,
String name, IRSEFilterNamingPolicy namingPolicy);
String name);
}

View file

@ -20,9 +20,8 @@ package org.eclipse.rse.core.filters;
import org.eclipse.rse.core.references.IRSEBaseReferencingObject;
/**
* Represents a reference to a master filter string.
* Needed so GUI can show the same filter string multiple times.
* This is not modelled in MOF.
* Represents a reference to a filter string.
* Needed so the UI can show the same filter string multiple times.
*/
public interface ISystemFilterStringReference extends IRSEBaseReferencingObject {
/**
@ -57,4 +56,4 @@ public interface ISystemFilterStringReference extends IRSEBaseReferencingObject
* Same as getReferencedFilterString().getString()
*/
public String getString();
} //SystemFilterStringReference
}

View file

@ -1,149 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002, 2007 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
*******************************************************************************/
package org.eclipse.rse.core.filters;
/**
* A naming policy so tool writers can override defaults used when
* saving filter data to disk.
* <p>
* Subclass this and override what you wish to change.
*/
public class SystemFilterNamingPolicy implements IRSEFilterNamingPolicy {
protected String managerFileNamePrefix;
protected String poolFolderNamePrefix;
protected String poolFolderNameSuffix;
protected String poolFileNamePrefix;
protected String filterFileNamePrefix;
protected String referenceManagerFileNamePrefix;
/**
* Default prefix for filter pool manager persisted file: "filterPools_"
*/
public static final String DEFAULT_FILENAME_PREFIX_FILTERPOOLMANAGER = "filterPools_"; //$NON-NLS-1$
/**
* Default prefix for filter pool reference manager persisted file: "filterPoolRefs_"
*/
public static final String DEFAULT_FILENAME_PREFIX_FILTERPOOLREFERENCEMANAGER = "filterPoolRefs_"; //$NON-NLS-1$
/**
* Default prefix for filter pool persisted file: "filterPool_"
*/
public static final String DEFAULT_FILENAME_PREFIX_FILTERPOOL = "filterPool_"; //$NON-NLS-1$
/**
* Default prefix for filter persisted file: "filter_"
*/
public static final String DEFAULT_FILENAME_PREFIX_FILTER = "filter_"; //$NON-NLS-1$
/**
* Default prefix for filter pool folder: "FilterPool_"
*/
public static final String DEFAULT_FOLDERNAME_PREFIX_FILTERPOOL = "FilterPool_"; //$NON-NLS-1$
/**
* Factory method to return an instance populated with defaults.
* Can then simply override whatever is desired.
*/
public static IRSEFilterNamingPolicy getNamingPolicy() {
return new SystemFilterNamingPolicy();
}
/**
* Constructor for SystemFilterNamingPolicyImpl
*/
public SystemFilterNamingPolicy() {
super();
}
/**
* Get the unqualified save file name for the given SystemFilterPoolManager object.
* Do NOT include the extension, as .xmi will be added.
* <p>
* Returns "filterPools_"+managerName by default.
*/
public String getManagerSaveFileName(String managerName) {
return DEFAULT_FILENAME_PREFIX_FILTERPOOLMANAGER + managerName;
}
/**
* Get the unqualified save file name for the given SystemFilterPoolReferenceManager object.
* Do NOT include the extension, as .xmi will be added.
* <p>
* Returns "filterPoolRefs_"+managerName by default.
*/
public String getReferenceManagerSaveFileName(String managerName) {
return DEFAULT_FILENAME_PREFIX_FILTERPOOLREFERENCEMANAGER + managerName;
}
/**
* Get the unqualified save file name for the given SystemFilterPool object.
* Do NOT include the extension, as .xmi will be added.
* <p>
* Returns getFilterPoolSaveFileNamePrefix()+poolName by default.
*/
public String getFilterPoolSaveFileName(String poolName) {
return getFilterPoolSaveFileNamePrefix() + poolName;
}
/**
* Get the file name prefix for all pool files.
* Used to deduce the saved pools by examining the file system
* <p>
* By default returns "filterPool_"
*/
public String getFilterPoolSaveFileNamePrefix() {
return DEFAULT_FILENAME_PREFIX_FILTERPOOL;
}
/**
* Get the folder name for the given SystemFilterPool object.
* <p>
* Returns getFilterPoolFolderNamePrefix()+poolName by default.
*/
public String getFilterPoolFolderName(String poolName) {
return getFilterPoolFolderNamePrefix() + poolName;
}
/**
* Get the folder name prefix for all pool folders.
* Used to deduce the saved pools by examining the file system
* <p>
* By default returns "FilterPool_"
*/
public String getFilterPoolFolderNamePrefix() {
return DEFAULT_FOLDERNAME_PREFIX_FILTERPOOL;
}
/**
* Get the unqualified save file name for the given SystemFilter object.
* Do NOT include the extension, as .xmi will be added.
* <p>
* Returns getFilterSaveFileNamePrefix()+filterName by default.
*/
public String getFilterSaveFileName(String filterName) {
return getFilterSaveFileNamePrefix() + filterName;
}
/**
* Get the file name prefix for all filter files.
* Used to deduce the saved filters by examining the file system
* <p>
* Returns "Filter_" by default.
*/
public String getFilterSaveFileNamePrefix() {
return DEFAULT_FILENAME_PREFIX_FILTER;
}
}

View file

@ -15,8 +15,11 @@
********************************************************************************/
package org.eclipse.rse.core.filters;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Platform;
@ -29,8 +32,6 @@ import org.eclipse.rse.internal.core.filters.SystemFilterContainerReferenceCommo
import org.eclipse.rse.internal.core.filters.SystemFilterStringReference;
import org.eclipse.rse.internal.references.SystemReferencingObject;
/**
* Represents a shadow or reference to a system filter.
* Such references are only transient, not savable to disk.
@ -46,49 +47,44 @@ import org.eclipse.rse.internal.references.SystemReferencingObject;
/**
* @lastgen class SystemFilterReferenceImpl extends SystemReferencingObjectImpl implements IAdaptable, SystemFilterReference, SystemReferencingObject {}
*/
public class SystemFilterReference extends SystemReferencingObject implements IAdaptable, ISystemFilterReference
{
public class SystemFilterReference extends SystemReferencingObject implements IAdaptable, ISystemFilterReference {
private SystemFilterContainerReferenceCommonMethods containerHelper = null;
private ISystemFilterContainerReference parent = null;
private ISystemFilterContainerReference parent = null;
private ISystemFilter referencedFilter = null;
private ISystemFilterStringReference[] referencedFilterStrings = null;
protected boolean persistent;
protected boolean isStale;
// protected Object[] cachedContents;
protected ISubSystem _subSystem;
protected HashMap cachedContents;
public static final boolean PERSISTENT_YES = true;
public static final boolean PERSISTENT_NO = false;
public static final boolean PERSISTENT_NO = false;
/**
* Constructor. Typically called by MOF.
* Constructor.
*/
protected SystemFilterReference()
{
protected SystemFilterReference() {
super();
containerHelper = new SystemFilterContainerReferenceCommonMethods(this);
persistent = true;
isStale = true;
cachedContents = new HashMap();
}
/**
* Create a new instance of this class.
* @param parent The SystemFilterReference or SystemFilterPoolReference object that we are a child of.
* @param filter The master object to be referenced.
* @param persistent Whether we should formally register our reference with the target filter or not.
*/
public static ISystemFilterReference createSystemFilterReference(ISubSystem subSystem,
ISystemFilterContainerReference parent,
ISystemFilter filter,
boolean persistent)
{
//SystemFilterReferenceImpl newRef = (SystemFilterReferenceImpl)SystemFilterImpl.initMOF().createSystemFilterReference();
SystemFilterReference newRef = new SystemFilterReference(); // more efficient?
public static ISystemFilterReference createSystemFilterReference(ISubSystem subSystem, ISystemFilterContainerReference parent, ISystemFilter filter, boolean persistent) {
SystemFilterReference newRef = new SystemFilterReference();
newRef.persistent = persistent;
newRef.setSubSystem(subSystem);
newRef.setParent(parent);
newRef.setReferencedFilter(filter);
newRef.setReferencedFilter(filter);
filter.addReference(newRef);
return newRef;
}
@ -97,113 +93,102 @@ public class SystemFilterReference extends SystemReferencingObject implements IA
* Gets the subsystem that contains this reference
* @return the subsystem
*/
public ISubSystem getSubSystem()
{
public ISubSystem getSubSystem() {
return _subSystem;
}
/**
* Sets the subsystem that contains this reference
* @param subSystem
* @param subSystem the subsystem that holds this reference
*/
public void setSubSystem(ISubSystem subSystem)
{
public void setSubSystem(ISubSystem subSystem) {
_subSystem = subSystem;
}
/**
* Return the reference manager which is managing this filter reference
* framework object.
*/
public ISystemFilterPoolReferenceManager getFilterPoolReferenceManager()
{
public ISystemFilterPoolReferenceManager getFilterPoolReferenceManager() {
ISystemFilterPoolReference pool = getParentSystemFilterReferencePool();
if (pool != null)
return pool.getFilterPoolReferenceManager();
return pool.getFilterPoolReferenceManager();
else
return null;
return null;
}
/**
* 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
* framework object
*/
public ISystemFilterPoolReferenceManagerProvider getProvider()
{
ISystemFilterPoolReferenceManager mgr = getFilterPoolReferenceManager();
if (mgr != null)
{
ISystemFilterPoolReferenceManagerProvider provider = mgr.getProvider();
if (provider == null)
{
provider = getSubSystem();
}
return provider;
}
else
return null;
}
public ISystemFilterPoolReferenceManagerProvider getProvider() {
ISystemFilterPoolReferenceManager mgr = getFilterPoolReferenceManager();
if (mgr != null) {
ISystemFilterPoolReferenceManagerProvider provider = mgr.getProvider();
if (provider == null) {
provider = getSubSystem();
}
return provider;
} else
return null;
}
/**
* If this is a reference to a nested filter, the parent is the
* reference to the nested filter's parent. Else, it is the
* reference to the parent filter pool
*/
public void setParent(ISystemFilterContainerReference parent)
{
this.parent = parent;
}
/**
* The parent will either by a SystemFilterPoolReference or
* a SystemFilterReference.
*/
public ISystemFilterContainerReference getParent()
{
return parent;
}
/**
* If this is a reference to a nested filter, the parent is the
* reference to the nested filter's parent. Else, it is the
* reference to the parent filter pool
*/
public void setParent(ISystemFilterContainerReference parent) {
this.parent = parent;
}
/**
* The parent will either by a SystemFilterPoolReference or
* a SystemFilterReference.
*/
public ISystemFilterContainerReference getParent() {
return parent;
}
/**
* Return the filter to which we reference...
*/
public ISystemFilter getReferencedFilter()
{
return persistent ? (ISystemFilter)super.getReferencedObject() : referencedFilter;
public ISystemFilter getReferencedFilter() {
return persistent ? (ISystemFilter) super.getReferencedObject() : referencedFilter;
}
/**
* Set the filter to which we reference...
*/
public void setReferencedFilter(ISystemFilter filter)
{
public void setReferencedFilter(ISystemFilter filter) {
if (persistent)
super.setReferencedObject(filter);
super.setReferencedObject(filter);
else
referencedFilter = filter;
referencedFilter = filter;
}
/**
* If this is a reference to a nested filter, the parent is the
* reference to the nested filter's parent. Else, it is the
* reference to the parent filter pool
*/
public ISystemFilterPoolReference getParentSystemFilterReferencePool()
{
if (parent instanceof ISystemFilterPoolReference)
return (ISystemFilterPoolReference)parent;
else
return ((ISystemFilterReference)parent).getParentSystemFilterReferencePool();
}
/**
/**
* If this is a reference to a nested filter, the parent is the
* reference to the nested filter's parent. Else, it is the
* reference to the parent filter pool
*/
public ISystemFilterPoolReference getParentSystemFilterReferencePool() {
if (parent instanceof ISystemFilterPoolReference)
return (ISystemFilterPoolReference) parent;
else
return ((ISystemFilterReference) parent).getParentSystemFilterReferencePool();
}
/**
* This is the method required by the IAdaptable interface.
* Given an adapter class type, return an object castable to the type, or
* null if this is not possible.
*/
public Object getAdapter(Class adapterType)
{
return Platform.getAdapterManager().getAdapter(this, adapterType);
}
public Object getAdapter(Class adapterType) {
return Platform.getAdapterManager().getAdapter(this, adapterType);
}
// -------------------------------------------------------------
// Methods common with SystemFilterPoolReferenceImpl, and hence
// abstracted out into SystemFilterContainerReference...
@ -217,10 +202,10 @@ public class SystemFilterReference extends SystemReferencingObject implements IA
* true that we only hold a SystemFilter. Hence, this is the same
* as calling getReferenceFilter and casting the result.
*/
public ISystemFilterContainer getReferencedSystemFilterContainer()
{
public ISystemFilterContainer getReferencedSystemFilterContainer() {
return getReferencedFilter();
}
/**
* Build and return an array of SystemFilterReference objects.
* Each object is created new. There is one for each of the filters
@ -229,159 +214,141 @@ public class SystemFilterReference extends SystemReferencingObject implements IA
* return a fresh one if something changes in the underlying
* filter list.
*/
public ISystemFilterReference[] getSystemFilterReferences(ISubSystem 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(ISubSystem, 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(ISubSystem, ISystemFilter)
*/
public ISystemFilterReference getExistingSystemFilterReference(ISubSystem subSystem, ISystemFilter filter)
{
return containerHelper.getExistingSystemFilterReference(subSystem, filter);
}
/**
* Return true if the referenced pool or filter has filters.
*/
public boolean hasFilters()
{
return containerHelper.hasFilters();
}
public ISystemFilterReference[] getSystemFilterReferences(ISubSystem subSystem) {
List references = containerHelper.getSystemFilterReferences(subSystem);
ISystemFilterReference[] result = new ISystemFilterReference[references.size()];
references.toArray(result);
return result;
}
/**
* Return count of the number of filters in the referenced pool or filter
*/
public int getFilterCount()
{
return containerHelper.getFilterCount();
}
/**
* 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(ISubSystem, ISystemFilter)
*/
public ISystemFilterReference getSystemFilterReference(ISubSystem subSystem, ISystemFilter filter) {
//return containerHelper.generateFilterReference(filter);
return containerHelper.generateAndRecordFilterReference(subSystem, filter);
}
/**
* 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 an existing reference to a given system filter.
* If no reference currently exists to this filter, returns null.
* @see #getSystemFilterReference(ISubSystem, ISystemFilter)
*/
public ISystemFilterReference getExistingSystemFilterReference(ISubSystem subSystem, ISystemFilter filter) {
return containerHelper.getExistingSystemFilterReference(subSystem, filter);
}
/**
* Return true if the referenced pool or filter has filters.
*/
public boolean hasFilters() {
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() {
ISystemFilter filter = getReferencedFilter();
if (filter != null)
return filter.getName();
return filter.getName();
else
return ""; //$NON-NLS-1$
return ""; //$NON-NLS-1$
}
/**
* Override of Object method. Turn this filter in an outputable string
*/
public String toString()
{
public String toString() {
return getName();
}
// -------------------------------------------------
// Methods for returning filter string references...
// -------------------------------------------------
/**
* Return the number of filter strings in the referenced filter
*/
public int getSystemFilterStringCount()
{
int count = 0;
ISystemFilter referencedFilter = getReferencedFilter();
if (referencedFilter != null)
count = referencedFilter.getFilterStringCount();
return count;
}
/**
* Get the filter strings contained by this filter. But get references to each,
* not the masters.
*/
public ISystemFilterStringReference[] getSystemFilterStringReferences()
{
// These reference objects are built on the fly, each time, rather than
// maintaining a persisted list of such references. The reason
// is we do no at this time allow users to subset the master list
// of strings maintained by a filter. Hence, we always simply
// return a complete list. However, to save memory we try to only
// re-gen the list if something has changed.
java.util.List mofList = getReferencedFilter().getStrings();
boolean needToReGen = compareFilterStrings(mofList);
if (needToReGen)
referencedFilterStrings = generateFilterStringReferences(mofList);
return referencedFilterStrings;
}
/**
* Create a single filter string refererence to a given filter string
*/
public ISystemFilterStringReference getSystemFilterStringReference(ISystemFilterString filterString)
{
return new SystemFilterStringReference(this, filterString);
}
// -------------------------------------------------
// Methods for returning filter string references...
// -------------------------------------------------
/**
* Return the number of filter strings in the referenced filter
*/
public int getSystemFilterStringCount() {
int count = 0;
ISystemFilter referencedFilter = getReferencedFilter();
if (referencedFilter != null) count = referencedFilter.getFilterStringCount();
return count;
}
/**
* To save memory, we try to only regenerate the referenced filter list
* if something has changed.
*/
private boolean compareFilterStrings(java.util.List newFilterStrings)
{
boolean mustReGen = false;
if (newFilterStrings == null)
{
if (referencedFilterStrings != null)
return true;
else
return false;
}
else if (referencedFilterStrings == null)
{
return true; // newFilterStrings != null && referencedFilterStrings == null
}
// both old and new are non-null
if (newFilterStrings.size() != referencedFilterStrings.length)
return true;
Iterator i = newFilterStrings.iterator();
for (int idx=0; !mustReGen && (idx<referencedFilterStrings.length); idx++)
{
ISystemFilterString newFilterString = (ISystemFilterString)i.next();
if (!(referencedFilterStrings[idx].getReferencedFilterString().equals(newFilterString)))
mustReGen = true;
}
return mustReGen;
}
/**
* To save the memory of an intermediate array, we create the filter string references
* directly from the MOF model...
*/
private ISystemFilterStringReference[] generateFilterStringReferences(java.util.List newFilterStrings)
{
if (newFilterStrings == null)
return null;
ISystemFilterStringReference[] refs = new ISystemFilterStringReference[newFilterStrings.size()];
Iterator i = newFilterStrings.iterator();
int idx = 0;
while (i.hasNext())
{
refs[idx++] = getSystemFilterStringReference((ISystemFilterString)i.next());
}
return refs;
}
/**
* Get the filter strings contained by this filter. But get references to each,
* not the masters.
*/
public ISystemFilterStringReference[] getSystemFilterStringReferences() {
// These reference objects are built on the fly, each time, rather than
// maintaining a persisted list of such references. The reason
// is we do no at this time allow users to subset the master list
// of strings maintained by a filter. Hence, we always simply
// return a complete list. However, to save memory we try to only
// re-gen the list if something has changed.
ISystemFilterString[] filterStrings = getReferencedFilter().getStrings();
List filterStringList = Arrays.asList(filterStrings);
boolean needToReGen = compareFilterStrings(filterStringList);
if (needToReGen) referencedFilterStrings = generateFilterStringReferences(filterStringList);
return referencedFilterStrings;
}
/**
* Create a single filter string refererence to a given filter string
*/
public ISystemFilterStringReference getSystemFilterStringReference(ISystemFilterString filterString) {
return new SystemFilterStringReference(this, filterString);
}
/**
* To save memory, we try to only regenerate the referenced filter list
* if something has changed.
*/
private boolean compareFilterStrings(List newFilterStrings) {
boolean mustReGen = false;
if (newFilterStrings == null) {
if (referencedFilterStrings != null)
return true;
else
return false;
} else if (referencedFilterStrings == null) {
return true; // newFilterStrings != null && referencedFilterStrings == null
}
// both old and new are non-null
if (newFilterStrings.size() != referencedFilterStrings.length) return true;
Iterator i = newFilterStrings.iterator();
for (int idx = 0; !mustReGen && (idx < referencedFilterStrings.length); idx++) {
ISystemFilterString newFilterString = (ISystemFilterString) i.next();
if (!(referencedFilterStrings[idx].getReferencedFilterString().equals(newFilterString))) mustReGen = true;
}
return mustReGen;
}
/**
* Get references to filter strings from a list of the filter strings
*/
private ISystemFilterStringReference[] generateFilterStringReferences(List newFilterStrings) {
if (newFilterStrings == null) return null;
ISystemFilterStringReference[] refs = new ISystemFilterStringReference[newFilterStrings.size()];
Iterator i = newFilterStrings.iterator();
int idx = 0;
while (i.hasNext()) {
refs[idx++] = getSystemFilterStringReference((ISystemFilterString) i.next());
}
return refs;
}
// -----------------------------------
// IRSEReferencingObject methods...
@ -390,108 +357,95 @@ public class SystemFilterReference extends SystemReferencingObject implements IA
/**
* Set the object to which we reference. Override of inherited
*/
public void setReferencedObject(IRSEBaseReferencedObject obj)
{
setReferencedFilter((ISystemFilter)obj);
public void setReferencedObject(IRSEBaseReferencedObject obj) {
setReferencedFilter((ISystemFilter) obj);
}
/**
* Get the object which we reference. Override of inherited
*/
public IRSEBaseReferencedObject getReferencedObject()
{
public IRSEBaseReferencedObject getReferencedObject() {
return getReferencedFilter();
}
/**
* Fastpath to getReferencedObject().removeReference(this).
* @return new reference count of master object
*/
public int removeReference()
{
public int removeReference() {
int count = 0;
if (persistent)
super.removeReference();
if (persistent) super.removeReference();
setReferencedFilter(null);
return count;
}
/* (non-Javadoc)
* @see org.eclipse.rse.model.ISystemContainer#hasContents(org.eclipse.rse.model.ISystemContentsType)
*/
public boolean hasContents(ISystemContentsType contentsType)
{
if (cachedContents.containsKey(contentsType))
{
return true;
}
return false;
}
/* (non-Javadoc)
* @see org.eclipse.rse.model.ISystemContainer#getContents(org.eclipse.rse.model.ISystemContentsType)
*/
public Object[] getContents(ISystemContentsType contentsType)
{
return (Object[])cachedContents.get(contentsType);
}
public void setContents(ISystemContentsType type, Object[] cachedContents)
{
this.cachedContents.put(type, cachedContents);
isStale = false;
}
/* (non-Javadoc)
* @see org.eclipse.rse.model.ISystemContainer#isStale()
*/
public boolean isStale()
{
return isStale;
}
/* (non-Javadoc)
* @see org.eclipse.rse.model.ISystemContainer#markStale(boolean)
*/
public void markStale(boolean isStale)
{
markStale(isStale, true);
}
/* (non-Javadoc)
* @see org.eclipse.rse.model.ISystemContainer#markStale(boolean)
*/
public void markStale(boolean isStale, boolean clearCache)
{
this.isStale = isStale;
if (clearCache && isStale)
{
Iterator iterator = cachedContents.values().iterator();
while (iterator.hasNext())
{
Object[] arr = (Object[])iterator.next();
for (int i = 0; i < arr.length; i++)
{
Object obj = arr[i];
if (obj instanceof ISystemContainer)
{
((ISystemContainer)obj).markStale(true);
}
}
}
cachedContents.clear();
}
}
public boolean commit()
{
/* (non-Javadoc)
* @see org.eclipse.rse.model.ISystemContainer#hasContents(org.eclipse.rse.model.ISystemContentsType)
*/
public boolean hasContents(ISystemContentsType contentsType) {
if (cachedContents.containsKey(contentsType)) {
return true;
}
return false;
}
public IRSEPersistableContainer getPersistableParent() {
return null;
}
public IRSEPersistableContainer[] getPersistableChildren() {
return IRSEPersistableContainer.NO_CHILDREN;
}
/* (non-Javadoc)
* @see org.eclipse.rse.model.ISystemContainer#getContents(org.eclipse.rse.model.ISystemContentsType)
*/
public Object[] getContents(ISystemContentsType contentsType) {
return (Object[]) cachedContents.get(contentsType);
}
public void setContents(ISystemContentsType type, Object[] cachedContents) {
this.cachedContents.put(type, cachedContents);
isStale = false;
}
/* (non-Javadoc)
* @see org.eclipse.rse.model.ISystemContainer#isStale()
*/
public boolean isStale() {
return isStale;
}
/* (non-Javadoc)
* @see org.eclipse.rse.model.ISystemContainer#markStale(boolean)
*/
public void markStale(boolean isStale) {
markStale(isStale, true);
}
/* (non-Javadoc)
* @see org.eclipse.rse.model.ISystemContainer#markStale(boolean)
*/
public void markStale(boolean isStale, boolean clearCache) {
this.isStale = isStale;
if (clearCache && isStale) {
Iterator iterator = cachedContents.values().iterator();
while (iterator.hasNext()) {
Object[] arr = (Object[]) iterator.next();
for (int i = 0; i < arr.length; i++) {
Object obj = arr[i];
if (obj instanceof ISystemContainer) {
((ISystemContainer) obj).markStale(true);
}
}
}
cachedContents.clear();
}
}
public boolean commit() {
return false;
}
public IRSEPersistableContainer getPersistableParent() {
return null;
}
public IRSEPersistableContainer[] getPersistableChildren() {
return IRSEPersistableContainer.NO_CHILDREN;
}
}

View file

@ -23,7 +23,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Vector;
import org.eclipse.core.resources.IFile;
import org.eclipse.rse.core.model.ISystemContainer;
@ -78,7 +77,7 @@ public class SystemFilterSimple extends SystemFilter implements ISystemContainer
*/
public void clone(ISystemFilter targetFilter) {
super.clone(targetFilter);
targetFilter.setFilterStrings(getFilterStringsVector());
targetFilter.setFilterStrings(getFilterStrings());
}
// -------------------------------------------------------
@ -197,15 +196,6 @@ public class SystemFilterSimple extends SystemFilter implements ISystemContainer
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 how many filter strings are defined in this filter.
*/
@ -213,15 +203,6 @@ public class SystemFilterSimple extends SystemFilter implements ISystemContainer
return filterStrings.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 array of String objects
@ -382,24 +363,17 @@ public class SystemFilterSimple extends SystemFilter implements ISystemContainer
}
/**
* Overridden to return null
* Overridden to return an empty array
*/
public Vector getSystemFilterNames() {
return null;
public String[] getSystemFilterNames() {
return new String[0];
}
/**
* Overridden to return null
* Overridden to return an empty array
*/
public java.util.List getNestedFilters() {
return null;
}
/**
* Overridden to return null
*/
public Vector getSystemFiltersVector() {
return null;
public ISystemFilter[] getNestedFilters() {
return new ISystemFilter[0];
}
/**
@ -417,10 +391,10 @@ public class SystemFilterSimple extends SystemFilter implements ISystemContainer
}
/**
* Overridden to return null
* Overridden to return an empty array
*/
public java.util.List getStrings() {
return null;
public ISystemFilterString[] getStrings() {
return new ISystemFilterString[0];
}
/**

View file

@ -17,7 +17,6 @@
package org.eclipse.rse.core.references;
import org.eclipse.core.resources.IFolder;
/**
* A class for managing a list of shadow objects that reference master objects.
@ -140,29 +139,6 @@ public interface IRSEBasePersistableReferenceManager {
*/
public IRSEBasePersistableReferencingObject getReferencedObject(IRSEBasePersistableReferencedObject object);
/**
* Attempt to save contents of manager to disk. Only call if not doing your own save from
* your own model that uses a subclass of this.
* @param folder The folder in which to save the manager.
* @param fileName The unqualified file name to save to. Should include extension, such as .xmi
*/
public void save(IFolder folder, String fileName) throws Exception;
/**
* After restoring this from disk, there is only the referenced object name,
* not the referenced object pointer, for each referencing object.
* <p>
* This method is called after restore and for each restored object in the list must:
* <ol>
* <li>Do what is necessary to find the referenced object, and set the internal reference pointer.
* <li>Call addReference(this) on that object so it can maintain it's in-memory list
* of all referencing objects.
* </ol>
* @return true if resolved successfully. False if some references were not found and
* hence those referencing objects removed from the restored list.
*/
public boolean resolveReferencesAfterRestore();
/**
* @generated This field/method will be replaced during code generation
* @return The value of the Name attribute

View file

@ -1,117 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002, 2007 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
*******************************************************************************/
package org.eclipse.rse.core.subsystems;
import org.eclipse.rse.core.filters.IRSEFilterNamingPolicy;
import org.eclipse.rse.core.filters.SystemFilterNamingPolicy;
/**
* A filter naming policy is responsible for returning the save file names for
* a given filter framework object.
* This policy implements our naming policy for the filter files in the
* remote systems project.
*/
public class SubSystemFilterNamingPolicy extends SystemFilterNamingPolicy implements IRSEFilterNamingPolicy {
/**
* Constructor for SubSystemFilterNamingPolicy
*/
public SubSystemFilterNamingPolicy() {
super();
}
/**
* Get the unqualified save file name for the given SystemFilterPoolManager object.
* Do NOT include the extension, as .xmi will be added.
* <p>
* Returns "filterPools_"+managerName by default.
*/
public String getManagerSaveFileName(String managerName) {
return super.getManagerSaveFileName(managerName);
}
/**
* Get the unqualified save file name for the given SystemFilterPoolReferenceManager object.
* Do NOT include the extension, as .xmi will be added.
* <p>
* Returns "filterPoolRefs_"+managerName by default.
*/
public String getReferenceManagerSaveFileName(String managerName) {
return super.getReferenceManagerSaveFileName(managerName);
}
/**
* Get the unqualified save file name for the given SystemFilterPool object.
* Do NOT include the extension, as .xmi will be added.
* <p>
* Returns getFilterPoolSaveFileNamePrefix()+poolName by default.
*/
public String getFilterPoolSaveFileName(String poolName) {
return super.getFilterPoolSaveFileName(poolName);
}
/**
* Get the file name prefix for all pool files.
* Used to deduce the saved pools by examining the file system
* <p>
* By default returns "filterPool_"
*/
public String getFilterPoolSaveFileNamePrefix() {
return super.getFilterPoolSaveFileNamePrefix();
}
/**
* Get the folder name for the given SystemFilterPool object.
* <p>
* Returns getFilterPoolFolderNamePrefix()+poolName by default.
*/
public String getFilterPoolFolderName(String poolName) {
return super.getFilterPoolFolderName(poolName);
}
/**
* Get the folder name prefix for all pool folders.
* Used to deduce the saved pools by examining the file system
* <p>
* By default returns "FilterPool_"
*/
public String getFilterPoolFolderNamePrefix() {
return super.getFilterPoolFolderNamePrefix();
}
/**
* Get the unqualified save file name for the given SystemFilter object.
* Do NOT include the extension, as .xmi will be added.
* <p>
* Returns getFilterSaveFileNamePrefix()+filterName by default.
*/
public String getFilterSaveFileName(String filterName) {
return super.getFilterSaveFileName(filterName);
}
/**
* Get the file name prefix for all filter files.
* Used to deduce the saved filters by examining the file system
* <p>
* Returns "Filter_" by default.
*/
public String getFilterSaveFileNamePrefix() {
return super.getFilterSaveFileNamePrefix();
}
}

View file

@ -20,17 +20,14 @@
package org.eclipse.rse.internal.core.filters;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Platform;
import org.eclipse.rse.core.filters.IRSEFilterNamingPolicy;
import org.eclipse.rse.core.filters.ISystemFilter;
import org.eclipse.rse.core.filters.ISystemFilterContainer;
import org.eclipse.rse.core.filters.ISystemFilterPool;
@ -81,7 +78,7 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte
* Private internal way to get filters. Makes it easy to change in future, if we don't use MOF.
*/
private List internalGetFilters() {
return getNestedFilters();
return nestedFilters;
}
/**
@ -114,7 +111,7 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte
* @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) {
public ISystemFilter createSystemFilter(String aliasName, String[] filterStrings) {
ISystemFilter newFilter = helpers.createSystemFilter(internalGetFilters(), getParentFilterPool(), aliasName, filterStrings);
newFilter.setSupportsNestedFilters(true); // presumably it does since it is nested itself.
newFilter.setSupportsDuplicateFilterStrings(supportsDuplicateFilterStrings());
@ -126,7 +123,6 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte
* Internal use method
*/
public void initializeFilterStrings() {
List filterStrings = getStrings();
Iterator i = filterStrings.iterator();
while (i.hasNext())
((ISystemFilterString) i.next()).setParentSystemFilter(this);
@ -241,15 +237,12 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte
* 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());
public String[] getSystemFilterNames() {
List filters = internalGetFilters();
List names = helpers.getSystemFilterNames(filters);
String[] result = new String[names.size()];
names.toArray(result);
return result;
}
/**
@ -385,26 +378,6 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte
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;
}
/**
* Get this filter's filter strings as a Vector of FilterString objects
*/
public Vector getFilterStringObjectsVector() {
Vector result = new Vector(filterStrings.size());
result.addAll(filterStrings);
return result;
}
/**
* Return how many filter strings are defined in this filter.
*/
@ -448,7 +421,7 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte
}
/**
* Get this filter's filter string objects as an array
* Get this filter's filter string objects as an array.
*/
public ISystemFilterString[] getSystemFilterStrings() {
ISystemFilterString[] result = new ISystemFilterString[filterStrings.size()];
@ -576,16 +549,17 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte
* This is all nested filters and all filter strings.
*/
public Object[] getChildren() {
Vector strings = getFilterStringsVector();
Vector filters = getSystemFiltersVector();
String[] strings = getFilterStrings();
ISystemFilter[] filters = getSystemFilters();
Vector vChildren = new Vector();
// start with nested filters...
for (int idx = 0; idx < filters.size(); idx++)
vChildren.addElement(filters.elementAt(idx));
for (int idx = 0; idx < filters.length; idx++) {
vChildren.addElement(filters[idx]);
}
// continue with resolved filter string objects...
for (int idx = 0; idx < strings.size(); idx++) {
String filterString = (String) strings.elementAt(idx);
for (int idx = 0; idx < strings.length; idx++) {
String filterString = strings[idx];
vChildren.addElement(filterString);
}
@ -630,71 +604,6 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte
return null;
}
// -----------------------
// 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().
* @deprecated no longer used
*/
public static ISystemFilter restore(IFolder folder, String name, ISystemFilterPool parentPool, IRSEFilterNamingPolicy namingPolicy) throws Exception {
/* code no longer needed since restore is done by importers, not by MOF/EMF
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 root save file name without the extension .xmi
* @deprecated no longer used
*/
protected static String getRootSaveFileName(ISystemFilter filter) {
return getRootSaveFileName(getNamingPolicy(filter), filter.getName());
}
/**
* Return the root save file name without the extension .xmi
* @deprecated no longer used
*/
protected static String getRootSaveFileName(IRSEFilterNamingPolicy namingPolicy, String name) {
return namingPolicy.getFilterSaveFileName(name);
}
/**
* Return naming policy
* @deprecated no longer used
*/
protected static IRSEFilterNamingPolicy getNamingPolicy(ISystemFilter filter) {
return filter.getParentFilterPool().getNamingPolicy();
}
/**
* Ensure given path ends with path separator.
* @deprecated no longer used
*/
public static String addPathTerminator(String path) {
if (!path.endsWith(File.separator)) path = path + File.separatorChar;
//else
// path = path;
return path;
}
/*-------------------
* Attribute getters and setters
*-------------------*/
@ -841,18 +750,22 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilter#getNestedFilters()
*/
public List getNestedFilters() {
public ISystemFilter[] getNestedFilters() {
if (nestedFilters == null) {
nestedFilters = new ArrayList();
}
return nestedFilters;
ISystemFilter[] result = new ISystemFilter[nestedFilters.size()];
nestedFilters.toArray(result);
return result;
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilter#getStrings()
*/
public List getStrings() {
return filterStrings;
public ISystemFilterString[] getStrings() {
ISystemFilterString[] result = new ISystemFilterString[filterStrings.size()];
filterStrings.toArray(result);
return result;
}
/* (non-Javadoc)
@ -1014,8 +927,7 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte
*/
public IRSEPersistableContainer[] getPersistableChildren() {
List children = new ArrayList(20);
List nf = getNestedFilters(); // guaranteed to not be null, none of these should be simple filters
children.addAll(nf);
children.addAll(nestedFilters);
children.addAll(filterStrings);
children.addAll(Arrays.asList(getPropertySets()));
IRSEPersistableContainer[] result = new IRSEPersistableContainer[children.size()];

View file

@ -65,7 +65,7 @@ public class SystemFilterContainerCommonMethods
* @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(java.util.List filters, ISystemFilterPool parentPool, String aliasName, Vector filterStrings) {
public ISystemFilter createSystemFilter(java.util.List filters, ISystemFilterPool parentPool, String aliasName, String[] filterStrings) {
ISystemFilter newFilter = null;
// FIXME - not using error message and null return
@ -95,7 +95,7 @@ public class SystemFilterContainerCommonMethods
* @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(Vector filters, ISystemFilterPool parentPool, String aliasName, Vector filterStrings) {
public ISystemFilter createSystemFilter(Vector filters, ISystemFilterPool parentPool, String aliasName, String[] filterStrings) {
ISystemFilter newFilter = null;
boolean exists = getSystemFilter(filters, aliasName) != null;
if (exists) {
@ -112,7 +112,7 @@ public class SystemFilterContainerCommonMethods
* Internal encapsulation of mof effort to create new filter, and setting of
* the core attributes.
*/
private ISystemFilter internalCreateSystemFilter(ISystemFilterPool parentPool, String aliasName, Vector filterStrings) {
private ISystemFilter internalCreateSystemFilter(ISystemFilterPool parentPool, String aliasName, String[] filterStrings) {
ISystemFilter newFilter = null;
try {
newFilter = new SystemFilter();
@ -415,7 +415,7 @@ public class SystemFilterContainerCommonMethods
*/
public ISystemFilter cloneSystemFilter(java.util.List filters, ISystemFilter filter, String aliasName) {
ISystemFilter copy = createSystemFilter(filters, filter.getParentFilterPool(), aliasName, filter.getFilterStringsVector());
ISystemFilter copy = createSystemFilter(filters, filter.getParentFilterPool(), aliasName, filter.getFilterStrings());
internalAfterCloneSystemFilter(filter, copy);
// now clone nested filters...
ISystemFilter[] nested = filter.getSystemFilters();
@ -433,7 +433,7 @@ public class SystemFilterContainerCommonMethods
*/
public ISystemFilter cloneSystemFilter(Vector filters, ISystemFilter filter, String aliasName) {
ISystemFilter copy = createSystemFilter(filters, filter.getParentFilterPool(), aliasName, filter.getFilterStringsVector());
ISystemFilter copy = createSystemFilter(filters, filter.getParentFilterPool(), aliasName, filter.getFilterStrings());
internalAfterCloneSystemFilter(filter, copy);
// now clone nested filters...
ISystemFilter[] nested = filter.getSystemFilters();

View file

@ -16,6 +16,9 @@
*******************************************************************************/
package org.eclipse.rse.internal.core.filters;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
@ -27,8 +30,6 @@ import org.eclipse.rse.core.filters.ISystemFilterReference;
import org.eclipse.rse.core.filters.SystemFilterReference;
import org.eclipse.rse.core.subsystems.ISubSystem;
/**
* Both SystemFilter and SystemFilterPool contain filters, so the
* common methods for filters are abstracted out in SystemFilterContainer,
@ -42,220 +43,158 @@ import org.eclipse.rse.core.subsystems.ISubSystem;
* SystemFilterReferenceImpl and SystemFilterPoolReferenceImpl use this via
* containment.
*/
public class SystemFilterContainerReferenceCommonMethods
{
private ISystemFilterContainerReference parentRef = null;
private ISystemFilterReference[] referencedFilters = null;
public class SystemFilterContainerReferenceCommonMethods {
private ISystemFilterContainerReference parentRef = null;
private List filterReferences = new ArrayList(10);
/**
* Constructor
* @param parentRef the object we are helping.
*/
public SystemFilterContainerReferenceCommonMethods(ISystemFilterContainerReference parentRef)
{
public SystemFilterContainerReferenceCommonMethods(ISystemFilterContainerReference parentRef) {
super();
this.parentRef = parentRef;
}
/**
* Return the name of the SystemFilter or SystemFilterPool that we reference.
*/
public String getName()
{
ISystemFilterContainer parent = parentRef.getReferencedSystemFilterContainer();
String name = null;
if (parent instanceof ISystemFilterPool)
name = ((ISystemFilterPool)parent).getName();
else
name = ((ISystemFilter)parent).getName();
return name;
/**
* Return true if the referenced pool or filter has filters.
*/
public boolean hasFilters() {
return getFilterCount() > 0;
}
/**
* Return count of the number of filters in the referenced pool or filter
*/
public int getFilterCount() {
List filters = getFiltersFromParent();
int count = filters.size();
return count;
}
/**
* Get the list of nested filters referenced by this ISystemFilterContainerReference.
*/
public List getSystemFilterReferences(ISubSystem subSystem) {
generateSystemFilterReferences(subSystem);
return filterReferences;
}
/**
* Refreshes the list of filter references.
* @param subSystem
*/
private void generateSystemFilterReferences(ISubSystem subSystem) {
List filters = getFiltersFromParent();
if (mustGenerate(filters)) {
generateFilterReferences(subSystem, filters);
}
}
/**
* Determine if the list of filter references is stale.
*/
private boolean mustGenerate(List filters) {
boolean result = true;
List referencedFilters = getReferencedFilters();
if (filters.size() == referencedFilters.size()) {
int n = filters.size();
int i = 0;
result = false;
while (i < n && result == false) {
ISystemFilter filter = (ISystemFilter) filters.get(i);
ISystemFilter referencedFilter = (ISystemFilter) referencedFilters.get(i);
if (filter != referencedFilter) {
result = true;
}
i++;
}
}
return result;
}
/**
* Return true if the referenced pool or filter has filters.
*/
public boolean hasFilters()
{
return getFilterCount() > 0;
}
/**
* @return the list of currently referenced filters
*/
private List getReferencedFilters() {
List result = new ArrayList(filterReferences.size());
for (Iterator z = filterReferences.iterator(); z.hasNext();) {
ISystemFilterReference reference = (ISystemFilterReference) z.next();
result.add(reference.getReferencedFilter());
}
return result;
}
/**
* Return count of the number of filters in the referenced pool or filter
*/
public int getFilterCount()
{
int count = 0;
ISystemFilterContainer parent = parentRef.getReferencedSystemFilterContainer();
java.util.List mofList = null;
if (parent instanceof ISystemFilterPool)
mofList = ((ISystemFilterPool)parent).getFilters();
else
mofList = ((ISystemFilter)parent).getNestedFilters();
if (mofList != null)
count = mofList.size();
return count;
}
/**
* Generate references to the filters in the list.
* Attempt to preserve existing references where they are available.
*/
private void generateFilterReferences(ISubSystem subSystem, List filters) {
List referencedFilters = getReferencedFilters();
List newReferences = new ArrayList(filters.size());
for (Iterator z = filters.iterator(); z.hasNext();) {
ISystemFilter filter = (ISystemFilter) z.next();
int i = referencedFilters.indexOf(filter);
ISystemFilterReference reference = (i >= 0) ? (ISystemFilterReference) filterReferences.get(i) : generateFilterReference(subSystem, filter);
newReferences.add(reference);
}
filterReferences = newReferences;
}
/**
* Get the list of nested filters referenced by this ISystemFilterContainerReference.
*/
public ISystemFilterReference[] getSystemFilterReferences(ISubSystem subSystem)
{
// These reference objects are built on the fly, each time, rather than
// maintaining a persisted list of such references. The reason
// is we do not at this time allow users to subset the master list
// of filters maintained by a filterpool. Hence, we always simply
// return a complete list. However, to save memory we try to only
// re-gen the list if something has changed.
ISystemFilterContainer parent = parentRef.getReferencedSystemFilterContainer();
List mofList = null;
if (parent instanceof ISystemFilterPool)
mofList = ((ISystemFilterPool)parent).getFilters();
else if (parent instanceof ISystemFilter) {
mofList = ((ISystemFilter)parent).getNestedFilters();
}
boolean needToReGen = compareFilters(mofList);
//System.out.println("In getSFRefs for " + getName() + ": regen? " + needToReGen);
if (needToReGen)
{
// first, need remove backward references...
// second, build new references...
referencedFilters = generateFilterReferences(subSystem, mofList);
}
if (referencedFilters == null) {
referencedFilters = new ISystemFilterReference[0];
}
return referencedFilters;
}
/**
* To save memory, we try to only regenerate the referenced filter list
* if something has changed.
*/
private boolean compareFilters(java.util.List newFilters)
{
boolean mustReGen = false;
if (newFilters == null)
{
if (referencedFilters != null)
return true;
else
return false;
}
else if (referencedFilters == null)
{
return true; // newFilters != null && referencedFilters == null
}
// both old and new are non-null
if (newFilters.size() != referencedFilters.length)
return true;
Iterator i = newFilters.iterator();
for (int idx=0; !mustReGen && (idx<referencedFilters.length); idx++)
{
ISystemFilter newFilter = (ISystemFilter)i.next();
if (referencedFilters[idx].getReferencedFilter() != newFilter)
mustReGen = true;
}
return mustReGen;
}
/**
* Create a single filter refererence
*/
private ISystemFilterReference generateFilterReference(ISubSystem subSystem, ISystemFilter filter) {
ISystemFilterReference result = SystemFilterReference.createSystemFilterReference(subSystem, parentRef, filter, SystemFilterReference.PERSISTENT_NO);
return result;
}
/**
* To save the memory of an intermediate array, we create the filter references
* directly from the MOF model...
*/
private ISystemFilterReference[] generateFilterReferences(ISubSystem subSystem, java.util.List newFilters)
{
if (newFilters == null)
return null;
ISystemFilterReference[] oldRefs = referencedFilters;
ISystemFilterReference[] refs = new ISystemFilterReference[newFilters.size()];
Iterator i = newFilters.iterator();
int idx = 0;
while (i.hasNext())
{
ISystemFilter filter = (ISystemFilter)i.next();
boolean foundOldOne = false;
// DKM - first check if we already have a reference for this
if (oldRefs != null)
{
for (int o = 0; o < oldRefs.length && !foundOldOne; o++)
{
ISystemFilterReference oRef = oldRefs[o];
if (oRef.getReferencedFilter() == filter)
{
refs[idx++] = oRef;
foundOldOne = true;
}
}
}
if (!foundOldOne)
{
refs[idx++] = generateFilterReference(subSystem, filter);
}
}
return refs;
}
/**
* Create a single filter refererence and append it to the end of the list.
* This will first check if there already is a reference to the given filter and if so
* will simply return it.
*/
public ISystemFilterReference generateAndRecordFilterReference(ISubSystem subSystem, ISystemFilter filter) {
generateSystemFilterReferences(subSystem);
ISystemFilterReference reference = getExistingSystemFilterReference(subSystem, filter);
if (reference == null) {
reference = generateFilterReference(subSystem, filter);
filterReferences.add(reference);
}
return reference;
}
/**
* Create a single filter refererence
*/
public ISystemFilterReference generateFilterReference( ISubSystem subSystem, ISystemFilter filter)
{
return SystemFilterReference.createSystemFilterReference(subSystem, parentRef, filter, SystemFilterReference.PERSISTENT_NO);
}
/**
* Create a single filter refererence and append it to the end of the list.
* This will first check if there already is a reference to the given filter and if so
* will simply return it.
*/
public ISystemFilterReference generateAndRecordFilterReference(ISubSystem subSystem, ISystemFilter filter)
{
getSystemFilterReferences(subSystem); // regenerate all references if needed
ISystemFilterReference sfr = getExistingSystemFilterReference(subSystem, filter);
if (sfr == null) // still no reference exist?
{
/* */
sfr = generateFilterReference(subSystem, filter);
int currLength = 0;
if (referencedFilters != null)
currLength = referencedFilters.length;
int newLength = currLength + 1;
ISystemFilterReference[] newRefs = new ISystemFilterReference[newLength];
for (int idx=0; idx<currLength; idx++)
{
newRefs[idx] = referencedFilters[idx];
}
newRefs[newLength-1] = sfr;
referencedFilters = newRefs;
}
return sfr;
}
/**
* Return an existing reference to a given system filter.
* If no reference currently exists to this filter, returns null.
*/
public ISystemFilterReference getExistingSystemFilterReference(ISubSystem subSystem, ISystemFilter filter)
{
ISystemFilterReference ref = null;
ISystemFilterReference[] refs = referencedFilters;
if ((refs != null) && (refs.length>0))
{
for (int idx=0; (ref==null) && (idx<refs.length); idx++)
{
ISystemFilterReference aref = refs[idx];
if (aref.getReferencedFilter() == filter && aref.getSubSystem() == subSystem)
ref = aref;
}
}
return ref;
}
}
/**
* Return an existing reference to a given system filter.
* If no reference currently exists to this filter, returns null.
*/
public ISystemFilterReference getExistingSystemFilterReference(ISubSystem subSystem, ISystemFilter filter) {
ISystemFilterReference result = null;
for (Iterator z = filterReferences.iterator(); z.hasNext() && result == null;) {
ISystemFilterReference reference = (ISystemFilterReference) z.next();
if (reference.getReferencedFilter() == filter && reference.getSubSystem() == subSystem) {
result = reference;
}
}
return result;
}
/**
* @return a list of ISystemFilter objects.
*/
private List getFiltersFromParent() {
ISystemFilterContainer parent = parentRef.getReferencedSystemFilterContainer();
ISystemFilter[] filters = null;
if (parent instanceof ISystemFilterPool) {
filters = ((ISystemFilterPool) parent).getFilters();
} else if (parent instanceof ISystemFilter) {
filters = ((ISystemFilter) parent).getNestedFilters();
} else {
filters = new ISystemFilter[0];
}
List result = Arrays.asList(filters);
return result;
}
}

View file

@ -21,19 +21,14 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Platform;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.SystemResourceHelpers;
import org.eclipse.rse.core.filters.IRSEFilterNamingPolicy;
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.ISystemFilterPoolManagerProvider;
import org.eclipse.rse.core.filters.SystemFilterNamingPolicy;
import org.eclipse.rse.core.model.IRSEPersistableContainer;
import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.internal.core.RSECoreMessages;
@ -60,27 +55,17 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
private String name;
/**
* The default value of the '{@link #getType() <em>Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected static final String TYPE_EDEFAULT = null;
private int savePolicy;
private IRSEFilterNamingPolicy namingPolicy = null;
private ISystemFilterPoolManager mgr;
private SystemFilterContainerCommonMethods helpers = null;
private Object filterPoolData = null;
@ -93,13 +78,10 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
* @generated This field/method will be replaced during code generation.
*/
protected String type = TYPE_EDEFAULT;
/**
* The default value of the '{@link #isSupportsNestedFilters() <em>Supports Nested Filters</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSupportsNestedFilters()
* @generated
* @ordered
*/
protected static final boolean SUPPORTS_NESTED_FILTERS_EDEFAULT = false;
@ -107,41 +89,33 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
* @generated This field/method will be replaced during code generation.
*/
protected boolean supportsNestedFilters = SUPPORTS_NESTED_FILTERS_EDEFAULT;
/**
* The default value of the '{@link #isDeletable() <em>Deletable</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isDeletable()
* @generated
* @ordered
*/
protected static final boolean DELETABLE_EDEFAULT = false;
/**
* @generated This field/method will be replaced during code generation.
*/
protected boolean deletable = DELETABLE_EDEFAULT;
/**
* The default value of the '{@link #isDefault() <em>Default</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isDefault()
* @generated
* @ordered
*/
protected static final boolean DEFAULT_EDEFAULT = false;
/**
* @generated This field/method will be replaced during code generation.
*/
protected boolean default_ = DEFAULT_EDEFAULT;
/**
* The default value of the '{@link #isStringsCaseSensitive() <em>Strings Case Sensitive</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isStringsCaseSensitive()
* @generated
* @ordered
*/
protected static final boolean STRINGS_CASE_SENSITIVE_EDEFAULT = false;
@ -149,22 +123,15 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
* @generated This field/method will be replaced during code generation.
*/
protected boolean stringsCaseSensitive = STRINGS_CASE_SENSITIVE_EDEFAULT;
/**
* This is true if the Strings Case Sensitive attribute has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean stringsCaseSensitiveESet = false;
/**
* The default value of the '{@link #isSupportsDuplicateFilterStrings() <em>Supports Duplicate Filter Strings</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSupportsDuplicateFilterStrings()
* @generated
* @ordered
*/
protected static final boolean SUPPORTS_DUPLICATE_FILTER_STRINGS_EDEFAULT = false;
@ -172,13 +139,10 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
* @generated This field/method will be replaced during code generation.
*/
protected boolean supportsDuplicateFilterStrings = SUPPORTS_DUPLICATE_FILTER_STRINGS_EDEFAULT;
/**
* The default value of the '{@link #getRelease() <em>Release</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRelease()
* @generated
* @ordered
*/
protected static final int RELEASE_EDEFAULT = 0;
@ -186,79 +150,52 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
* @generated This field/method will be replaced during code generation.
*/
protected int release = RELEASE_EDEFAULT;
/**
* The default value of the '{@link #isSingleFilterStringOnly() <em>Single Filter String Only</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSingleFilterStringOnly()
* @generated
* @ordered
*/
protected static final boolean SINGLE_FILTER_STRING_ONLY_EDEFAULT = false;
/**
* The cached value of the '{@link #isSingleFilterStringOnly() <em>Single Filter String Only</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSingleFilterStringOnly()
* @generated
* @ordered
*/
protected boolean singleFilterStringOnly = SINGLE_FILTER_STRING_ONLY_EDEFAULT;
/**
* This is true if the Single Filter String Only attribute has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean singleFilterStringOnlyESet = false;
/**
* The default value of the '{@link #getOwningParentName() <em>Owning Parent Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOwningParentName()
* @generated
* @ordered
*/
protected static final String OWNING_PARENT_NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getOwningParentName() <em>Owning Parent Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOwningParentName()
* @generated
* @ordered
*/
protected String owningParentName = OWNING_PARENT_NAME_EDEFAULT;
/**
* The default value of the '{@link #isNonRenamable() <em>Non Renamable</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isNonRenamable()
* @generated
* @ordered
*/
protected static final boolean NON_RENAMABLE_EDEFAULT = false;
/**
* The cached value of the '{@link #isNonRenamable() <em>Non Renamable</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isNonRenamable()
* @generated
* @ordered
*/
protected boolean nonRenamable = NON_RENAMABLE_EDEFAULT;
/**
* @generated This field/method will be replaced during code generation.
*/
protected java.util.List filters = null;
protected List filters = new ArrayList(10);
/**
* Default constructor
@ -269,7 +206,7 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
helpers = new SystemFilterContainerCommonMethods();
setRelease(RSECorePlugin.CURRENT_RELEASE);
if (!initialized) {
initialize(poolName, savePolicy, namingPolicy);
initialize(poolName);
}
setDeletable(isDeletable); // mof attribute
setSupportsNestedFilters(allowNestedFilters); // cascades to each filter
@ -278,22 +215,16 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
/*
* Private helper method to core initialization, from either createXXX or restore.
*/
protected void initialize(String name,
int savePolicy, IRSEFilterNamingPolicy namingPolicy)
protected void initialize(String name)
{
setName(name); // mof attribute
setSavePolicy(savePolicy);
setNamingPolicy(namingPolicy);
initialized = true;
}
//protected Vector internalGetFilters()
protected java.util.List internalGetFilters()
protected List internalGetFilters()
{
//return filters;
return getFilters(); // mof-supplied in parent class
return filters;
}
/**
@ -308,47 +239,6 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
return null;
}
/**
* Set the save file policy. See constants in {@link org.eclipse.rse.internal.core.filters.ISystemFilterConstants SystemFilterConstants}.
* One of:
* <ul>
* <li>SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL - one file and folder per pool
* <li>SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER - one file per pool, all files in one folder
* <li>SAVE_POLICY_ONE_FILE_PER_FILTER - one file per filter, one folder per pool
* </ul>
* This method is called by the SystemFilterPoolManager.
*/
public void setSavePolicy(int policy)
{
if (this.savePolicy != policy)
{
this.savePolicy = policy;
setDirty(true);
}
}
/**
* Set the naming policy used when saving data to disk.
* @see org.eclipse.rse.core.filters.IRSEFilterNamingPolicy
*/
public void setNamingPolicy(IRSEFilterNamingPolicy namingPolicy)
{
if (this.namingPolicy != namingPolicy)
{
this.namingPolicy = namingPolicy;
setDirty(true);
}
}
/**
* Get the naming policy currently used when saving data to disk.
* @see org.eclipse.rse.core.filters.IRSEFilterNamingPolicy
*/
public IRSEFilterNamingPolicy getNamingPolicy()
{
return namingPolicy;
}
/**
* Set whether filters in this pool support nested filters.
* Important to note this is stored in every filter as well as this filter pool.
@ -361,12 +251,11 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
for (int idx=0; idx<filters.length; idx++)
filters[idx].setSupportsNestedFilters(supports);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @param newSupportsNestedFilters
*/
public void setSupportsNestedFiltersGen(boolean newSupportsNestedFilters)
private void setSupportsNestedFiltersGen(boolean newSupportsNestedFilters)
{
supportsNestedFilters = newSupportsNestedFilters;
}
@ -383,12 +272,11 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
for (int idx=0; idx<filters.length; idx++)
filters[idx].setSupportsDuplicateFilterStrings(supports);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @param newSupportsDuplicateFilterStrings
*/
public void setSupportsDuplicateFilterStringsGen(boolean newSupportsDuplicateFilterStrings)
private void setSupportsDuplicateFilterStringsGen(boolean newSupportsDuplicateFilterStrings)
{
supportsDuplicateFilterStrings = newSupportsDuplicateFilterStrings;
setDirty(true);
@ -407,12 +295,8 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
filters[idx].setStringsCaseSensitive(supports);
setDirty(true);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setStringsCaseSensitiveGen(boolean newStringsCaseSensitive)
private void setStringsCaseSensitiveGen(boolean newStringsCaseSensitive)
{
stringsCaseSensitive = newStringsCaseSensitive;
stringsCaseSensitiveESet = true;
@ -502,20 +386,16 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilterPool#isDeletable()
*/
public boolean isDeletable()
{
return deletable;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilterPool#setDeletable(boolean)
*/
public void setDeletable(boolean newDeletable)
{
@ -523,20 +403,16 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
setDirty(true);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilterPool#isDefault()
*/
public boolean isDefault()
{
return default_;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilterPool#setDefault(boolean)
*/
public void setDefault(boolean newDefault)
{
@ -673,7 +549,7 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
* @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)
public ISystemFilter createSystemFilter(String aliasName, String[] filterStrings)
{
ISystemFilter newFilter = helpers.createSystemFilter(internalGetFilters(), this, aliasName, filterStrings);
newFilter.setSupportsNestedFilters(supportsNestedFilters());
@ -687,18 +563,15 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
* 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()
public String[] getSystemFilterNames()
{
return helpers.getSystemFilterNames(internalGetFilters());
List filters = internalGetFilters();
List names = helpers.getSystemFilterNames(filters);
String[] result = new String[names.size()];
names.toArray(result);
return result;
}
/**
* Return the nested filters as a Vector
*/
public Vector getSystemFiltersVector()
{
return helpers.getSystemFiltersVector(internalGetFilters());
}
/**
* Return how many filters are defined in this filter container
*/
@ -804,23 +677,6 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
return Platform.getAdapterManager().getAdapter(this, adapterType);
}
/**
* Private helper method to deduce filter names from disk files.
* Will populate and return a list.
* Only makes sense to use if the save policy is one file per filter.
*/
protected static Vector deduceFilterNames(IFolder folder, IRSEFilterNamingPolicy namingPolicy)
{
Vector filterNames = SystemResourceHelpers.getResourceHelpers().convertToVectorAndStrip(
SystemResourceHelpers.getResourceHelpers().listFiles(folder,
namingPolicy.getFilterSaveFileNamePrefix(),
ISystemFilterConstants.SAVEFILE_SUFFIX),
namingPolicy.getFilterSaveFileNamePrefix(), ISystemFilterConstants.SAVEFILE_SUFFIX);
return filterNames;
}
/**
* Order filters according to user preferences.
* <p>
@ -832,14 +688,13 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
*/
public void orderSystemFilters(String[] names)
{
java.util.List filterList = internalGetFilters();
ISystemFilter[] filters = new ISystemFilter[names.length];
for (int idx=0; idx<filters.length; idx++)
filters[idx] = getSystemFilter(names[idx]); // convert name to filter
filterList.clear();
for (int idx=0; idx<filters.length; idx++)
ISystemFilter[] filterArray = new ISystemFilter[names.length];
for (int idx=0; idx<filterArray.length; idx++)
filterArray[idx] = getSystemFilter(names[idx]); // convert name to filter
filters.clear();
for (int idx=0; idx<filterArray.length; idx++)
{
filterList.add(filters[idx]);
filters.add(filterArray[idx]);
}
helpers.invalidateCache();
}
@ -849,90 +704,11 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
// SAVE/RESTORE METHODS...
// -----------------------
/**
* Restore specific filter pool. You should not call this directly, as it is possible
* that certain data is not restored if the save policy is one file per filter. Rather,
* you should call the createSystemFilterPoolMethod.
* @param name name of pool to restore. Used to deduce file name for save policy of one file per pool.
* @param savePolicy policy used to save the pool. One of the following from SystemFilterPoolManager:
* <ul>
* <li>SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL - one file and folder per pool
* <li>SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER - one file per pool, all files in one folder
* <li>SAVE_POLICY_ONE_FILE_PER_FILTER - one file per filter, one folder per pool
* </ul>
* @param namingPolicy The names to use for file and folders when persisting to disk. Pass
* null to just use the defaults.
* @return SystemFilterPool object if restored ok, null if error encountered. If null, call getLastException().
* @see org.eclipse.rse.internal.core.filters.ISystemFilterConstants
*/
protected static ISystemFilterPool restore(String name, int savePolicy,
IRSEFilterNamingPolicy namingPolicy)
throws Exception
{
if (namingPolicy == null)
namingPolicy = SystemFilterNamingPolicy.getNamingPolicy();
// FIXME SystemFilterImpl.initMOF(); // to be safe
ISystemFilterPool pool = null;
/* FIXME
SystemFilterPool poolImpl = null;
switch(savePolicy)
{
case SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL:
pool = restoreFromOneFile(mofHelpers, folder, name, namingPolicy, true);
poolImpl = (SystemFilterPoolImpl)pool;
break;
case SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER:
pool = restoreFromOneFile(mofHelpers, folder, name, namingPolicy, true);
poolImpl = (SystemFilterPoolImpl)pool;
break;
case SAVE_POLICY_ONE_FILE_PER_FILTER:
pool = restoreFromOneFile(mofHelpers, folder, name, namingPolicy, false); // restore data part
poolImpl = (SystemFilterPoolImpl)pool;
//pool = createPool();
poolImpl.setFolder(folder); // SystemFilter's restore will query it
pool.setNamingPolicy(namingPolicy); // SystemFilter's restore will query it
Vector filterNames = deduceFilterNames(folder, namingPolicy);
if (filterNames != null)
{
Exception lastException = null;
for (int idx=0; idx<filterNames.size(); idx++)
{
try {
SystemFilter filter =
SystemFilterImpl.restore(mofHelpers, folder, (String)filterNames.elementAt(idx), pool, namingPolicy);
poolImpl.addSystemFilter(filter);
} catch (Exception exc) {lastException = exc;}
}
if (lastException != null)
{
// todo, something! We want to signal the error, but not prevent pool from being restored.
// Only option: log it somewhere.
}
else
poolImpl.sortFilters();
}
break;
}
if (poolImpl != null)
{
poolImpl.initialize(name,savePolicy,namingPolicy);
}
*/
return pool;
}
/**
* Internal use method
*/
protected void initializeFilterStrings()
{
java.util.List filters = getFilters();
Iterator i = filters.iterator();
while (i.hasNext())
((SystemFilter)i.next()).initializeFilterStrings();
@ -946,20 +722,19 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
*/
protected void sortFilters()
{
java.util.List filterList = getFilters(); // get java.util.List
if (filterList.size() <= 1) // not enough to sort?
if (filters.size() <= 1) // not enough to sort?
return; // outa here!
if (debug)
printFilterList("Before sorting"); //$NON-NLS-1$
helpers.invalidateCache(); // force re-gen of array from java.util.List on next getSystemFilters() request
ISystemFilter[] filters = getSystemFilters(); // convert java.util.List to array
boolean[] processed = new boolean[filters.length];
ISystemFilter[] filterArray = getSystemFilters(); // convert java.util.List to array
boolean[] processed = new boolean[filterArray.length];
//for (int idx=0;idx<processed.length;idx++)
//processed[idx] = false;
filterList.clear(); // clear java.util.List
filters.clear(); // clear java.util.List
//boolean done = false;
int processedCount = 0;
int totalCount = filters.length;
int totalCount = filterArray.length;
int nextHighest = -1;
int firstMatchIdx = -1;
int round = 0;
@ -977,7 +752,7 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
{
if (!processed[idx])
{
int currOrder = filters[idx].getRelativeOrder();
int currOrder = filterArray[idx].getRelativeOrder();
if (currOrder < nextHighest)
{
nextHighest = currOrder;
@ -995,7 +770,7 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
//System.out.println("Round " + round + ": nextHighest = " + nextHighest + ", firstMatchIdx = " + firstMatchIdx);
if (firstMatchIdx != -1)
{
filterList.add(filters[firstMatchIdx]);
filters.add(filterArray[firstMatchIdx]);
processed[firstMatchIdx] = true;
++processedCount;
}
@ -1018,31 +793,6 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
System.out.println();
}
/**
* Return the root save file name without the extension .xmi
*/
protected static String getRootSaveFileName(ISystemFilterPool pool)
{
return getRootSaveFileName(pool.getNamingPolicy(), pool.getName());
}
/**
* Return the root save file name without the extension .xmi
*/
protected static String getRootSaveFileName(ISystemFilterPool pool, String newName)
{
return getRootSaveFileName(pool.getNamingPolicy(), newName);
}
/**
* Return the root save file name without the extension .xmi
*/
protected static String getRootSaveFileName(IRSEFilterNamingPolicy namingPolicy, String poolName)
{
return namingPolicy.getFilterPoolSaveFileName(poolName);
}
/**
* Return the unique reference name of this object.
* <p>
@ -1097,17 +847,14 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
return stringsCaseSensitiveESet;
}
/**
* @generated This field/method will be replaced during code generation
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilterPool#getFilters()
*/
public java.util.List getFilters()
public ISystemFilter[] getFilters()
{
if (filters == null)
{
filters = new ArrayList();
//FIXME new EObjectContainmenteList(SystemFilter.class, this, FiltersPackage.SYSTEM_FILTER_POOL__FILTERS);
}
return filters;
ISystemFilter[] result = new ISystemFilter[filters.size()];
filters.toArray(result);
return result;
}
/**
@ -1148,20 +895,9 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
else
return getSystemFilterPoolManager().isSingleFilterStringOnly();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSingleFilterStringOnlyGen()
{
return singleFilterStringOnly;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilterPool#setSingleFilterStringOnly(boolean)
*/
public void setSingleFilterStringOnly(boolean newSingleFilterStringOnly)
{
@ -1170,10 +906,8 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
setDirty(true);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilterPool#unsetSingleFilterStringOnly()
*/
public void unsetSingleFilterStringOnly()
{
@ -1182,30 +916,24 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
setDirty(true);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilterPool#isSetSingleFilterStringOnly()
*/
public boolean isSetSingleFilterStringOnly()
{
return singleFilterStringOnlyESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilterPool#getOwningParentName()
*/
public String getOwningParentName()
{
return owningParentName;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilterPool#setOwningParentName(java.lang.String)
*/
public void setOwningParentName(String newOwningParentName)
{
@ -1216,20 +944,16 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilterPool#isNonRenamable()
*/
public boolean isNonRenamable()
{
return nonRenamable;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilterPool#setNonRenamable(boolean)
*/
public void setNonRenamable(boolean newNonRenamable)
{

View file

@ -19,14 +19,10 @@
package org.eclipse.rse.internal.core.filters;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.filters.IRSEFilterNamingPolicy;
import org.eclipse.rse.core.filters.ISystemFilter;
import org.eclipse.rse.core.filters.ISystemFilterContainer;
import org.eclipse.rse.core.filters.ISystemFilterPool;
@ -59,10 +55,8 @@ import org.eclipse.rse.logging.Logger;
* This class is not intended to be subclassed by clients.
*/
public class SystemFilterPoolManager extends RSEPersistableObject implements ISystemFilterPoolManager {
// private ISystemFilterPool[] poolArray = null; // cache for performance
private ISystemFilterPoolManagerProvider caller = null;
private Object poolMgrData;
// private Vector poolNames;
private boolean initialized = false;
private boolean suspendCallbacks = false;
@ -74,22 +68,14 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
protected String name = NAME_EDEFAULT;
/**
* The default value of the '{@link #isSupportsNestedFilters() <em>Supports Nested Filters</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSupportsNestedFilters()
* @generated
* @ordered
*/
protected static final boolean SUPPORTS_NESTED_FILTERS_EDEFAULT = false;
@ -99,11 +85,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
protected boolean supportsNestedFilters = SUPPORTS_NESTED_FILTERS_EDEFAULT;
/**
* The default value of the '{@link #isStringsCaseSensitive() <em>Strings Case Sensitive</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isStringsCaseSensitive()
* @generated
* @ordered
*/
protected static final boolean STRINGS_CASE_SENSITIVE_EDEFAULT = false;
@ -113,11 +95,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
protected boolean stringsCaseSensitive = STRINGS_CASE_SENSITIVE_EDEFAULT;
/**
* The default value of the '{@link #isSupportsDuplicateFilterStrings() <em>Supports Duplicate Filter Strings</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSupportsDuplicateFilterStrings()
* @generated
* @ordered
*/
protected static final boolean SUPPORTS_DUPLICATE_FILTER_STRINGS_EDEFAULT = false;
@ -127,30 +105,18 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
protected boolean supportsDuplicateFilterStrings = SUPPORTS_DUPLICATE_FILTER_STRINGS_EDEFAULT;
/**
* This is true if the Supports Duplicate Filter Strings attribute has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean supportsDuplicateFilterStringsESet = false;
/**
* The default value of the '{@link #isSingleFilterStringOnly() <em>Single Filter String Only</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSingleFilterStringOnly()
* @generated
* @ordered
*/
protected static final boolean SINGLE_FILTER_STRING_ONLY_EDEFAULT = false;
/**
* The cached value of the '{@link #isSingleFilterStringOnly() <em>Single Filter String Only</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSingleFilterStringOnly()
* @generated
* @ordered
*/
protected boolean singleFilterStringOnly = SINGLE_FILTER_STRING_ONLY_EDEFAULT;
@ -184,22 +150,9 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
* @param allowNestedFilters true if filters inside filter pools in this manager are
* to allow nested filters. This is the default, but can be overridden at the
* individual filter pool level.
* @param savePolicy The save policy for the filter pools and filters. One of the
* following constants from the
* {@link ISystemFilterConstants} interface:
* <ul>
* <li>SAVE_POLICY_NONE - no files, all save/restore handled elsewhere
* <li>SAVE_POLICY_ONE_FILE_PER_MANAGER - one file: mgrName.xmi
* <li>SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL - one file and folder per pool
* <li>SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER - one file per pool, all files in one folder
* <li>SAVE_POLICY_ONE_FILE_PER_FILTER - one file per filter, one folder per pool
* </ul>
* @param namingPolicy The names to use for file and folders when persisting to disk. Pass
* null to just use the defaults, or if using SAVE_POLICY_NONE.
*/
public static ISystemFilterPoolManager createSystemFilterPoolManager(ISystemProfile profile, Logger logger,
ISystemFilterPoolManagerProvider caller, String name, boolean allowNestedFilters,
int savePolicy, IRSEFilterNamingPolicy namingPolicy) {
ISystemFilterPoolManagerProvider caller, String name, boolean allowNestedFilters) {
SystemFilterPoolManager mgr = new SystemFilterPoolManager(profile);
mgr.initialize(logger, caller, name, allowNestedFilters);
return mgr;
@ -213,25 +166,6 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
initialize(logger, caller, name); // core data
}
setSupportsNestedFilters(allowNestedFilters); // cascade it down
// invalidatePoolCache();
// List pools = getPools();
// ISystemFilterPool pool = null;
// Vector poolNames = getSystemFilterPoolNamesVector();
// for (int idx = 0; idx < poolNames.size(); idx++) {
// String poolName = (String) poolNames.elementAt(idx);
//// pool = RSECorePlugin.getThePersistenceManager().restoreFilterPool(poolName);
// pool = null; // that's what the above returned
// pool.setSystemFilterPoolManager(this);
// pools.add(pool);
//
// /** FIXME test
// if (pool.specialCaseNoDataRestored)
// {
// pool.setDeletable(true); // what else to do?
// //pool.setSupportsNestedFilters(allowNestedFilters); will be cascaded down anyway
// }
// */
// }
}
/*
@ -320,19 +254,14 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSupportsDuplicateFilterStringsGen(boolean newSupportsDuplicateFilterStrings) {
private void setSupportsDuplicateFilterStringsGen(boolean newSupportsDuplicateFilterStrings) {
supportsDuplicateFilterStrings = newSupportsDuplicateFilterStrings;
supportsDuplicateFilterStringsESet = true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilterPoolManager#isStringsCaseSensitive()
*/
public boolean isStringsCaseSensitive() {
return stringsCaseSensitive;
@ -363,11 +292,8 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setStringsCaseSensitiveGen(boolean newStringsCaseSensitive) {
private void setStringsCaseSensitiveGen(boolean newStringsCaseSensitive) {
stringsCaseSensitive = newStringsCaseSensitive;
}
@ -420,33 +346,13 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
* Get list of filter pool names currently existing.
*/
public String[] getSystemFilterPoolNames() {
Vector v = getSystemFilterPoolNamesVector();
String[] names = new String[v.size()];
for (int idx = 0; idx < names.length; idx++)
names[idx] = (String) v.elementAt(idx);
return names;
}
/**
* Get list of filter pool names currently existing.
*/
public Vector getSystemFilterPoolNamesVector() {
Vector result = new Vector(pools.size());
for (Iterator z = pools.iterator(); z.hasNext();) {
ISystemFilterPool pool = (ISystemFilterPool) z.next();
String poolName = pool.getName();
result.add(poolName);
ISystemFilterPool[] pools = getSystemFilterPools();
String[] names = new String[pools.length];
for (int i = 0; i < pools.length; i++) {
ISystemFilterPool pool = pools[i];
names[i] = pool.getName();
}
return result;
// List pools = getPools();
// if ((poolNames == null) || (poolNames.size() != pools.size())) // been invalidated?
// {
// poolNames = new Vector();
// Iterator i = pools.iterator();
// while (i.hasNext())
// poolNames.addElement(((ISystemFilterPool) i.next()).getName());
// }
// return poolNames;
return names;
}
/*
@ -724,7 +630,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
* @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(ISystemFilterContainer parent, String aliasName, Vector filterStrings) throws Exception {
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, String[] filterStrings) throws Exception {
ISystemFilter newFilter = null;
ISystemFilterPool parentPool = null;
if (parent instanceof ISystemFilterPool)
@ -740,7 +646,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
/**
* Creates a new system filter that is typed.
* Same as {@link #createSystemFilter(ISystemFilterContainer, String, Vector)} but
* Same as {@link #createSystemFilter(ISystemFilterContainer, String, String[])} but
* takes a filter type as an additional parameter.
* <p>
* A filter's type is an arbitrary string that is not interpreted or used by the base framework. This
@ -752,7 +658,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
* @param filterStrings The list of String objects that represent the filter strings.
* @param type The type of this filter
*/
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, Vector filterStrings, String type) throws Exception {
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, String[] filterStrings, String type) throws Exception {
boolean oldSuspendSave = suspendSave;
boolean oldSuspendCallbacks = suspendCallbacks;
suspendSave = true;
@ -779,7 +685,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
/**
* Creates a new system filter that is typed and promptable
* Same as {@link #createSystemFilter(ISystemFilterContainer, String ,Vector, String)} but
* Same as {@link #createSystemFilter(ISystemFilterContainer, String ,String[], String)} but
* takes a boolean indicating if it is promptable.
* <p>
* A promptable filter is one in which the user is prompted for information at expand time.
@ -792,7 +698,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
* @param type The type of this filter
* @param promptable Pass true if this is a promptable filter
*/
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, Vector filterStrings, String type, boolean promptable) throws Exception {
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, String[] filterStrings, String type, boolean promptable) throws Exception {
boolean oldSuspendSave = suspendSave;
boolean oldSuspendCallbacks = suspendCallbacks;
suspendSave = true;
@ -1251,29 +1157,6 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
return null;
}
/**
* Restore filter pools when all are stored in one file
* @param logger The logging object to log errors to
* @param mgrFolder The folder containing the file to restore from.
* @param name The name of the manager, from which the file name is derived.
* @param namingPolicy Naming prefix information for persisted data file names.
*/
protected static ISystemFilterPoolManager restoreFromOneFile(Logger logger, IFolder mgrFolder, String name, IRSEFilterNamingPolicy namingPolicy) throws Exception {
/* FIXME
String fileName = getRootSaveFileName(namingPolicy, name);
List ext = getMOFHelpers(logger).restore(mgrFolder,fileName);
SystemFilterPoolManager mgr = null;
// should be exactly one system filter pool manager...
Iterator iList = ext.iterator();
mgr = (SystemFilterPoolManager)iList.next();
return mgr;
*/
return null;
}
/**
* Return our logger
*/
@ -1381,18 +1264,6 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
return supportsNestedFilters;
}
/**
* @generated This field/method will be replaced during code generation
*/
public List getPools() {
// if (pools == null) {
// pools = new ArrayList();
// }
List result = new ArrayList(pools.size());
result.addAll(pools);
return result;
}
/**
* @generated This field/method will be replaced during code generation.
*/
@ -1422,19 +1293,15 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
return supportsDuplicateFilterStringsESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilterPoolManager#isSingleFilterStringOnly()
*/
public boolean isSingleFilterStringOnly() {
return singleFilterStringOnly;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilterPoolManager#setSingleFilterStringOnly(boolean)
*/
public void setSingleFilterStringOnly(boolean newSingleFilterStringOnly) {
boolean oldSingleFilterStringOnly = singleFilterStringOnly;

View file

@ -21,6 +21,8 @@
package org.eclipse.rse.internal.core.filters;
import java.util.List;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Platform;
import org.eclipse.rse.core.RSECorePlugin;
@ -218,7 +220,10 @@ public class SystemFilterPoolReference extends SystemPersistableReferencingObjec
* @see org.eclipse.rse.core.filters.ISystemFilterContainerReference#getSystemFilterReferences(org.eclipse.rse.core.subsystems.ISubSystem)
*/
public ISystemFilterReference[] getSystemFilterReferences(ISubSystem subSystem) {
return containerHelper.getSystemFilterReferences(subSystem);
List references = containerHelper.getSystemFilterReferences(subSystem);
ISystemFilterReference[] result = new ISystemFilterReference[references.size()];
references.toArray(result);
return result;
}
/* (non-Javadoc)

View file

@ -21,10 +21,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.rse.core.SystemResourceHelpers;
import org.eclipse.rse.core.filters.IRSEFilterNamingPolicy;
import org.eclipse.rse.core.filters.ISystemFilter;
import org.eclipse.rse.core.filters.ISystemFilterPool;
import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
@ -33,8 +29,6 @@ import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
import org.eclipse.rse.core.filters.ISystemFilterReference;
import org.eclipse.rse.core.filters.ISystemFilterSavePolicies;
import org.eclipse.rse.core.filters.SystemFilterNamingPolicy;
import org.eclipse.rse.core.references.IRSEBasePersistableReferencingObject;
import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.internal.references.SystemPersistableReferenceManager;
@ -48,20 +42,12 @@ import org.eclipse.rse.internal.references.SystemPersistableReferenceManager;
* There will be one of these instantiated for a subsystem. Filter pool references can
* be moved within a subsystem and this manager provides that function as well.
*/
/**
* @lastgen class SystemFilterPoolReferenceManagerImpl extends SystemPersistableReferenceManagerImpl implements SystemFilterPoolReferenceManager, SystemPersistableReferenceManager {}
*/
public class SystemFilterPoolReferenceManager extends SystemPersistableReferenceManager implements ISystemFilterPoolReferenceManager {
//private SystemFilterPoolManager[] poolMgrs = null;
private ISystemFilterPoolManagerProvider poolMgrProvider = null;
private ISystemFilterPoolManager defaultPoolMgr = null;
private ISystemFilterPoolReferenceManagerProvider caller = null;
private IRSEFilterNamingPolicy namingPolicy = null;
private int savePolicy = ISystemFilterSavePolicies.SAVE_POLICY_NONE;
private Object mgrData = null;
private IFolder mgrFolder = null;
private boolean initialized = false;
private boolean noSave;
private boolean noEvents;
private boolean fireEvents = true;
private ISystemFilterPoolReference[] fpRefsArray = null;
@ -82,40 +68,18 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
* object via the getProvider method call.
* @param relatedPoolManagerProvider The managers that owns the master list of filter pools that
* this manager will contain references to.
* @param mgrFolder the folder that will hold the persisted file. This is used when
* the save policy is SAVE_POLICY_ONE_FILE_PER_MANAGER. For SAVE_POLICY_NONE, this
* is not used. If it is used, it is created if it does not already exist.
* @param name the name of the filter pool reference manager. This is used when
* the save policy is SAVE_POLICY_ONE_FILE_PER_MANAGER, to deduce the file name.
* @param savePolicy The save policy for the filter pool references list. One of the
* following from the {@link org.eclipse.rse.internal.core.filters.ISystemFilterConstants SystemFilterConstants}
* interface:
* <ul>
* <li>SAVE_POLICY_NONE - no files, all save/restore handled elsewhere
* <li>SAVE_POLICY_ONE_FILE_PER_MANAGER - one file: mgrName.xmi
* </ul>
* @param namingPolicy The names to use for file and folders when persisting to disk. Pass
* null to just use the defaults, or if using SAVE_POLICY_NONE.
* @param name the name of the filter pool reference manager.
* @return a filter pool reference manager
*/
public static ISystemFilterPoolReferenceManager createSystemFilterPoolReferenceManager(ISystemFilterPoolReferenceManagerProvider caller,
ISystemFilterPoolManagerProvider relatedPoolManagerProvider, IFolder mgrFolder, String name, int savePolicy, IRSEFilterNamingPolicy namingPolicy) {
public static ISystemFilterPoolReferenceManager createSystemFilterPoolReferenceManager(ISystemFilterPoolReferenceManagerProvider caller, ISystemFilterPoolManagerProvider relatedPoolManagerProvider, String name) {
SystemFilterPoolReferenceManager mgr = null;
if (mgrFolder != null) SystemResourceHelpers.getResourceHelpers().ensureFolderExists(mgrFolder);
if (namingPolicy == null) namingPolicy = SystemFilterNamingPolicy.getNamingPolicy();
try {
if (savePolicy != ISystemFilterSavePolicies.SAVE_POLICY_NONE) mgr = (SystemFilterPoolReferenceManager) restore(caller, mgrFolder, name, namingPolicy);
} catch (Exception exc) // real error trying to restore, versus simply not found.
{
// todo: something. Log the exception somewhere?
}
if (mgr == null) // not found or some serious error.
{
mgr = createManager();
}
if (mgr != null) {
mgr.initialize(caller, mgrFolder, name, savePolicy, namingPolicy, relatedPoolManagerProvider);
mgr.initialize(caller, name, relatedPoolManagerProvider);
}
return mgr;
@ -132,9 +96,8 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
/*
* Private helper method to initialize state
*/
protected void initialize(ISystemFilterPoolReferenceManagerProvider caller, IFolder folder, String name, int savePolicy, IRSEFilterNamingPolicy namingPolicy,
ISystemFilterPoolManagerProvider relatedPoolManagerProvider) {
if (!initialized) initialize(caller, folder, name, savePolicy, namingPolicy); // core data
protected void initialize(ISystemFilterPoolReferenceManagerProvider caller, String name, ISystemFilterPoolManagerProvider relatedPoolManagerProvider) {
if (!initialized) initialize(caller, name); // core data
//setSystemFilterPoolManagers(relatedPoolManagers);
setSystemFilterPoolManagerProvider(relatedPoolManagerProvider);
}
@ -143,12 +106,9 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
* Private helper method to do core initialization.
* Might be called from either the static factory method or the static restore method.
*/
protected void initialize(ISystemFilterPoolReferenceManagerProvider caller, IFolder folder, String name, int savePolicy, IRSEFilterNamingPolicy namingPolicy) {
this.mgrFolder = folder;
protected void initialize(ISystemFilterPoolReferenceManagerProvider caller, String name) {
setProvider(caller);
setName(name);
this.savePolicy = savePolicy;
setNamingPolicy(namingPolicy);
initialized = true;
}
@ -278,24 +238,6 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
this.fireEvents = fireEvents;
}
/**
* Set the naming policy used when saving data to disk.
* @see org.eclipse.rse.core.filters.IRSEFilterNamingPolicy
* @param namingPolicy the naming policy - no longer used.
*/
public void setNamingPolicy(IRSEFilterNamingPolicy namingPolicy) {
this.namingPolicy = namingPolicy;
}
/**
* Get the naming policy currently used when saving data to disk.
* @see org.eclipse.rse.core.filters.IRSEFilterNamingPolicy
* @return the naming policy - no longer used.
*/
public IRSEFilterNamingPolicy getNamingPolicy() {
return namingPolicy;
}
/**
* This is to set transient data that is subsequently queryable.
* @param data the data associated with this pool reference manager.
@ -311,26 +253,6 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
return mgrData;
}
/**
* Set the name. This is an override of mof-generated method
* in order to potentially rename the disk file for a save
* policy of SAVE_POLICY_ONE_FILE_PER_MANAGER.
* No longer used.
* @param name the name of this reference manager.
*/
public void setName(String name) {
if (savePolicy == ISystemFilterSavePolicies.SAVE_POLICY_ONE_FILE_PER_MANAGER) {
IFile file = getResourceHelpers().getFile(getFolder(), getSaveFileName());
super.setName(name);
String newFileName = getSaveFileName();
try {
getResourceHelpers().renameFile(file, newFileName);
} catch (Exception exc) {
}
} else
super.setName(name);
}
// ---------------------------------------------------
// Methods that work on FilterPool referencing objects
// ---------------------------------------------------
@ -345,7 +267,6 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
if (pool != null) fpRefs[idx].resetReferencedFilterPoolName(pool.getReferenceName());
}
invalidateFilterPoolReferencesCache(); // just in case!
quietSave();
}
/**
@ -374,7 +295,6 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
invalidateFilterPoolReferencesCache();
// callback to provider so they can fire events in their GUI
if (fireEvents && (caller != null)) caller.filterEventFilterPoolReferencesReset();
quietSave();
}
/**
@ -410,7 +330,6 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
int count = addReferencingObject(filterPoolReference);
filterPoolReference.setParentReferenceManager(this); // DWD - should be done in addReferencingObject?
invalidateFilterPoolReferencesCache();
quietSave();
return count;
}
@ -423,7 +342,6 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
filterPoolReference.removeReference();
filterPoolReference.setReferencedObject(newPool);
if (fireEvents && (caller != null)) caller.filterEventFilterPoolReferenceReset(filterPoolReference);
quietSave();
}
/**
@ -440,7 +358,6 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
count = super.removeAndDeReferenceReferencingObject(filterPoolReference);
invalidateFilterPoolReferencesCache();
if (fireEvents && (caller != null)) caller.filterEventFilterPoolReferenceDeleted(filterPoolReference);
quietSave();
return count;
}
@ -470,7 +387,6 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
int oldPos = super.getReferencingObjectPosition(filterPoolRef);
super.moveReferencingObjectPosition(pos, filterPoolRef);
invalidateFilterPoolReferencesCache();
if (!noSave) quietSave();
if (fireEvents && (caller != null) && !noEvents) {
ISystemFilterPoolReference[] refs = new ISystemFilterPoolReference[1];
refs[0] = filterPoolRef;
@ -488,7 +404,7 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
*/
public void moveSystemFilterPoolReferences(ISystemFilterPoolReference[] filterPoolRefs, int delta) {
int[] oldPositions = new int[filterPoolRefs.length];
noEvents = noSave = true;
noEvents = true;
for (int idx = 0; idx < filterPoolRefs.length; idx++)
oldPositions[idx] = getSystemFilterPoolReferencePosition(filterPoolRefs[idx]);
if (delta > 0) // moving down, process backwards
@ -498,8 +414,7 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
for (int idx = 0; idx < filterPoolRefs.length; idx++)
moveSystemFilterPoolReference(filterPoolRefs[idx], oldPositions[idx] + delta);
invalidateFilterPoolReferencesCache();
noEvents = noSave = false;
quietSave();
noEvents = false;
if (fireEvents && (caller != null)) caller.filterEventFilterPoolReferencesRePositioned(filterPoolRefs, delta);
}
@ -549,7 +464,6 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
addReferencingObject(filterPoolReference);
filterPoolReference.setParentReferenceManager(this); // DWD - should be done in addReferencingObject?
invalidateFilterPoolReferencesCache();
quietSave();
if (fireEvents && (caller != null)) caller.filterEventFilterPoolReferenceCreated(filterPoolReference);
return filterPoolReference;
}
@ -562,7 +476,6 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
addReferencingObject(filterPoolReference);
filterPoolReference.setParentReferenceManager(this); // DWD - should be done in addReferencingObject?
invalidateFilterPoolReferencesCache();
quietSave();
if (fireEvents && (caller != null)) caller.filterEventFilterPoolReferenceCreated(filterPoolReference);
return filterPoolReference;
}
@ -580,7 +493,6 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
filterPoolReference.removeReference();
newCount = removeReferencingObject(filterPoolReference);
invalidateFilterPoolReferencesCache();
quietSave();
// callback to provider so they can fire events in their GUI
if (fireEvents && (caller != null)) {
caller.filterEventFilterPoolReferenceDeleted(filterPoolReference);
@ -605,7 +517,6 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
String oldName = poolRef.getReferencedObjectName();
poolRef.resetReferencedFilterPoolName(pool.getReferenceName());
invalidateFilterPoolReferencesCache();
quietSave();
if (fireEvents && (caller != null)) caller.filterEventFilterPoolReferenceRenamed(poolRef, oldName);
}
}
@ -630,7 +541,6 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
filterPoolReference.setParentReferenceManager(this); // DWD - should be done in addReferencingObject?
}
invalidateFilterPoolReferencesCache();
quietSave();
if (fireEvents && (caller != null)) caller.filterEventFilterPoolReferencesReset();
}
}
@ -726,215 +636,6 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
return match;
}
// -----------------------
// SAVE/RESTORE METHODS...
// -----------------------
private void quietSave() {
try {
save();
} catch (Exception exc) {
// TODO log exception
}
}
/**
* Save all the filter pools to disk.
* Only called if the save policy is not "none".
* No longer used.
* @throws Exception
*/
public void save() throws Exception {
switch (savePolicy) {
// ONE FILE PER FILTER POOL REFERENCE MANAGER
case ISystemFilterSavePolicies.SAVE_POLICY_ONE_FILE_PER_MANAGER:
saveToOneFile();
break;
}
}
/**
* Save this reference manager to disk.
* Used only if using the reference manager to save a single file to disk.
* No longer used.
* @return true if the save succeeded
* @throws Exception
*/
protected boolean saveToOneFile() throws Exception {
/* FIXME
String saveFileName = getSaveFilePathAndName();
File saveFile = new File(saveFileName);
boolean exists = saveFile.exists();
saveFileName = saveFile.toURL().toString();
Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
Resource.Factory resFactory = reg.getFactory(URI.createURI(saveFileName));
//System.out.println("Saving filter pool ref mgr "+getName()+" to: " + saveFile);
//java.util.List ext = resFactory.createExtent(); mof way
//ext.add(this);
Resource res = resFactory.createResource(URI.createURI(saveFileName));
res.getContents().add(this);
try
{
res.save(EMPTY_MAP);
} catch (Exception e)
{
if (debug)
{
System.out.println("Error saving filter pool ref mgr "+getName() + " to "+saveFile+": " + e.getClass().getName() + ": " + e.getMessage());
e.printStackTrace();
}
throw e;
}
// if this is the first time we have created this file, we must update Eclipse
// resource tree to know about it...
if (!exists)
{
try {
mgrFolder.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
} catch(Exception exc) {}
}
*/
return true;
}
/**
* Restore the filter pools from disk.
* After restoring, you must call resolveReferencesAfterRestore.
* No longer used.
* @param caller The object that is calling this, which must implement SystemFilterPoolReferenceManagerProvider
* @param mgrFolder folder containing filter pool references file.
* @param name the name of the manager to restore. File name is derived from it when saving to one file.
* @param namingPolicy to get file name prefix, via getFilterPoolReferenceManagerFileNamePrefix(). Pass null to use default.
* @return the restored manager, or null if it does not exist.
* @throws Exception if anything else went wrong
*/
public static ISystemFilterPoolReferenceManager restore(ISystemFilterPoolReferenceManagerProvider caller, IFolder mgrFolder, String name, IRSEFilterNamingPolicy namingPolicy) throws Exception {
if (namingPolicy == null) namingPolicy = SystemFilterNamingPolicy.getNamingPolicy();
ISystemFilterPoolReferenceManager mgr = restoreFromOneFile(mgrFolder, name, namingPolicy);
if (mgr != null) {
((SystemFilterPoolReferenceManager) mgr).initialize(caller, mgrFolder, name, ISystemFilterSavePolicies.SAVE_POLICY_ONE_FILE_PER_MANAGER, namingPolicy); // core data
}
return mgr;
}
/**
* Restore the filter pools from disk, assuming default for a naming policy.
* No longer used.
* @param caller The object that is calling this, which must implement SystemFilterPoolReferenceManagerProvider
* @param mgrFolder folder containing filter pool references file.
* @param name the name of the manager to restore. File name is derived from it when saving to one file.
* @return the restored manager, or null if it does not exist.
* @throws Exception if anything else went wrong
*/
public static ISystemFilterPoolReferenceManager restore(ISystemFilterPoolReferenceManagerProvider caller, IFolder mgrFolder, String name) throws Exception {
return restore(caller, mgrFolder, name, null);
}
/**
* Restore filter pools when all are stored in one file.
* No longer used.
* @param mgrFolder The folder containing the file to restore from.
* @param name The name of the manager, from which the file name is derived.
* @param namingPolicy Naming prefix information for persisted data file names.
* @return the restored manager, or null if it does not exist.
* @throws Exception if anything else went wrong
*/
protected static ISystemFilterPoolReferenceManager restoreFromOneFile(IFolder mgrFolder, String name, IRSEFilterNamingPolicy namingPolicy) throws Exception {
ISystemFilterPoolReferenceManager mgr = null;
/* FIXME
Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
//ResourceSet resourceSet = MOF WAY
// Resource.Factory.Registry.getResourceSetFactory().makeResourceSet();
Resource res = null;
String saveFile = getSaveFilePathAndName(mgrFolder, name, namingPolicy);
try
{
//res = resourceSet.load(saveFile); MOF Way
Resource.Factory resFactory = reg.getFactory(URI.createURI(saveFile));
res = resFactory.createResource(URI.createURI(saveFile));
res.load(EMPTY_MAP);
}
catch (java.io.FileNotFoundException e)
{
System.out.println("Restore error: Filter pool ref mgr "+name+" missing its file: "+saveFile);
return null;
}
catch (Exception e)
{
if (debug)
{
System.out.println("Error restoring filter pool ref mgr "+name+" file "+saveFile+": " + e.getClass().getName() + ": " + e.getMessage());
e.printStackTrace();
}
throw e;
}
java.util.List ext = res.getContents();
// should be exactly one system filter pool manager...
Iterator iList = ext.iterator();
mgr = (SystemFilterPoolReferenceManager)iList.next();
if (debug)
System.out.println("Filter Pool Ref Mgr "+name+" loaded successfully.");
*/
return mgr;
}
/**
* After restoring this from disk, there is only the referenced object name,
* not the referenced object pointer, for each referencing object.
* <p>
* This method is called after restore and for each restored object in the list must:
* <ol>
* <li>Do what is necessary to find the referenced object, and set the internal reference pointer.
* <li>Call addReference(this) on that object so it can maintain it's in-memory list of all referencing objects.
* <li>Set the important transient variables
* </ol>
* @param relatedPoolMgrProvider the filter pool manager provider that created the filter pools we reference
* (usually a subsystem configuration)
* @param provider the host of this reference manager, so you can later call getProvider
* @return A Vector of SystemFilterPoolReferences that were not successfully resolved, or null if all
* were resolved.
*/
public Vector resolveReferencesAfterRestore(ISystemFilterPoolManagerProvider relatedPoolMgrProvider, ISystemFilterPoolReferenceManagerProvider provider) {
setSystemFilterPoolManagerProvider(relatedPoolMgrProvider);
setProvider(provider);
ISystemFilterPoolManager[] relatedManagers = getSystemFilterPoolManagers();
if (relatedManagers != null) {
Vector badRefs = new Vector();
ISystemFilterPoolReference[] poolRefs = getSystemFilterPoolReferences();
if (poolRefs != null) {
for (int idx = 0; idx < poolRefs.length; idx++) {
String poolName = poolRefs[idx].getReferencedFilterPoolName();
String mgrName = poolRefs[idx].getReferencedFilterPoolManagerName();
ISystemFilterPool refdPool = getFilterPool(relatedManagers, mgrName, poolName);
if ((refdPool == null) && (getFilterPoolManager(relatedManagers, mgrName) == null)) {
//System.out.println("...looking for broken reference for "+mgrName+"."+poolName);
refdPool = relatedPoolMgrProvider.getSystemFilterPoolForBrokenReference(this, mgrName, poolName);
}
if (refdPool != null) {
poolRefs[idx].setReferenceToFilterPool(refdPool); // calls refdPool.addReference(poolRef)
} else {
badRefs.addElement(poolRefs[idx]);
}
}
if (badRefs.size() == 0)
return null;
else {
for (int idx = 0; idx < badRefs.size(); idx++) {
ISystemFilterPoolReference badRef = (ISystemFilterPoolReference) badRefs.elementAt(idx);
//badRef.setReferenceBroken(true);
super.removeReferencingObject(badRef);
}
invalidateFilterPoolReferencesCache();
quietSave();
return badRefs;
}
}
}
return null;
}
/**
* Utility method to scan across all filter pools in a given named filter pool manager, for a match
* on a given filter pool name.
@ -967,80 +668,6 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference
// HELPER METHODS...
// ------------------
/**
* If saving all info in one file, this returns the fully qualified name of that file,
* given the unadorned manager name and the prefix (if any) to adorn with.
* No longer used.
* @param mgrFolder The folder in which to save a reference manager.
* @param name The name of the file for a filter pool reference manager.
* @param namingPolicy The naming policy for a filter pool reference manager
* @return The name of the path to which to save the references in a filter pool reference manager.
*/
protected static String getSaveFilePathAndName(IFolder mgrFolder, String name, IRSEFilterNamingPolicy namingPolicy) {
return SystemFilter.addPathTerminator(getFolderPath(mgrFolder)) + getSaveFileName(namingPolicy.getReferenceManagerSaveFileName(name));
}
/**
* Appends the correct extension to the file name where this manager is saved.
* No longer used.
* @param fileNameNoSuffix the file name <i>sans</i> suffix.
* @return the unqualified file name used to store this to disk.
*/
protected static String getSaveFileName(String fileNameNoSuffix) {
return fileNameNoSuffix + ISystemFilterConstants.SAVEFILE_SUFFIX;
}
/**
* @return the full path name of the file in which to save this manager.
*/
protected String getSaveFilePathAndName() {
return SystemFilter.addPathTerminator(getFolderPath(mgrFolder)) + getSaveFileName();
}
/**
* @return the simple name of the file in which to save this manager.
*/
protected String getSaveFileName() {
return getSaveFileName(namingPolicy.getReferenceManagerSaveFileName(getName()));
}
/**
* @return the folder that this manager is contained in.
*/
public IFolder getFolder() {
return mgrFolder;
}
/**
* Set the folder that this manager is contained in.
* @param newFolder the new folder
*/
public void resetManagerFolder(IFolder newFolder) {
mgrFolder = newFolder;
}
/**
* @return the path of the folder that contains this manager.
*/
public String getFolderPath() {
return getResourceHelpers().getFolderPath(mgrFolder);
}
/**
* @param folder the folder to find the path for
* @return the path of the given folder
*/
public static String getFolderPath(IFolder folder) {
return SystemResourceHelpers.getResourceHelpers().getFolderPath(folder);
}
/*
* To reduce typing...
*/
private SystemResourceHelpers getResourceHelpers() {
return SystemResourceHelpers.getResourceHelpers();
}
public String toString() {
return getName();
}

View file

@ -16,15 +16,11 @@
********************************************************************************/
package org.eclipse.rse.internal.core.filters;
import org.eclipse.rse.core.filters.IRSEFilterNamingPolicy;
import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider;
import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider;
import org.eclipse.rse.core.filters.ISystemFilterSavePolicies;
import org.eclipse.rse.core.filters.ISystemFilterStartHere;
import org.eclipse.rse.core.filters.SystemFilterNamingPolicy;
import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.logging.Logger;
@ -63,16 +59,6 @@ public class SystemFilterStartHere
return _instance;
}
/**
* Factory method to return an instance populated with defaults.
* You can then simply override whatever is desired via setXXX methods.
*/
public IRSEFilterNamingPolicy createSystemFilterNamingPolicy()
{
return SystemFilterNamingPolicy.getNamingPolicy();
}
/**
* Factory to create a filter pool manager, when you do NOT want it to worry about
* saving and restoring the filter data to disk. Rather, you will save and restore
@ -96,7 +82,7 @@ public class SystemFilterStartHere
boolean allowNestedFilters)
{
return SystemFilterPoolManager.createSystemFilterPoolManager(profile, logger, caller,
name, allowNestedFilters, ISystemFilterSavePolicies.SAVE_POLICY_NONE, null);
name, allowNestedFilters);
}
@ -112,16 +98,15 @@ public class SystemFilterStartHere
* @param relatedPoolMgrProvider The manager provider that own the master list of filter pools that
* this manager will contain references to.
* @param name the name of the filter pool reference manager. This is not currently
* used, but you may find a use for it.
* @param namingPolicy the naming policy object which will return the name of that one file.
* used, but you may find a use for it.
*/
public ISystemFilterPoolReferenceManager createSystemFilterPoolReferenceManager(
ISystemFilterPoolReferenceManagerProvider caller,
ISystemFilterPoolManagerProvider relatedPoolMgrProvider,
String name, IRSEFilterNamingPolicy namingPolicy)
String name)
{
return SystemFilterPoolReferenceManager.createSystemFilterPoolReferenceManager(
caller, relatedPoolMgrProvider, null, name, ISystemFilterSavePolicies.SAVE_POLICY_NONE, namingPolicy);
caller, relatedPoolMgrProvider, name);
}

View file

@ -48,7 +48,6 @@ import org.eclipse.rse.core.subsystems.IConnectorService;
import org.eclipse.rse.core.subsystems.IServerLauncherProperties;
import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.core.subsystems.SubSystemFilterNamingPolicy;
import org.eclipse.rse.internal.core.model.SystemProfile;
import org.eclipse.rse.internal.core.model.SystemProfileManager;
import org.eclipse.rse.persistence.dom.IRSEDOMConstants;
@ -288,7 +287,7 @@ public class RSEDOMImporter {
if (factory.supportsFilters()) {
ISystemFilterStartHere startHere = _registry.getSystemFilterStartHere();
ISystemFilterPoolReferenceManager fprMgr = startHere.createSystemFilterPoolReferenceManager(subSystem, factory, name, new SubSystemFilterNamingPolicy());
ISystemFilterPoolReferenceManager fprMgr = startHere.createSystemFilterPoolReferenceManager(subSystem, factory, name);
subSystem.setFilterPoolReferenceManager(fprMgr);
ISystemFilterPoolManager defaultFilterPoolManager = factory.getFilterPoolManager(host.getSystemProfile());
fprMgr.setDefaultSystemFilterPoolManager(defaultFilterPoolManager);
@ -331,17 +330,12 @@ public class RSEDOMImporter {
int release = getIntegerValue(node, IRSEDOMConstants.ATTRIBUTE_RELEASE);
boolean isSetSingleFilterStringOnly = getBooleanValue(node, IRSEDOMConstants.ATTRIBUTE_SINGLE_FILTER_STRING_ONLY);
Vector filterStrings = new Vector();
// create the filter strings
RSEDOMNode[] filterStringNodes = node.getChildren(IRSEDOMConstants.TYPE_FILTER_STRING);
String[] filterStrings = new String[filterStringNodes.length];
for (int i = 0; i < filterStringNodes.length; i++) {
RSEDOMNode filterStringNode = filterStringNodes[i];
// might not have to restore the filter strings this way
//restoreFilterString(filter, filterStringNode);
filterStrings.add(filterStringNode.getName());
filterStrings[i] = filterStringNode.getName();
}
// create the filter

View file

@ -23,7 +23,6 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.resources.IFolder;
import org.eclipse.rse.core.references.IRSEBasePersistableReferenceManager;
import org.eclipse.rse.core.references.IRSEBasePersistableReferencedObject;
import org.eclipse.rse.core.references.IRSEBasePersistableReferencingObject;
@ -40,11 +39,7 @@ import org.eclipse.rse.core.references.IRSEBasePersistableReferencingObject;
public class SystemPersistableReferenceManager implements IRSEBasePersistableReferenceManager {
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
@ -265,141 +260,6 @@ public class SystemPersistableReferenceManager implements IRSEBasePersistableRef
// Methods for saving and restoring if not doing your own in your own subclass
// ---------------------------------------------------------------------------
/**
* <b>YOU MUST OVERRIDE THIS METHOD!</b>
* <p>
* After restoring this from disk, there is only the referenced object name,
* not the referenced object pointer, for each referencing object.
* <p>
* This method is called after restore and for each restored object in the list must:
* <ol>
* <li>Do what is necessary to find the referenced object, and set the internal reference pointer.
* <li>Call addReference(this) on that object so it can maintain it's in-memory list
* of all referencing objects.
* </ol>
* @return true if resolved successfully. False if some references were not found and
* hence those referencing objects removed from the restored list.
*/
public boolean resolveReferencesAfterRestore() {
return false;
}
/**
* Attempt to save contents of manager to disk. Only call if not doing your own save from
* your own model that uses a subclass of this.
* @param folder The folder in which to save the manager.
* @param fileName The unqualified file name to save to. Should include extension, such as .xmi
*/
public void save(IFolder folder, String fileName) throws Exception {
/* FIXME
initMOF();
String path = folder.getLocation().toOSString();
String saveFileName = addPathTerminator(path)+fileName;
File saveFile = new File(saveFileName);
boolean exists = saveFile.exists();
saveFileName = saveFile.toURL().toString();
Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
Resource.Factory resFactory = reg.getFactory(URI.createURI(saveFileName));
//java.util.List ext = resFactory.createExtent(); // MOF way
//ext.add(this); // MOF way
Resource mofRes = resFactory.createResource(URI.createURI(saveFileName));
mofRes.getContents().add(this);
try
{
mofRes.save(EMPTY_MAP);
} catch (Exception e)
{
if (debug)
{
System.out.println("Error saving SystemPersistableReferenceManager "+getName() + " to "+saveFile+": " + e.getClass().getName() + ": " + e.getMessage());
e.printStackTrace();
}
throw e;
}
// if this is the first time we have created this file, we must update Eclipse
// resource tree to know about it...
if (!exists || !folder.exists())
{
try
{
//RSEUIPlugin.logWarning("Calling refreshLocal on project after saving MOF file: " + saveFileName);
folder.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
} catch(Exception exc)
{
System.out.println("Exception doing refreshLocal on project: " + exc.getClass().getName());
}
}
else
{
try
{
//RSEUIPlugin.logWarning("Calling refreshLocal on project after saving MOF file: " + saveFileName);
folder.refreshLocal(IResource.DEPTH_ONE, null);
} catch(Exception exc)
{
System.out.println("Exception doing refreshLocal on project: " + exc.getClass().getName());
}
}
*/
}
/**
* Restore a persisted manager from disk.
* <p>
* After restoration, YOU MUST CALL {@link #resolveReferencesAfterRestore() resolveReferencesAfterRestore}
* This presumes yours subclass has overridden that method!
* <p>
* @param folder The folder in which the saved manager exists.
* @param fileName The unqualified save file name including extension such as .xmi
* @return The restored object, or null if given file not found. Any other error gives an exception.
*/
public static IRSEBasePersistableReferenceManager restore(IFolder folder, String fileName) throws Exception {
IRSEBasePersistableReferenceManager mgr = new SystemPersistableReferenceManager();
/*FIXME
initMOF();
Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
String path = folder.getLocation().toOSString();
String saveFile = addPathTerminator(path)+fileName;
//ResourceSet resourceSet = // MOF way
// Resource.Factory.Registry.getResourceSetFactory().makeResourceSet();
Resource res1 = null;
try
{
// res1 = resourceSet.load(saveFile); MOF way
Resource.Factory resFactory = reg.getFactory(URI.createURI(saveFile));
res1 = resFactory.createResource(URI.createURI(saveFile));
res1.load(EMPTY_MAP);
}
catch (java.io.FileNotFoundException e)
{
if (debug)
System.out.println("SystemPersistableReferenceManager file not found: "+saveFile);
return null;
}
catch (Exception e)
{
if (debug)
{
System.out.println("Error loading SystemPersistableReferenceManager from file: "+saveFile+": " + e.getClass().getName() + ": " + e.getMessage());
e.printStackTrace();
}
throw e;
}
java.util.List ext1 = res1.getContents();
// should be exactly one...
Iterator iList = ext1.iterator();
mgr = (SystemPersistableReferenceManager)iList.next();
if (debug)
System.out.println("Ok. SystemPersistableReferenceManager "+mgr.getName()+" restored successfully.");
*/
return mgr;
}
/**
* Ensure given path ends with path separator.
*/

View file

@ -18,6 +18,7 @@
package org.eclipse.rse.files.ui.widgets;
import java.util.Arrays;
import java.util.Vector;
import org.eclipse.core.runtime.IStatus;
@ -802,7 +803,9 @@ public class SystemFileFilterStringEditPane
*/
public static ValidatorFileFilterString getFileFilterStringValidator(ISystemFilter filter, String filterString)
{
Vector v = filter.getFilterStringsVector();
String[] strings = filter.getFilterStrings();
Vector v = new Vector(strings.length);
v.addAll(Arrays.asList(strings));
if (filterString != null)
v.removeElement(filterString);
IRemoteFileSubSystemConfiguration ssFactory = (IRemoteFileSubSystemConfiguration)filter.getProvider();

View file

@ -341,22 +341,14 @@ public abstract class RemoteFileSubSystemConfiguration extends SubSystemConfigur
if (pool != null && isUserPrivateProfile(mgr))
{
Vector filterStrings = new Vector();
/*
RemoteFileFilterString rootsFilterString = new RemoteFileFilterString(this);
filterStrings.add(rootsFilterString.toString());
mgr.createSystemFilter(pool, rb.getString(ISystemFileConstants.RESID_FILTER_ROOTS),filterStrings);
*/
// ----------------------
// "My Home" filter...
// ----------------------
filterStrings = new Vector();
RemoteFileFilterString myHomeFilterString = new RemoteFileFilterString(this);
myHomeFilterString.setPath(getSeparator());
filterStrings.add("./*"); //$NON-NLS-1$
ISystemFilter filter = mgr.createSystemFilter(pool, SystemFileResources.RESID_FILTER_MYHOME,filterStrings);
String[] filterStrings = new String[] {"./*"}; //$NON-NLS-1$
ISystemFilter filter = mgr.createSystemFilter(pool, SystemFileResources.RESID_FILTER_MYHOME, filterStrings);
filter.setNonChangable(true);
filter.setSingleFilterStringOnly(true);
@ -387,10 +379,9 @@ public abstract class RemoteFileSubSystemConfiguration extends SubSystemConfigur
// ----------------------
// "Root Files" filter...
// ----------------------
filterStrings = new Vector();
RemoteFileFilterString rootFilesFilterString = new RemoteFileFilterString(this);
rootFilesFilterString.setPath(getSeparator());
filterStrings.add(rootFilesFilterString.toString());
filterStrings = new String[] {rootFilesFilterString.toString()};
mgr.createSystemFilter(pool, SystemFileResources.RESID_FILTER_ROOTFILES,filterStrings);
}
else
@ -400,10 +391,9 @@ public abstract class RemoteFileSubSystemConfiguration extends SubSystemConfigur
// ----------------------
// "Root Files" filter...
// ----------------------
Vector filterStrings = new Vector();
RemoteFileFilterString rootFilesFilterString = new RemoteFileFilterString(this);
rootFilesFilterString.setPath(getSeparator());
filterStrings.add(rootFilesFilterString.toString());
String[] filterStrings = new String[] {rootFilesFilterString.toString()};
mgr.createSystemFilter(pool, SystemFileResources.RESID_FILTER_ROOTFILES,filterStrings);
}
//else

View file

@ -48,27 +48,23 @@ public class DStoreWindowsFileSubSystemConfiguration extends DStoreFileSubSystem
// ----------------------
// "My Home" filter...
// ----------------------
Vector filterStrings = new Vector();
String[] filterStrings = new String[] {".\\*"}; //$NON-NLS-1$
RemoteFileFilterString myHomeFilterString = new RemoteFileFilterString(this);
myHomeFilterString.setPath(getSeparator());
filterStrings.add(".\\*"); //$NON-NLS-1$
ISystemFilter filter = mgr.createSystemFilter(pool, SystemFileResources.RESID_FILTER_MYHOME,filterStrings);
filter.setNonChangable(true);
filter.setSingleFilterStringOnly(true);
filterStrings = new Vector();
RemoteFileFilterString defaultFilterString = new RemoteFileFilterString(this);
filterStrings.add(defaultFilterString.toString());
filterStrings = new String[] {defaultFilterString.toString()};
String filterName = SystemFileResources.RESID_FILTER_DRIVES;
mgr.createSystemFilter(pool, filterName, filterStrings);
}
else
{
Vector filterStrings = new Vector();
filterStrings = new Vector();
RemoteFileFilterString defaultFilterString = new RemoteFileFilterString(this);
filterStrings.add(defaultFilterString.toString());
String[] filterStrings = new String[] {defaultFilterString.toString()};
String filterName = SystemFileResources.RESID_FILTER_DRIVES;
mgr.createSystemFilter(pool, filterName, filterStrings);

View file

@ -117,16 +117,14 @@ public class LocalFileSubSystemConfiguration extends FileServiceSubSystemConfigu
String myHomeFilterName = SystemFileResources.RESID_FILTER_MYHOME;
RemoteFileFilterString myDocsFilterString = new RemoteFileFilterString(this);
myDocsFilterString.setPath(System.getProperty("user.home") + getSeparator()); //$NON-NLS-1$
Vector myDocsFilterStrings = new Vector();
myDocsFilterStrings.add(myDocsFilterString.toString());
String[] myDocsFilterStrings = new String[] {myDocsFilterString.toString()};
mgr.createSystemFilter(pool, myHomeFilterName, myDocsFilterStrings);
Vector filterStrings = new Vector();
RemoteFileFilterString defaultFilterString = new RemoteFileFilterString(this);
if (!_isWindows)
defaultFilterString.setPath(getSeparator());
filterStrings.add(defaultFilterString.toString());
String[] filterStrings = new String[] {defaultFilterString.toString()};
//System.out.println("creating filter...");
String filterName = null;
if (_isWindows)
@ -137,11 +135,10 @@ public class LocalFileSubSystemConfiguration extends FileServiceSubSystemConfigu
}
else
{
Vector filterStrings = new Vector();
RemoteFileFilterString defaultFilterString = new RemoteFileFilterString(this);
if (!_isWindows)
defaultFilterString.setPath(getSeparator());
filterStrings.add(defaultFilterString.toString());
String[] filterStrings = new String[] {defaultFilterString.toString()};
//System.out.println("creating filter...");
String filterName = null;
if (_isWindows)

View file

@ -96,41 +96,36 @@ public abstract class RemoteProcessSubSystemConfiguration extends
if (isUserPrivateProfile(mgr))
{
Vector filterStrings = new Vector();
// ----------------------
// "All Processes" filter...
// ----------------------
filterStrings = new Vector();
HostProcessFilterImpl allProcessesFilterString = new HostProcessFilterImpl();
filterStrings.add(allProcessesFilterString.toString());
ISystemFilter filter = mgr.createSystemFilter(pool, SystemProcessesCoreResources.RESID_PROPERTY_PROCESS_DEFAULTFILTER_LABEL,filterStrings);
String[] filterStrings = new String[] {allProcessesFilterString.toString()};
ISystemFilter filter = mgr.createSystemFilter(pool, SystemProcessesCoreResources.RESID_PROPERTY_PROCESS_DEFAULTFILTER_LABEL, filterStrings);
filter.setNonChangable(true);
filter.setSingleFilterStringOnly(true);
//------------------------
// "My Processes" filter...
// ----------------------
filterStrings = new Vector();
HostProcessFilterImpl myProcessesFilterString = new HostProcessFilterImpl();
myProcessesFilterString.setUsername("${user.id}"); //$NON-NLS-1$
filterStrings.add(myProcessesFilterString.toString());
filter = mgr.createSystemFilter(pool, SystemProcessesCoreResources.RESID_PROPERTY_PROCESS_MYPROCESSESFILTER_LABEL,filterStrings);
filterStrings = new String[] {myProcessesFilterString.toString()};
filter = mgr.createSystemFilter(pool, SystemProcessesCoreResources.RESID_PROPERTY_PROCESS_MYPROCESSESFILTER_LABEL, filterStrings);
filter.setNonChangable(true);
filter.setSingleFilterStringOnly(true);
}
else
{
Vector filterStrings = new Vector();
// ----------------------
// "All Processes" filter...
// ----------------------
filterStrings = new Vector();
HostProcessFilterImpl allProcessesFilterString = new HostProcessFilterImpl();
filterStrings.add(allProcessesFilterString.toString());
ISystemFilter filter = mgr.createSystemFilter(pool, SystemProcessesCoreResources.RESID_PROPERTY_PROCESS_DEFAULTFILTER_LABEL,filterStrings);
String[] filterStrings = new String[] {allProcessesFilterString.toString()};
ISystemFilter filter = mgr.createSystemFilter(pool, SystemProcessesCoreResources.RESID_PROPERTY_PROCESS_DEFAULTFILTER_LABEL, filterStrings);
filter.setNonChangable(true);
filter.setSingleFilterStringOnly(true);
}

View file

@ -97,15 +97,14 @@ public class SystemFilterNewFilterPoolWizardDefaultMainPage
* Either call this or override getFilterPoolManagerNames, or leave null and this prompt will
* not show.
*/
public void setFilterPoolManagers(ISystemFilterPoolManager[] mgrs)
{
public void setFilterPoolManagers(ISystemFilterPoolManager[] mgrs) {
mgrNames = new String[mgrs.length];
validatorsByManager = new ISystemValidator[mgrNames.length];
for (int idx=0; idx<mgrs.length; idx++)
{
mgrNames[idx] = mgrs[idx].getName();
ISystemValidator iiv = new ValidatorFilterPoolName(mgrs[idx].getSystemFilterPoolNamesVector());
validatorsByManager[idx] = iiv;
for (int idx = 0; idx < mgrs.length; idx++) {
ISystemFilterPoolManager manager = mgrs[idx];
mgrNames[idx] = manager.getName();
ISystemValidator iiv = new ValidatorFilterPoolName(manager.getSystemFilterPoolNames());
validatorsByManager[idx] = iiv;
}
}
/**

View file

@ -22,6 +22,7 @@
********************************************************************************/
package org.eclipse.rse.internal.ui.view;
import java.util.Arrays;
import java.util.Vector;
import org.eclipse.core.runtime.IAdaptable;
@ -278,19 +279,17 @@ public class SystemViewFilterAdapter extends AbstractSystemViewAdapter
// normal filters...
//Vector strings = filter.getFilterStringsVector();
Vector strings = filter.getFilterStringObjectsVector();
Vector filters = filter.getSystemFiltersVector();
ISystemFilterString[] filterStrings = filter.getSystemFilterStrings();
ISystemFilter[] filters = filter.getSystemFilters();
Vector vChildren = new Vector();
// start with nested filters...
for (int idx=0; idx < filters.size(); idx++)
vChildren.addElement(filters.elementAt(idx));
for (int idx=0; idx < filters.length; idx++)
vChildren.addElement(filters[idx]);
// continue with resolved filter string objects...
for (int idx=0; idx < strings.size(); idx++)
for (int idx=0; idx < filterStrings.length; idx++)
{
//String filterString = (String)strings.elementAt(idx);
ISystemFilterString filterString = (ISystemFilterString)strings.elementAt(idx);
vChildren.addElement(filterString);
vChildren.addElement(filterStrings[idx]);
}
// convert whole thing to an array...
@ -482,35 +481,28 @@ public class SystemViewFilterAdapter extends AbstractSystemViewAdapter
* @param element either a filter for a rename action, or a filter pool for a "new" action.
* @return a validator for verifying the new name is correct.
*/
public ISystemValidator getNameValidator(Object element)
{
public ISystemValidator getNameValidator(Object element) {
ISystemFilter filter = null;
ISystemFilterPool pool = null;
Vector filterNames = null;
if (element instanceof ISystemFilter)
{
filter = (ISystemFilter)element;
pool = filter.getParentFilterPool();
if (pool != null)
filterNames = pool.getSystemFilterNames();
else
{
ISystemFilter parentFilter = filter.getParentFilter();
filterNames = parentFilter.getSystemFilterNames();
}
String[] filterNames = null;
if (element instanceof ISystemFilter) {
filter = (ISystemFilter) element;
pool = filter.getParentFilterPool();
if (pool != null)
filterNames = pool.getSystemFilterNames();
else {
ISystemFilter parentFilter = filter.getParentFilter();
filterNames = parentFilter.getSystemFilterNames();
}
} else {
pool = (ISystemFilterPool) element;
filterNames = pool.getSystemFilterNames();
}
else
{
pool = (ISystemFilterPool)element;
filterNames = pool.getSystemFilterNames();
}
/*
if (filter != null)
filterNames.removeElement(filter.getName()); // remove current filter's name
*/
ISystemValidator nameValidator = new ValidatorFilterName(filterNames);
return nameValidator;
}
Vector names = new Vector(filterNames.length);
names.addAll(Arrays.asList(filterNames));
ISystemValidator nameValidator = new ValidatorFilterName(filterNames);
return nameValidator;
}
/**
* Parent override.

View file

@ -18,7 +18,6 @@
********************************************************************************/
package org.eclipse.rse.internal.ui.view;
import java.util.Vector;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
@ -262,19 +261,13 @@ public class SystemViewFilterPoolAdapter extends AbstractSystemViewAdapter
/**
* Return a validator for verifying the new name is correct.
*/
public ISystemValidator getNameValidator(Object element)
{
ISystemFilterPool fp = (ISystemFilterPool)element;
public ISystemValidator getNameValidator(Object element) {
ISystemFilterPool fp = (ISystemFilterPool) element;
ISystemFilterPoolManager mgr = fp.getSystemFilterPoolManager();
Vector v = mgr.getSystemFilterPoolNamesVector();
/*
if (fp != null) // might be called by the New wizard vs rename action
v.removeElement(fp.getName());
*/
ISystemValidator nameValidator = new ValidatorFilterPoolName(v);
//System.out.println("Inside getNameValidator for SystemViewFilterPoolAdapter");
return nameValidator;
}
String[] names = mgr.getSystemFilterPoolNames();
ISystemValidator nameValidator = new ValidatorFilterPoolName(names);
return nameValidator;
}
/**
* Parent override.

View file

@ -19,7 +19,6 @@
********************************************************************************/
package org.eclipse.rse.internal.ui.view;
import java.util.Vector;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
@ -327,22 +326,20 @@ public class SystemViewFilterPoolReferenceAdapter
/**
* Return a validator for verifying the new name is correct.
*/
public ISystemValidator getNameValidator(Object element)
{
ISystemFilterPool fp = null;
if (element instanceof ISystemFilterPoolReference)
fp = getFilterPool(element);
else
fp = (ISystemFilterPool)element;
ISystemFilterPoolManager mgr = fp.getSystemFilterPoolManager();
Vector v = mgr.getSystemFilterPoolNamesVector();
/*
if (fp != null) // might be called by the New wizard vs rename action
v.removeElement(fp.getName());
*/
ISystemValidator nameValidator = new ValidatorFilterPoolName(v);
return nameValidator;
}
public ISystemValidator getNameValidator(Object element) {
ISystemFilterPool fp = null;
if (element instanceof ISystemFilterPoolReference) {
fp = getFilterPool(element);
} else if (element instanceof ISystemFilterPool) {
fp = (ISystemFilterPool) element;
} else {
throw new IllegalArgumentException();
}
ISystemFilterPoolManager mgr = fp.getSystemFilterPoolManager();
String[] names = mgr.getSystemFilterPoolNames();
ISystemValidator nameValidator = new ValidatorFilterPoolName(names);
return nameValidator;
}
/**
* Parent override.
* <p>

View file

@ -28,8 +28,6 @@
package org.eclipse.rse.internal.ui.view;
import java.util.Vector;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
@ -659,49 +657,32 @@ public class SystemViewFilterReferenceAdapter
* Return a validator for verifying the new name is correct.
* @param element either a filter for a rename action, or a filter pool for a "new" action.
*/
public ISystemValidator getNameValidator(Object element)
{
public ISystemValidator getNameValidator(Object element) {
ISystemFilter filter = null;
ISystemFilterPool pool = null;
Vector filterNames = null;
if (element instanceof ISystemFilterReference)
{
String[] filterNames = null;
if (element instanceof ISystemFilterReference) {
filter = getFilter(element);
pool = filter.getParentFilterPool();
if (pool != null)
filterNames = pool.getSystemFilterNames();
else
{
else {
ISystemFilter parentFilter = filter.getParentFilter();
filterNames = parentFilter.getSystemFilterNames();
}
}
else if (element instanceof ISystemFilter)
{
} else if (element instanceof ISystemFilter) {
filter = (ISystemFilter) element;
pool = filter.getParentFilterPool();
if (pool != null)
filterNames = pool.getSystemFilterNames();
else
{
else {
ISystemFilter parentFilter = filter.getParentFilter();
filterNames = parentFilter.getSystemFilterNames();
}
}
else
{
} else {
pool = (ISystemFilterPool) element;
filterNames = pool.getSystemFilterNames();
}
/*
if (filter != null)
{
filterNames.removeElement(filter.getName()); // remove current filter's name
System.out.println("Existing names for " + filter.getName());
for (int idx=0; idx<filterNames.size(); idx++)
System.out.println("...: " + filterNames.elementAt(idx));
}
*/
ISystemValidator nameValidator = new ValidatorFilterName(filterNames);
return nameValidator;
}

View file

@ -18,6 +18,8 @@
********************************************************************************/
package org.eclipse.rse.internal.ui.view;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import org.eclipse.core.runtime.IAdaptable;
@ -225,17 +227,21 @@ public class SystemViewFilterStringAdapter extends AbstractSystemViewAdapter
/**
* Perform the delete action.
*/
public boolean doDelete(Shell shell, Object element, IProgressMonitor monitor) throws Exception
{
public boolean doDelete(Shell shell, Object element, IProgressMonitor monitor) throws Exception {
ISystemFilterString filterString = getFilterString(element);
ISystemFilter filter = filterString.getParentSystemFilter();
ISystemFilter filter = filterString.getParentSystemFilter();
ISystemFilterPoolManager fpMgr = filterString.getSystemFilterPoolManager();
Vector strings = filter.getSystemFiltersVector();
String[] filterStrings = new String[strings.size()-1];
for (int idx=0; idx<filterStrings.length; idx++)
filterStrings[idx] = ((ISystemFilterString)strings.elementAt(idx)).toString();
strings.remove(filterString);
fpMgr.updateSystemFilter(filter, filter.getName(), filterStrings);
String[] oldStrings = filter.getFilterStrings();
List workingStrings = new ArrayList(oldStrings.length);
for (int i = 0; i < oldStrings.length; i++) {
String oldString = oldStrings[i];
if (!filterString.equals(oldStrings[i])) {
workingStrings.add(oldString);
}
}
String[] newStrings = new String[workingStrings.size()];
workingStrings.toArray(newStrings);
fpMgr.updateSystemFilter(filter, filter.getName(), newStrings);
return true;
}

View file

@ -16,6 +16,7 @@
package org.eclipse.rse.ui.filters.dialogs;
import java.util.Arrays;
import java.util.Vector;
import org.eclipse.jface.resource.ImageDescriptor;
@ -426,16 +427,21 @@ public class SystemNewFilterWizard
}
/**
* Reusable method to return a name validator for renaming a filter.
* @param the current filter object on updates. Can be null for new names. Used
* to remove from the existing name list the current filter's name.
* @param container the current filter object on updates. Can be null for new names. Used
* to remove from the existing name list the current filter's name.
* @param filter the filter whose name should be removed from the validation list. May be null if the list from the container
* should be used intact.
* @return a name validator
*/
public static ISystemValidator getFilterNameValidator(ISystemFilterContainer container,ISystemFilter filter)
{
Vector v = container.getSystemFilterNames();
if (filter != null)
v.removeElement(filter.getName());
ValidatorFilterName filterNameValidator = new ValidatorFilterName(v);
return filterNameValidator;
public static ISystemValidator getFilterNameValidator(ISystemFilterContainer container, ISystemFilter filter) {
String[] names = container.getSystemFilterNames();
Vector v = new Vector(names.length);
v.addAll(Arrays.asList(names));
if (filter != null) {
v.removeElement(filter.getName());
}
ValidatorFilterName filterNameValidator = new ValidatorFilterName(v);
return filterNameValidator;
}
/**
@ -616,12 +622,14 @@ public class SystemNewFilterWizard
* @param shell the shell that hosts this wizard.
* @param filterParent the parent of this filter - usually a filter pool
* @param aliasName the name of the filter itself
* @param filterStrings a Vector of string that contain the specification of this filter
* @param filterStringsVector a Vector of string that contain the specification of this filter
* @param type the type of the filter used when interpreting the filter, usually supplied by a subsystem
* @return the ISystemFilter that was created
* @throws Exception if an error occurs
*/
public ISystemFilter createNewFilter(Shell shell, ISystemFilterContainer filterParent, String aliasName, Vector filterStrings, String type) throws Exception {
public ISystemFilter createNewFilter(Shell shell, ISystemFilterContainer filterParent, String aliasName, Vector filterStringsVector, String type) throws Exception {
String[] filterStrings = new String[filterStringsVector.size()];
filterStringsVector.toArray(filterStrings);
ISystemFilter newFilter = null;
ISystemFilterPoolManager fpMgr = filterParent.getSystemFilterPoolManager();
if (type == null)

View file

@ -15,6 +15,7 @@
********************************************************************************/
package org.eclipse.rse.ui.propertypages;
import java.util.Arrays;
import java.util.ResourceBundle;
import java.util.Vector;
@ -247,7 +248,9 @@ public class SystemFilterStringPropertyPage extends SystemBasePropertyPage imple
editPaneComposite.setEnabled(false);
else if (filterStringValidator == null)
{
Vector existingStrings = filter.getFilterStringsVector();
String[] filterStrings = filter.getFilterStrings();
Vector existingStrings = new Vector(filterStrings.length);
existingStrings.addAll(Arrays.asList(filterStrings));
existingStrings.remove(filterstring);
filterStringValidator = new ValidatorFilterString(existingStrings, filter.isStringsCaseSensitive());
if (dupeFilterStringMessage != null)

View file

@ -3229,7 +3229,6 @@ public abstract class SubSystem extends RSEModelObject
ISystemFilterPoolReference poolReference = (ISystemFilterPoolReference) z.next();
fprm.addSystemFilterPoolReference(poolReference);
}
fprm.resolveReferencesAfterRestore();
}
filterEventFilterPoolReferencesReset(); // signal a resource change event
}

View file

@ -57,7 +57,6 @@ import org.eclipse.rse.core.filters.ISystemFilterPool;
import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
import org.eclipse.rse.core.filters.ISystemFilterSavePolicies;
import org.eclipse.rse.core.filters.ISystemFilterString;
import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ILabeledObject;
@ -138,7 +137,6 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
private static final ISubSystem[] EMPTY_SUBSYSTEM_ARRAY = new ISubSystem[0];
// filters stuff...
protected SubSystemFilterNamingPolicy filterNamingPolicy = new SubSystemFilterNamingPolicy();
protected ISystemFilterPoolManager[] filterPoolManagers = null;
protected Hashtable filterPoolManagersPerProfile = new Hashtable();
@ -991,7 +989,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
// that are stored with a subsystem.
//SystemFilterPoolManager[] relatedFilterPoolManagers =
// getReferencableFilterPoolManagers(conn.getSystemProfile());
ISystemFilterPoolReferenceManager fprMgr = SystemFilterStartHere.getInstance().createSystemFilterPoolReferenceManager(subsys, this, subsys.getName(), filterNamingPolicy);
ISystemFilterPoolReferenceManager fprMgr = SystemFilterStartHere.getInstance().createSystemFilterPoolReferenceManager(subsys, this, subsys.getName());
subsys.setFilterPoolReferenceManager(fprMgr);
ISystemFilterPoolManager defaultFilterPoolManager = getFilterPoolManager(conn.getSystemProfile());
fprMgr.setDefaultSystemFilterPoolManager(defaultFilterPoolManager);
@ -1082,7 +1080,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
// that are stored with a subsystem.
//SystemFilterPoolManager[] relatedFilterPoolManagers =
// getReferencableFilterPoolManagers(newConnection.getSystemProfile());
ISystemFilterPoolReferenceManager newRefMgr = SystemFilterStartHere.getInstance().createSystemFilterPoolReferenceManager(subsys, this, subsys.getName(), filterNamingPolicy);
ISystemFilterPoolReferenceManager newRefMgr = SystemFilterStartHere.getInstance().createSystemFilterPoolReferenceManager(subsys, this, subsys.getName());
ISystemFilterPoolManager defaultFilterPoolManager = null;
if (copyProfileOperation)
defaultFilterPoolManager = getFilterPoolManager(newConnection.getSystemProfile());
@ -1613,8 +1611,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
Logger logger = RSECorePlugin.getDefault().getLogger();
String managerName = getFilterPoolManagerName(profile);
boolean supportsNested = supportsNestedFilters();
int savePolicy = ISystemFilterSavePolicies.SAVE_POLICY_ONE_FILE_PER_FILTER;
mgr = SystemFilterPoolManager.createSystemFilterPoolManager(profile, logger, this, managerName, supportsNested, savePolicy, filterNamingPolicy);// the filter pool manager name
mgr = SystemFilterPoolManager.createSystemFilterPoolManager(profile, logger, this, managerName, supportsNested);// the filter pool manager name
mgr.setSingleFilterStringOnly(!supportsMultipleFilterStrings());
mgr.setWasRestored(false); // not yet initialized
} catch (Exception exc) {
@ -1666,10 +1663,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
ISystemFilterPoolManager oldMgr = getFilterPoolManager(oldProfile); // will restore it if necessary
ISystemFilterPoolManager mgr = SystemFilterPoolManager.createSystemFilterPoolManager(newProfile, RSECorePlugin.getDefault().getLogger(), this, // the caller
getFilterPoolManagerName(newProfile), // the filter pool manager name
supportsNestedFilters(), // whether or not nested filters are allowed
ISystemFilterSavePolicies.SAVE_POLICY_ONE_FILE_PER_FILTER, filterNamingPolicy);
ISystemFilterPoolManager mgr = SystemFilterPoolManager.createSystemFilterPoolManager(newProfile, RSECorePlugin.getDefault().getLogger(), this, getFilterPoolManagerName(newProfile), supportsNestedFilters());
mgr.setStringsCaseSensitive(oldMgr.areStringsCaseSensitive());
mgr.setSupportsDuplicateFilterStrings(oldMgr.supportsDuplicateFilterStrings());
addFilterPoolManager(newProfile, mgr);
@ -2556,7 +2550,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
// that are stored with a subsystem.
//SystemFilterPoolManager[] relatedFilterPoolManagers =
// getReferencableFilterPoolManagers(conn.getSystemProfile());
ISystemFilterPoolReferenceManager fprMgr = SystemFilterStartHere.getInstance().createSystemFilterPoolReferenceManager(subsys, this, subsys.getName(), filterNamingPolicy);
ISystemFilterPoolReferenceManager fprMgr = SystemFilterStartHere.getInstance().createSystemFilterPoolReferenceManager(subsys, this, subsys.getName());
subsys.setFilterPoolReferenceManager(fprMgr);
ISystemFilterPoolManager defaultFilterPoolManager = getFilterPoolManager(conn.getSystemProfile());
fprMgr.setDefaultSystemFilterPoolManager(defaultFilterPoolManager);