Commit 523c1c65 authored by Jay Jay Billings's avatar Jay Jay Billings
Browse files

Updated the way the Client gets the IWidgetFactory.



I updated the Client so that it retrieves the IWidgetFactory using a
static interface method that accesses the Extension Registry. I have
removed several unused components too and made minor adjustments to
other files as required, such as removing files from build.properties. I
fixed a bug in the build that would miss test files that ended in
Test.java instead of Tester.java. I also added an existence test for
IWidgetFactory.getWidgetFactories().
Signed-off-by: default avatarJay Jay Billings <billingsjj@ornl.gov>
parent 7a636d09
/*******************************************************************************
* Copyright (c) 2012, 2014 UT-Battelle, LLC.
* 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
*
* Contributors:
* Initial API and implementation and/or initial documentation - Menghan Li
*******************************************************************************/
package org.eclipse.ice.client.test;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ice.iclient.uiwidgets.IWidgetFactory;
import org.junit.Test;
/**
* This class tests the static interface operation
* IWidgetFactory.getWidgetFactories().
*
* @author Jay Jay Billings
*
*/
public class IWidgetFactoryTester {
/**
* Test for {@link org.eclipse.ice.client.uiwidgets.IWidgetFactory}.
*
* @throws CoreException
*/
@Test
public void test() throws CoreException {
// Simply get the factories from the registry and make sure they are
// actually there.
IWidgetFactory[] factories = IWidgetFactory.getIWidgetFactories();
assertNotNull(factories);
assertTrue(factories.length > 0);
return;
}
}
...@@ -54,6 +54,5 @@ Import-Package: com.jme3.app, ...@@ -54,6 +54,5 @@ Import-Package: com.jme3.app,
Export-Package: org.eclipse.ice.client.widgets, Export-Package: org.eclipse.ice.client.widgets,
org.eclipse.ice.client.widgets.analysis, org.eclipse.ice.client.widgets.analysis,
org.eclipse.ice.client.widgets.grid org.eclipse.ice.client.widgets.grid
Service-Component: OSGI-INF/eclipseWidgetsComponent.xml, Service-Component: OSGI-INF/formEditorVizService.xml
OSGI-INF/formEditorVizService.xml
Bundle-Vendor: Oak Ridge National Laboratory Bundle-Vendor: Oak Ridge National Laboratory
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="false" name="org.eclipse.ice.client.widgets">
<implementation class="org.eclipse.ice.client.widgets.EclipseUIWidgetFactory"/>
<reference bind="registerFormWidgetBuilder" cardinality="0..n" interface="org.eclipse.ice.client.widgets.IFormWidgetBuilder" name="IFormWidgetBuilder" policy="dynamic"/>
<service>
<provide interface="org.eclipse.ice.iclient.uiwidgets.IWidgetFactory"/>
</service>
</scr:component>
...@@ -9,12 +9,7 @@ bin.includes = META-INF/,\ ...@@ -9,12 +9,7 @@ bin.includes = META-INF/,\
icons/,\ icons/,\
OSGI-INF/formEditorVizService.xml,\ OSGI-INF/formEditorVizService.xml,\
plugin_customization.ini plugin_customization.ini
src.includes = OSGI-INF/,\ src.includes = pom.xml,\
META-INF/,\
build.properties,\
plugin.xml,\
pom.xml,\
src/,\
icons/ icons/
source.. = src/ source.. = src/
additional.bundles = org.eclipse.core.resources,\ additional.bundles = org.eclipse.core.resources,\
......
...@@ -359,7 +359,7 @@ ...@@ -359,7 +359,7 @@
<extension <extension
id="eclipsewidgetfactory" id="eclipsewidgetfactory"
name="Eclipse UI Widget Factory" name="Eclipse UI Widget Factory"
point="org.eclipse.ice.client.iwidgetfactory"> point="org.eclipse.ice.client.IWidgetFactory">
<iwidgetfactory <iwidgetfactory
class="org.eclipse.ice.client.widgets.EclipseUIWidgetFactory"> class="org.eclipse.ice.client.widgets.EclipseUIWidgetFactory">
</iwidgetfactory> </iwidgetfactory>
......
...@@ -36,6 +36,7 @@ import org.slf4j.LoggerFactory; ...@@ -36,6 +36,7 @@ import org.slf4j.LoggerFactory;
* @author Jay Jay Billings * @author Jay Jay Billings
*/ */
public interface IFormWidgetBuilder { public interface IFormWidgetBuilder {
/** /**
* <p> * <p>
* This operation returns the name of the target Form that the Builder will * This operation returns the name of the target Form that the Builder will
......
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" enabled="true" immediate="false" name="org.eclipse.ice.client">
<implementation class="org.eclipse.ice.client.internal.Client"/>
<reference cardinality="1..1" interface="org.eclipse.ice.iclient.uiwidgets.IWidgetFactory" name="IWidgetFactory" policy="static"/>
</scr:component>
...@@ -2,7 +2,6 @@ source.. = src/ ...@@ -2,7 +2,6 @@ source.. = src/
output.. = bin/ output.. = bin/
bin.includes = META-INF/,\ bin.includes = META-INF/,\
.,\ .,\
OSGI-INF/,\
build.properties,\ build.properties,\
pom.xml,\ pom.xml,\
schema/,\ schema/,\
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<?eclipse version="3.4"?> <?eclipse version="3.4"?>
<plugin> <plugin>
<extension-point id="clientInstance" name="ICE Client" schema="schema/clientInstance.exsd"/> <extension-point id="clientInstance" name="ICE Client" schema="schema/clientInstance.exsd"/>
<extension-point id="iwidgetfactory" name="Widget Factory" schema="schema/iwidgetfactory.exsd"/> <extension-point id="IWidgetFactory" name="Widget Factory" schema="schema/iwidgetfactory.exsd"/>
<extension-point id="updateEventListener" name="IUpdateEventListener" schema="schema/updateEventListener.exsd"/> <extension-point id="updateEventListener" name="IUpdateEventListener" schema="schema/updateEventListener.exsd"/>
<extension-point id="processEventListener" name="IProcessEventListener" schema="schema/processEventListener.exsd"/> <extension-point id="processEventListener" name="IProcessEventListener" schema="schema/processEventListener.exsd"/>
<extension-point id="simpleResourceProvider" name="ISimpleResourceProvider" schema="schema/simpleResourceProvider.exsd"/> <extension-point id="simpleResourceProvider" name="ISimpleResourceProvider" schema="schema/simpleResourceProvider.exsd"/>
......
...@@ -37,7 +37,6 @@ import org.eclipse.ice.iclient.uiwidgets.ITextEditor; ...@@ -37,7 +37,6 @@ import org.eclipse.ice.iclient.uiwidgets.ITextEditor;
import org.eclipse.ice.iclient.uiwidgets.IUpdateEventListener; import org.eclipse.ice.iclient.uiwidgets.IUpdateEventListener;
import org.eclipse.ice.iclient.uiwidgets.IWidgetClosedListener; import org.eclipse.ice.iclient.uiwidgets.IWidgetClosedListener;
import org.eclipse.ice.iclient.uiwidgets.IWidgetFactory; import org.eclipse.ice.iclient.uiwidgets.IWidgetFactory;
import org.eclipse.ui.PlatformUI;
import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext; import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference; import org.osgi.framework.ServiceReference;
...@@ -60,8 +59,9 @@ import org.slf4j.LoggerFactory; ...@@ -60,8 +59,9 @@ import org.slf4j.LoggerFactory;
* *
* @author Jay Jay Billings * @author Jay Jay Billings
*/ */
public class Client implements IUpdateEventListener, IProcessEventListener, ISimpleResourceProvider, public class Client implements IUpdateEventListener, IProcessEventListener,
IWidgetClosedListener, IClient, BundleActivator { ISimpleResourceProvider, IWidgetClosedListener, IClient,
BundleActivator {
/** /**
* Logger for handling event messages and other information. * Logger for handling event messages and other information.
...@@ -165,13 +165,15 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim ...@@ -165,13 +165,15 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim
// posted to the IFormWidget based on the status of the process. // posted to the IFormWidget based on the status of the process.
statusMessageMap.put(FormStatus.Processed, "Done!"); statusMessageMap.put(FormStatus.Processed, "Done!");
statusMessageMap.put(FormStatus.Processing, "Processing Form..."); statusMessageMap.put(FormStatus.Processing, "Processing Form...");
statusMessageMap.put(FormStatus.InfoError, "The Form contains an error" + " and cannot be processed."); statusMessageMap.put(FormStatus.InfoError,
"The Form contains an error" + " and cannot be processed.");
statusMessageMap.put(FormStatus.ReadyToProcess, "Ready to process."); statusMessageMap.put(FormStatus.ReadyToProcess, "Ready to process.");
statusMessageMap.put(FormStatus.NeedsInfo, statusMessageMap.put(FormStatus.NeedsInfo,
"The Form requires additional information before " + "it can be processed."); "The Form requires additional information before "
+ "it can be processed.");
statusMessageMap.put(FormStatus.InReview, "In review..."); statusMessageMap.put(FormStatus.InReview, "In review...");
statusMessageMap.put(FormStatus.Unacceptable, statusMessageMap.put(FormStatus.Unacceptable, "This Form will not be "
"This Form will not be " + "processed or updated. It should be considered read-only."); + "processed or updated. It should be considered read-only.");
// Set the reference to this in the Singleton for the widget classes to // Set the reference to this in the Singleton for the widget classes to
// retrieve as needed. // retrieve as needed.
...@@ -202,11 +204,10 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim ...@@ -202,11 +204,10 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim
logger.error("Unable to access core!."); logger.error("Unable to access core!.");
} }
// Get the widgets factory service by using the Workbench. This is a // Get the widgets factory service by using the static inferace method
// good way to do it that prevents the ResourcesPlugin from being called // and directly registering it. At the moment we have only a single
// prematurely. // factory, so we will grab the 0-th entry.
IWidgetFactory factory = PlatformUI.getWorkbench().getService(IWidgetFactory.class); setUIWidgetFactory(IWidgetFactory.getIWidgetFactories()[0]);
setUIWidgetFactory(factory);
// I realize how hilarious it is to use two different mechanisms for // I realize how hilarious it is to use two different mechanisms for
// acquiring services here. FIXME! This is just testing for now. // acquiring services here. FIXME! This is just testing for now.
...@@ -288,7 +289,8 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim ...@@ -288,7 +289,8 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim
processorThread.start(); processorThread.start();
} else { } else {
// Otherwise notify the use that the Item is invalid // Otherwise notify the use that the Item is invalid
throwSimpleError("IClient Message: " + "Item has no parent widget in this client."); throwSimpleError("IClient Message: "
+ "Item has no parent widget in this client.");
} }
} }
...@@ -360,7 +362,8 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim ...@@ -360,7 +362,8 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim
if (itemId > 0) {// FIXME Status check! if (itemId > 0) {// FIXME Status check!
loadItem(itemId); loadItem(itemId);
} else if (itemId <= 0) { } else if (itemId <= 0) {
throwSimpleError("Unable to load Item " + itemType + " after creating it."); throwSimpleError(
"Unable to load Item " + itemType + " after creating it.");
} }
} }
...@@ -377,7 +380,8 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim ...@@ -377,7 +380,8 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim
if (iWidgetFactory != null) { if (iWidgetFactory != null) {
logger.info("IClient Message: Widget Factory set!"); logger.info("IClient Message: Widget Factory set!");
} else { } else {
logger.info("IClient Message: " + "Widget Factory set, but is null."); logger.info(
"IClient Message: " + "Widget Factory set, but is null.");
} }
return; return;
} }
...@@ -406,19 +410,23 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim ...@@ -406,19 +410,23 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim
formWidget.display(); formWidget.display();
// Set the initial status of the Form // Set the initial status of the Form
formStatus = getCore().getItemStatus(itemId); formStatus = getCore().getItemStatus(itemId);
formWidget.updateStatus(statusMessageMap.get(iCore.getItemStatus(itemId))); formWidget.updateStatus(
statusMessageMap.get(iCore.getItemStatus(itemId)));
// If the FormStatus signifies that the Form is absolutely // If the FormStatus signifies that the Form is absolutely
// unacceptable, then the user should be warned. // unacceptable, then the user should be warned.
if (formStatus.equals(FormStatus.Unacceptable)) { if (formStatus.equals(FormStatus.Unacceptable)) {
formWidget.disable(true); formWidget.disable(true);
throwSimpleError("This Form has been set to a read-only mode by " throwSimpleError(
+ "ICE. Please be advised that it can not be upated" + " or processed."); "This Form has been set to a read-only mode by "
+ "ICE. Please be advised that it can not be upated"
+ " or processed.");
} }
// Register for updates // Register for updates
formWidget.registerUpdateListener(this); formWidget.registerUpdateListener(this);
formWidget.registerProcessListener(this); formWidget.registerProcessListener(this);
formWidget.registerResourceProvider(this); formWidget.registerResourceProvider(this);
logger.info("IClient Message: Loaded Item " + itemId + ", " + form.getName()); logger.info("IClient Message: Loaded Item " + itemId + ", "
+ form.getName());
// Store the widget in the table of FormWidgets // Store the widget in the table of FormWidgets
formWidgetTable.put(itemId, formWidget); formWidgetTable.put(itemId, formWidget);
} else { } else {
...@@ -504,12 +512,14 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim ...@@ -504,12 +512,14 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim
} }
// Process the item // Process the item
if (itemForm != null) { if (itemForm != null) {
logger.info("IClient Message: Processing Item " + itemId + ", " + itemForm.getName()); logger.info("IClient Message: Processing Item " + itemId + ", "
+ itemForm.getName());
processItem(formWidgetTable.get(itemId), actionName); processItem(formWidgetTable.get(itemId), actionName);
} }
} else if (itemId < 0 || itemForm == null) { } else if (itemId < 0 || itemForm == null) {
// Otherwise notify the use that the Item is invalid // Otherwise notify the use that the Item is invalid
throwSimpleError("The Item id is invalid. " + "Please double check it and try again " throwSimpleError("The Item id is invalid. "
+ "Please double check it and try again "
+ "or notify your systems administrator."); + "or notify your systems administrator.");
} }
return; return;
...@@ -592,22 +602,26 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim ...@@ -592,22 +602,26 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim
// Update the Form if needed, skip FormStatus.InReview for now. // Update the Form if needed, skip FormStatus.InReview for now.
// FIXME! - need FormStatus.InReview // FIXME! - need FormStatus.InReview
if (!status.equals(FormStatus.InfoError) && !status.equals(FormStatus.Unacceptable)) { if (!status.equals(FormStatus.InfoError)
&& !status.equals(FormStatus.Unacceptable)) {
form = getCore().getItem(formId); form = getCore().getItem(formId);
// Update the status of the Item update // Update the status of the Item update
if (formWidgetTable.containsKey(form.getItemID())) { if (formWidgetTable.containsKey(form.getItemID())) {
String statusMessage = statusMessageMap.get(status); String statusMessage = statusMessageMap.get(status);
formWidgetTable.get(form.getItemID()).updateStatus(statusMessage); formWidgetTable.get(form.getItemID())
.updateStatus(statusMessage);
} }
} else { } else {
// Notify the user that there is some invalid information in the // Notify the user that there is some invalid information in the
// Form // Form
throwSimpleError("Form contains invalid information. " + "Please review it for completeness and " throwSimpleError("Form contains invalid information. "
+ "Please review it for completeness and "
+ "accuracy and resubmit."); + "accuracy and resubmit.");
} }
} else { } else {
// Otherwise let the user know // Otherwise let the user know
throwSimpleError("Fatal Error: " + "Form returned to Client can not be null!"); throwSimpleError("Fatal Error: "
+ "Form returned to Client can not be null!");
} }
return; return;
...@@ -662,7 +676,8 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim ...@@ -662,7 +676,8 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim
// Display the widget // Display the widget
textEditor.display(); textEditor.display();
} else { } else {
throwSimpleError("The resource that you asked to load does not " + "exist or is erroneously linked."); throwSimpleError("The resource that you asked to load does not "
+ "exist or is erroneously linked.");
} }
} }
...@@ -706,7 +721,9 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim ...@@ -706,7 +721,9 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim
/* /*
* (non-Javadoc) * (non-Javadoc)
* @see org.eclipse.ice.iclient.IClient#importFile(java.net.URI, org.eclipse.core.resources.IProject) *
* @see org.eclipse.ice.iclient.IClient#importFile(java.net.URI,
* org.eclipse.core.resources.IProject)
*/ */
@Override @Override
public void importFile(URI file, IProject project) { public void importFile(URI file, IProject project) {
...@@ -717,7 +734,9 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim ...@@ -717,7 +734,9 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim
/* /*
* (non-Javadoc) * (non-Javadoc)
* @see org.eclipse.ice.iclient.IClient#importFile(java.net.URI, java.lang.String) *
* @see org.eclipse.ice.iclient.IClient#importFile(java.net.URI,
* java.lang.String)
*/ */
@Override @Override
public void importFile(URI file, String projectName) { public void importFile(URI file, String projectName) {
...@@ -738,20 +757,25 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim ...@@ -738,20 +757,25 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim
return Integer.valueOf(getCore().importFileAsItem(file, itemType)); return Integer.valueOf(getCore().importFileAsItem(file, itemType));
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* @see org.eclipse.ice.iclient.IClient#importFileAsItem(java.net.URI, java.lang.String, org.eclipse.core.resources.IProject) *
* @see org.eclipse.ice.iclient.IClient#importFileAsItem(java.net.URI,
* java.lang.String, org.eclipse.core.resources.IProject)
*/ */
@Override @Override
public int importFileAsItem(URI file, String itemType, IProject project) { public int importFileAsItem(URI file, String itemType, IProject project) {
// Pass the call on to the core // Pass the call on to the core
return Integer.valueOf(getCore().importFileAsItem(file, itemType, project)); return Integer
.valueOf(getCore().importFileAsItem(file, itemType, project));
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* @see org.eclipse.ice.iclient.IClient#importFileAsItem(org.eclipse.core.resources.IFile, java.lang.String) *
* @see org.eclipse.ice.iclient.IClient#importFileAsItem(org.eclipse.core.
* resources.IFile, java.lang.String)
*/ */
@Override @Override
public int importFileAsItem(IFile file, String itemType) { public int importFileAsItem(IFile file, String itemType) {
...@@ -761,16 +785,20 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim ...@@ -761,16 +785,20 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim
/* /*
* (non-Javadoc) * (non-Javadoc)
* @see org.eclipse.ice.iclient.IClient#importFileAsItem(java.net.URI, java.lang.String, java.lang.String) *
* @see org.eclipse.ice.iclient.IClient#importFileAsItem(java.net.URI,
* java.lang.String, java.lang.String)
*/ */
@Override @Override
public int importFileAsItem(URI file, String itemType, String projectName) { public int importFileAsItem(URI file, String itemType, String projectName) {
// Pass the call on to the core // Pass the call on to the core
return Integer.valueOf(getCore().importFileAsItem(file, itemType, projectName)); return Integer.valueOf(
getCore().importFileAsItem(file, itemType, projectName));
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
*
* @see org.eclipse.ice.iclient.IClient#renameItem(int, java.lang.String) * @see org.eclipse.ice.iclient.IClient#renameItem(int, java.lang.String)
*/ */
@Override @Override
...@@ -780,20 +808,24 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim ...@@ -780,20 +808,24 @@ public class Client implements IUpdateEventListener, IProcessEventListener, ISim
/* /*
* (non-Javadoc) * (non-Javadoc)
* @see org.eclipse.ice.iclient.IClient#setFormWidget(org.eclipse.ice.iclient.uiwidgets.IFormWidget) *
* @see
* org.eclipse.ice.iclient.IClient#setFormWidget(org.eclipse.ice.iclient.
* uiwidgets.IFormWidget)
*/ */
@Override @Override
public void addFormWidget(IFormWidget widget) { public void addFormWidget(IFormWidget widget) {
// Add this Form Widget to the formWidgetTable // Add this Form Widget to the formWidgetTable
// so it can be used in Item processing. // so it can be used in Item processing.
formWidgetTable.put(widget.getForm().getItemID(), widget); formWidgetTable.put(widget.getForm().getItemID(), widget);
} }
/** /**
* This operation returns the IFormWidget corresponding to * This operation returns the IFormWidget corresponding to the given Item
* the given Item Id. * Id.
* *
* @param itemId The id of the Item whose IFormWidget has been requested * @param itemId
* The id of the Item whose IFormWidget has been requested
* @return formWidget * @return formWidget
*/ */
public IFormWidget getFormWidget(int itemId) { public IFormWidget getFormWidget(int itemId) {
......
...@@ -12,6 +12,13 @@ ...@@ -12,6 +12,13 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.ice.iclient.uiwidgets; package org.eclipse.ice.iclient.uiwidgets;
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;
/** /**
* for implementations of IClient. It is implemented separately from the client * for implementations of IClient. It is implemented separately from the client
* to separate the code needed for drawing to the screen from the code needed to * to separate the code needed for drawing to the screen from the code needed to
...@@ -21,6 +28,43 @@ package org.eclipse.ice.iclient.uiwidgets; ...@@ -21,6 +28,43 @@ package org.eclipse.ice.iclient.uiwidgets;
* @author Jay Jay Billings * @author Jay Jay Billings
*/ */
public interface IWidgetFactory { public interface IWidgetFactory {
/**
* This operation retrieves all of the IWidgetFactories from the
* ExtensionRegistry.
*
* @return The array of IWidgetFactories that were found in the registry.
* @throws CoreException
* This exception is thrown if an extension cannot be loaded.
*/
public static IWidgetFactory[] getIWidgetFactories() throws CoreException {
/**
* Logger for handling event messages and other information.
*/
Logger logger = LoggerFactory.getLogger(IWidgetFactory.class);
IWidgetFactory[] builders = null;
String id = "org.eclipse.ice.client.IWidgetFactory";
IExtensionPoint point = Platform.getExtensionRegistry()
.getExtensionPoint(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 IWidgetFactory[elements.length];
for (int i = 0; i < elements.length; i++) {
builders[i] = (IWidgetFactory) elements[i]