Commit c95a9fb2 authored by Jay Jay Billings's avatar Jay Jay Billings
Browse files

Reworked the EclipseUIWidgetFactory to use the builder extension.



Refactored the EclipseUIWidgetFactory so that it will pull extensions
from the IFormWidgetBuilder extension point in addition to exposing the
registration operation on its interface. I also cleaned up the OSGi
component files that were hanging around for form builders. I cleaned up
some old HDF5 component files too. I removed unneeded auto-launched
bundles from the product too.
Signed-off-by: default avatarJay Jay Billings <billingsjj@ornl.gov>
parent aa5fd75e
......@@ -48,7 +48,6 @@ Import-Package: com.jme3.math,
Require-Bundle: org.eclipse.ice.client.compatibility;bundle-version="2.0.0",
org.eclipse.ice.datastructures,
org.eclipse.core.runtime;bundle-version="3.11.0"
Service-Component: OSGI-INF/MOOSEEditorComponent.xml
Export-Package: org.eclipse.ice.client.widgets.moose
Bundle-Vendor: Oak Ridge National Laboratory
Bundle-ActivationPolicy: lazy
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.ice.client.widgets.moose">
<implementation class="org.eclipse.ice.client.widgets.moose.MOOSEFormWidgetBuilder"/>
<service>
<provide interface="org.eclipse.ice.client.widgets.IFormWidgetBuilder"/>
</service>
<reference bind="setVizServiceFactory" cardinality="1..1" interface="org.eclipse.ice.viz.service.IVizServiceFactory" name="IVizServiceFactory" policy="dynamic" unbind="unsetVizServiceFactory"/>
</scr:component>
......@@ -4,6 +4,5 @@ bin.includes = META-INF/,\
pom.xml,\
plugin.xml,\
build.properties,\
OSGI-INF/,\
icons/
source.. = src/
......@@ -14,8 +14,7 @@ package org.eclipse.ice.client.widgets;
import java.util.HashMap;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ice.iclient.uiwidgets.IErrorBox;
import org.eclipse.ice.iclient.uiwidgets.IExtraInfoWidget;
import org.eclipse.ice.iclient.uiwidgets.IFormWidget;
......@@ -61,7 +60,18 @@ public class EclipseUIWidgetFactory implements IWidgetFactory {
* The constructor
*/
public EclipseUIWidgetFactory() {
// Create the map to hold the builders
widgetBuildersMap = new HashMap<String, IFormWidgetBuilder>();
// Register the builders if possible
try {
for (IFormWidgetBuilder builder : IFormWidgetBuilder
.getFormWidgetBuilders()) {
registerFormWidgetBuilder(builder);
}
} catch (CoreException e) {
// Complain
logger.error("Unable to register builder!", e);
}
}
/**
......@@ -82,16 +92,6 @@ public class EclipseUIWidgetFactory implements IWidgetFactory {
+ builder.getTargetFormName());
}
IConfigurationElement[] elements = Platform.getExtensionRegistry()
.getConfigurationElementsFor(
"org.eclipse.ice.client.widgets.iformwidgetbuilder");
logger.info(
"Available configuration elements(in org.eclipse.ice.client.widgets.EclipseUIWdigetFactory.java):");
for (IConfigurationElement element : elements) {
logger.info(
element.getNamespaceIdentifier() + " " + element.getName());
}
return;
}
......
......@@ -61,7 +61,6 @@ public interface IFormWidgetBuilder {
*/
public IFormWidget build();
/**
* This operation retrieves all of the IFormWidgetBuilders from the
* ExtensionRegistry.
......@@ -70,15 +69,16 @@ public interface IFormWidgetBuilder {
* @throws CoreException
* This exception is thrown if an extension cannot be loaded.
*/
public static IFormWidgetBuilder[] getFormWidgetBuilders() throws CoreException {
public static IFormWidgetBuilder[] getFormWidgetBuilders()
throws CoreException {
/**
* Logger for handling event messages and other information.
*/
Logger logger = LoggerFactory.getLogger(IFormWidgetBuilder.class);
IFormWidgetBuilder [] builders = null;
String id = "org.eclipse.ice.item.itemBuilder";
IFormWidgetBuilder[] builders = null;
String id = "org.eclipse.ice.client.widgets.iformwidgetbuilder";
IExtensionPoint point = Platform.getExtensionRegistry()
.getExtensionPoint(id);
......
......@@ -7,8 +7,7 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ClassPath: .
Require-Bundle: org.eclipse.ice.datastructures,
org.eclipse.ice.dependencies;bundle-version="2.0.0";visibility:=reexport
Service-Component: OSGI-INF/HdfIORegistry.xml,OSGI-INF/HdfIOFactory.xml,
OSGI-INF/ioservice.xml
Service-Component: OSGI-INF/ioservice.xml
Comment: Service-Component: OSGI-INF/ICEDatabaseHarness.xml
Export-Package: org.eclipse.ice.io.csv,
org.eclipse.ice.io.ini,
......@@ -18,6 +17,3 @@ Bundle-Vendor: Oak Ridge National Laboratory
Import-Package: org.eclipse.core.resources,
org.eclipse.core.runtime,
org.slf4j
Bundle-NativeCode: deps/lib/linux/x86_64/libhdf.a; deps/lib/linux/x86_64/libhdf5.a; deps/lib/linux/x86_64/libjhdf.so; deps/lib/linux/x86_64/libjhdf.so.2.10.0; deps/lib/linux/x86_64/libjhdf5.so; deps/lib/linux/x86_64/libjhdf5.so.2.10.0;
processor=x86_64; osname=linux,
*
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.ice.io.hdf.HdfIOFactory">
<implementation class="org.eclipse.ice.io.hdf.HdfIOFactory"/>
<reference bind="setHdfIORegistry" cardinality="1..1" interface="org.eclipse.ice.io.hdf.IHdfIORegistry" name="IHdfIORegistry" policy="dynamic" unbind="unsetHdfIORegistry"/>
</scr:component>
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.ice.io.hdf.HdfIORegistry">
<implementation class="org.eclipse.ice.io.hdf.HdfIORegistry"/>
<service>
<provide interface="org.eclipse.ice.io.hdf.IHdfIORegistry"/>
</service>
<reference bind="registerHdfIOFactory" cardinality="1..n" interface="org.eclipse.ice.io.hdf.IHdfIOFactory" name="IHdfIOFactory" policy="dynamic"/>
</scr:component>
......@@ -4,8 +4,6 @@ bin.includes = META-INF/,\
README,\
schema/,\
OSGI-INF/,\
OSGI-INF/HdfIORegistry.xml,\
OSGI-INF/HdfIOFactory.xml,\
OSGI-INF/ioservice.xml,\
plugin.xml
src.includes = src/,\
......
......@@ -11,7 +11,6 @@ Require-Bundle: org.eclipse.ice.datastructures,
org.eclipse.core.resources;bundle-version="3.10.0",
org.eclipse.core.runtime;bundle-version="3.11.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Service-Component: OSGI-INF/ReflectivityModelComponent.xml
Import-Package: org.eclipse.core.runtime;version="3.5.0",
org.eclipse.ice.client.widgets,
org.eclipse.ice.iclient.uiwidgets,
......
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.ice.reflectivity.ui">
<implementation class="org.eclipse.ice.reflectivity.ui.ReflectivityFormWidgetBuilder"/>
<service>
<provide interface="org.eclipse.ice.client.widgets.IFormWidgetBuilder"/>
</service>
<reference bind="setVizServiceFactory" cardinality="1..1" interface="org.eclipse.ice.viz.service.IVizServiceFactory" name="IVizServiceFactory" policy="dynamic" unbind="unsetVizServiceFactory"/>
</scr:component>
output.. = bin/
bin.includes = META-INF/,\
.,\
OSGI-INF/,\
build.properties,\
plugin.xml
source.. = src/
......@@ -270,7 +270,6 @@ Java and all Java-based trademarks are trademarks of Oracle Corporation in the U
<plugin id="org.eclipse.ice.caebat.batml" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.client.rcp" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.client.widgets" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.client.widgets.moose" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.client.widgets.rcp" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.datastructures" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.dependencies" autoStart="true" startLevel="0" />
......@@ -285,7 +284,6 @@ Java and all Java-based trademarks are trademarks of Oracle Corporation in the U
<plugin id="org.eclipse.ice.proteus" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.reactor.plant" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.reflectivity" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.reflectivity.ui" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.vibe" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.viz" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.viz.service" autoStart="true" startLevel="0" />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment