1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-15 13:05:22 +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-14 21:09:03 +00:00
parent a8535007a9
commit d0aa83ebef
2 changed files with 103 additions and 49 deletions

View file

@ -14,10 +14,13 @@
* Contributors: * Contributors:
* David Dykstal (IBM) - [197036] All filter pools created on clean workspace * David Dykstal (IBM) - [197036] All filter pools created on clean workspace
* cleaned javadoc for renameSystemFilterPool * cleaned javadoc for renameSystemFilterPool
* David Dykstal (IBM) - [222270] clean up interfaces in org.eclipse.rse.core.filters
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.core.filters; package org.eclipse.rse.core.filters;
import java.util.List;
import org.eclipse.rse.core.model.IRSEPersistableContainer; import org.eclipse.rse.core.model.IRSEPersistableContainer;
import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemProfile;
@ -258,6 +261,16 @@ public interface ISystemFilterPoolManager extends IRSEPersistableContainer {
*/ */
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, String[] filterStrings) throws Exception; public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, String[] filterStrings) throws Exception;
/**
* Creates a new system filter within the given filter container (either a filter pool, or
* a filter). This creates the filter, and then saves the filter pool.
* <p>Calls back to provider to inform of the event (filterEventFilterCreated)
* @param parent The parent which is either a SystemFilterPool or a SystemFilter
* @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, List filterStrings) throws Exception;
/** /**
* Creates a new system filter that is typed. * Creates a new system filter that is typed.
* Same as {@link #createSystemFilter(ISystemFilterContainer, String, String[])} but * Same as {@link #createSystemFilter(ISystemFilterContainer, String, String[])} but
@ -274,6 +287,22 @@ public interface ISystemFilterPoolManager extends IRSEPersistableContainer {
*/ */
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, String[] 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.
* 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
* is for use entirely by tools who wish to support multiple types of filters and be able to launch unique
* actions per type, say.
*
* @param parent The parent which is either a SystemFilterPool or a SystemFilter
* @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.
* @param type The type of this filter
*/
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, List filterStrings, String type) throws Exception;
/** /**
* Creates a new system filter that is typed and promptable * Creates a new system filter that is typed and promptable
* Same as {@link #createSystemFilter(ISystemFilterContainer, String ,String[], String)} but * Same as {@link #createSystemFilter(ISystemFilterContainer, String ,String[], String)} but
@ -291,6 +320,23 @@ public interface ISystemFilterPoolManager extends IRSEPersistableContainer {
*/ */
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, String[] filterStrings, String type, boolean promptable) throws Exception; public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, String[] filterStrings, String type, boolean promptable) throws Exception;
/**
* Creates a new system filter that is typed and promptable
* 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.
* There is no base filter framework support for this, but tools can query this attribute and
* do their own thing at expand time.
*
* @param parent The parent which is either a SystemFilterPool or a SystemFilter
* @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.
* @param type The type of this filter
* @param promptable Pass true if this is a promptable filter
*/
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, List filterStrings, String type, boolean promptable) throws Exception;
/** /**
* Delete an existing system filter. * Delete an existing system filter.
* Does the following: * Does the following:

View file

@ -14,6 +14,7 @@
* Contributors: * Contributors:
* David Dykstal (IBM) - 142806: refactoring persistence framework * David Dykstal (IBM) - 142806: refactoring persistence framework
* David Dykstal (IBM) - [197036] removed caching mechanism to clean up logic * David Dykstal (IBM) - [197036] removed caching mechanism to clean up logic
* David Dykstal (IBM) - [222270] clean up interfaces in org.eclipse.rse.core.filters
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.core.filters; package org.eclipse.rse.internal.core.filters;
@ -622,6 +623,34 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
// --------------------------------- // ---------------------------------
// FILTER METHODS // FILTER METHODS
// --------------------------------- // ---------------------------------
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilterPoolManager#createSystemFilter(org.eclipse.rse.core.filters.ISystemFilterContainer, java.lang.String, java.util.List, java.lang.String, boolean)
*/
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, List filterStrings, String type, boolean promptable) throws Exception {
String[] filterStringsArray = new String[filterStrings.size()];
ISystemFilter result = doCreateSystemFilter(parent, aliasName, filterStringsArray, type, promptable);
return result;
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilterPoolManager#createSystemFilter(org.eclipse.rse.core.filters.ISystemFilterContainer, java.lang.String, java.util.List, java.lang.String)
*/
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, List filterStrings, String type) throws Exception {
String[] filterStringsArray = new String[filterStrings.size()];
ISystemFilter result = doCreateSystemFilter(parent, aliasName, filterStringsArray, type, false);
return result;
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.filters.ISystemFilterPoolManager#createSystemFilter(org.eclipse.rse.core.filters.ISystemFilterContainer, java.lang.String, java.util.List)
*/
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, List filterStrings) throws Exception {
String[] filterStringsArray = new String[filterStrings.size()];
ISystemFilter result = doCreateSystemFilter(parent, aliasName, filterStringsArray, null, false);
return result;
}
/** /**
* Creates a new system filter within the given filter container (either a filter pool, or * Creates a new system filter within the given filter container (either a filter pool, or
* a filter). This creates the filter, and then saves the filter pool. * a filter). This creates the filter, and then saves the filter pool.
@ -631,16 +660,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
* @param filterStrings The list of String objects that represent the filter strings. * @param filterStrings The list of String objects that represent the filter strings.
*/ */
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, String[] filterStrings) throws Exception { public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, String[] filterStrings) throws Exception {
ISystemFilter newFilter = null; ISystemFilter newFilter = doCreateSystemFilter(parent, aliasName, filterStrings, null, false);
ISystemFilterPool parentPool = null;
if (parent instanceof ISystemFilterPool)
parentPool = (ISystemFilterPool) parent;
else
parentPool = ((ISystemFilter) parent).getParentFilterPool();
newFilter = parent.createSystemFilter(aliasName, filterStrings);
if (!suspendSave) commit(parentPool);
// if caller provider, callback to inform them of this event
if ((caller != null) && !suspendCallbacks) caller.filterEventFilterCreated(newFilter);
return newFilter; return newFilter;
} }
@ -659,27 +679,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
* @param type The type of this filter * @param type The type of this filter
*/ */
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, String[] filterStrings, String type) throws Exception { public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, String[] filterStrings, String type) throws Exception {
boolean oldSuspendSave = suspendSave; ISystemFilter newFilter = doCreateSystemFilter(parent, aliasName, filterStrings, type, false);
boolean oldSuspendCallbacks = suspendCallbacks;
suspendSave = true;
suspendCallbacks = true;
ISystemFilter newFilter = createSystemFilter(parent, aliasName, filterStrings);
newFilter.setType(type);
suspendSave = oldSuspendSave;
suspendCallbacks = oldSuspendCallbacks;
if (!suspendSave) {
ISystemFilterPool parentPool = null;
if (parent instanceof ISystemFilterPool)
parentPool = (ISystemFilterPool) parent;
else
parentPool = ((ISystemFilter) parent).getParentFilterPool();
commit(parentPool);
}
// if caller provider, callback to inform them of this event
if ((caller != null) && !suspendCallbacks) caller.filterEventFilterCreated(newFilter);
return newFilter; return newFilter;
} }
@ -699,27 +699,35 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
* @param promptable Pass true if this is a promptable filter * @param promptable Pass true if this is a promptable filter
*/ */
public ISystemFilter createSystemFilter(ISystemFilterContainer parent, String aliasName, String[] 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; ISystemFilter newFilter = doCreateSystemFilter(parent, aliasName, filterStrings, type, promptable);
boolean oldSuspendCallbacks = suspendCallbacks; return newFilter;
suspendSave = true; }
suspendCallbacks = true;
ISystemFilter newFilter = createSystemFilter(parent, aliasName, filterStrings, type); /**
newFilter.setPromptable(promptable); * Creates a system filter.
* @param parent the owning parent of this filter, must be a filter pool or a filter capable of nesting
suspendSave = oldSuspendSave; * @param name the name of this filter
suspendCallbacks = oldSuspendCallbacks; * @param filterStrings the strings associated with this filter
* @param type the type of this filter, used only if inheritType is false
if (!suspendSave) { * @param promptable the promptable nature of this filter, used only if inheritPromptable is false
* @return
*/
private ISystemFilter doCreateSystemFilter(ISystemFilterContainer parent, String name, String[] filterStrings, String type, boolean promptable) {
ISystemFilterPool parentPool = null; ISystemFilterPool parentPool = null;
if (parent instanceof ISystemFilterPool) if (parent instanceof ISystemFilterPool) {
parentPool = (ISystemFilterPool) parent; parentPool = (ISystemFilterPool) parent;
else } else {
parentPool = ((ISystemFilter) parent).getParentFilterPool(); parentPool = ((ISystemFilter) parent).getParentFilterPool();
}
ISystemFilter newFilter = parentPool.createSystemFilter(name, filterStrings);
newFilter.setType(type);
newFilter.setPromptable(promptable);
if (!suspendSave) {
commit(parentPool); commit(parentPool);
} }
// if caller provider, callback to inform them of this event if ((caller != null) && !suspendCallbacks) {
if ((caller != null) && !suspendCallbacks) caller.filterEventFilterCreated(newFilter); caller.filterEventFilterCreated(newFilter);
}
return newFilter; return newFilter;
} }