Skip to content
Snippets Groups Projects

Bug 479184

2 files
+ 58
8
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -8,12 +8,19 @@
@@ -8,12 +8,19 @@
* Contributors:
* Contributors:
* Initial API and implementation and/or initial documentation - Jay Jay Billings,
* Initial API and implementation and/or initial documentation - Jay Jay Billings,
* Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson,
* Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson,
* Claire Saunders, Matthew Wang, Anna Wojtowicz
* Claire Saunders, Matthew Wang, Anna Wojtowicz, Nick Stanish
*******************************************************************************/
*******************************************************************************/
package org.eclipse.ice.item;
package org.eclipse.ice.item;
import java.util.ArrayList;
import java.util.ArrayList;
 
import org.eclipse.core.runtime.CoreException;
 
import org.eclipse.core.runtime.IConfigurationElement;
 
import org.eclipse.core.runtime.IExtensionPoint;
 
import org.eclipse.core.runtime.Platform;
 
import org.slf4j.Logger;
 
import org.slf4j.LoggerFactory;
 
/**
/**
* <p>
* <p>
* This class builds Items that depend on other Items. These "composite Items"
* This class builds Items that depend on other Items. These "composite Items"
@@ -23,9 +30,13 @@ import java.util.ArrayList;
@@ -23,9 +30,13 @@ import java.util.ArrayList;
* ICompositeItemBuilder.addBuilders().
* ICompositeItemBuilder.addBuilders().
* </p>
* </p>
*
*
* @author Jay Jay Billings
* @author Jay Jay Billings, Nick Stanish
*/
*/
public interface ICompositeItemBuilder extends ItemBuilder {
public interface ICompositeItemBuilder extends ItemBuilder {
 
 
public static final String EXTENSION_ID = "org.eclipse.ice.item.compositeItemBuilder";
 
 
/**
/**
* <p>
* <p>
@@ -42,4 +53,41 @@ public interface ICompositeItemBuilder extends ItemBuilder {
@@ -42,4 +53,41 @@ public interface ICompositeItemBuilder extends ItemBuilder {
* </p>
* </p>
*/
*/
public void addBuilders(ArrayList<ItemBuilder> itemBuilders);
public void addBuilders(ArrayList<ItemBuilder> itemBuilders);
 
 
 
/**
 
* This operation retrieves all of the CompositeItemBuilders from the
 
* ExtensionRegistry.
 
*
 
* @return The array of CompositeItemBuilders that were found in the registry.
 
* @throws CoreException
 
* This exception is thrown if an extension cannot be loaded.
 
*/
 
public static ICompositeItemBuilder[] getCompositeItemBuilders() throws CoreException {
 
 
/**
 
* Logger for handling event messages and other information.
 
*/
 
Logger logger = LoggerFactory.getLogger(ICompositeItemBuilder.class);
 
 
ICompositeItemBuilder[] builders = null;
 
 
IExtensionPoint point = Platform.getExtensionRegistry()
 
.getExtensionPoint(EXTENSION_ID);
 
 
// If the point is available, create all the builders and load them into
 
// the array.
 
if (point != null) {
 
IConfigurationElement[] elements = point.getConfigurationElements();
 
builders = new ICompositeItemBuilder[elements.length];
 
for (int i = 0; i < elements.length; i++) {
 
builders[i] = (ICompositeItemBuilder) elements[i]
 
.createExecutableExtension("class");
 
}
 
} else {
 
logger.error("Extension Point " + EXTENSION_ID + "does not exist");
 
}
 
 
return builders;
 
}
}
}
 
\ No newline at end of file
Loading