Commit ffc34a7d authored by Robert Smith's avatar Robert Smith
Browse files

EAVP Editors updated for extension points



The Geometry and Mesh Editors now make use of EAVP extension points
instead of OSGI services.
Signed-off-by: Robert Smith's avatarRobert Smith <smithrw@ornl.gov>
parent 2a6db9ac
......@@ -12,9 +12,11 @@
*******************************************************************************/
package org.eclipse.ice.client.widgets;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
import org.eclipse.eavp.viz.service.IVizCanvas;
import org.eclipse.eavp.viz.service.IVizService;
import org.eclipse.eavp.viz.service.IVizServiceFactory;
import org.eclipse.eavp.viz.service.geometry.widgets.ShapeTreeView;
import org.eclipse.ice.datastructures.ICEObject.IUpdateable;
import org.eclipse.ice.datastructures.ICEObject.IUpdateableListener;
......@@ -193,9 +195,27 @@ public class ICEGeometryPage extends ICEFormPage
.getForm();
Composite parent = pageForm.getBody();
// Get Geometry service from factory
IVizServiceFactory factory = editor.getVizServiceFactory();
service = factory.get("ICE Geometry Editor");
// Get all the extensions for the viz services
IConfigurationElement[] configurationElements = Platform
.getExtensionRegistry().getConfigurationElementsFor(
"org.eclipse.eavp.viz.service.IVizService");
// TODO Provide a better way of choosing a service
// Iterate through the extensions, finding on with "geometry" in the
// bundle
for (IConfigurationElement configurationElement : configurationElements) {
if (configurationElement.getDeclaringExtension()
.getNamespaceIdentifier().contains("geometry")) {
try {
service = (IVizService) configurationElement
.createExecutableExtension("class");
} catch (CoreException e) {
logger.error(
"Problem creating IVizService from geometry extension point.");
}
}
}
geometryComp.setService(service);
// Create and draw geometry canvas
......
......@@ -15,9 +15,11 @@ package org.eclipse.ice.client.widgets;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Platform;
import org.eclipse.eavp.viz.service.IVizService;
import org.eclipse.eavp.viz.service.IVizServiceFactory;
import org.eclipse.eavp.viz.service.mesh.datastructures.IMeshVizCanvas;
import org.eclipse.ice.client.common.ActionTree;
import org.eclipse.ice.datastructures.ICEObject.ICEObject;
......@@ -226,9 +228,28 @@ public class ICEMeshPage extends ICEFormPage
new GridData(SWT.FILL, SWT.BEGINNING, true, false));
actionToolBarManager = new ToolBarManager(toolBar);
// Get JME3 Geometry service from factory
IVizServiceFactory factory = editor.getVizServiceFactory();
IVizService service = factory.get("ICE JavaFX Mesh Editor");
// Get all the extensions for the viz services
IConfigurationElement[] configurationElements = Platform
.getExtensionRegistry().getConfigurationElementsFor(
"org.eclipse.eavp.viz.service.IVizService");
// The service that will provide the canvas
IVizService service = null;
// TODO Provide a better way of choosing a service
// Iterate through the extensions, finding on with "mesh" in the bundle
for (IConfigurationElement ice : configurationElements) {
if (ice.getDeclaringExtension().getNamespaceIdentifier()
.contains("mesh")) {
try {
service = (IVizService) ice
.createExecutableExtension("class");
} catch (CoreException e) {
logger.error(
"Problem creating IVizService from mesh extension point.");
}
}
}
meshComp.setService(service);
// Create and draw geometry canvas
......
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