Commit 88b77fcf authored by Jay Jay Billings's avatar Jay Jay Billings
Browse files

Finished adding e4 injection support for default page providers.


Signed-off-by: default avatarJay Jay Billings <billingsjj@ornl.gov>
parent e8890149
......@@ -13,6 +13,7 @@ Require-Bundle: org.eclipse.ice.datastructures,
org.eclipse.remote.ui;bundle-version="2.0.0",
org.eclipse.swt
Import-Package:
com.sun.jersey.api.client;version="1.17.0",
org.apache.commons.io,
org.apache.log4j.spi;version="1.2.15",
org.eclipse.core.commands.common,
......@@ -25,6 +26,10 @@ Import-Package:
org.eclipse.draw2d.geometry,
org.eclipse.e4.core.contexts,
org.eclipse.e4.core.di,
org.eclipse.e4.core.di.annotations,
org.eclipse.e4.ui.model,
org.eclipse.e4.ui.model.application,
org.eclipse.e4.ui.model.application.ui,
org.eclipse.eavp.viz.service,
org.eclipse.eavp.viz.service.csv,
org.eclipse.eavp.viz.service.datastructures,
......@@ -53,6 +58,8 @@ Import-Package:
org.slf4j;version="1.7.2"
Export-Package: org.eclipse.ice.client.widgets,
org.eclipse.ice.client.widgets.analysis,
org.eclipse.ice.client.widgets.grid
Service-Component: OSGI-INF/formEditorVizService.xml
org.eclipse.ice.client.widgets.grid,
org.eclipse.ice.client.widgets.providers,
org.eclipse.ice.client.widgets.providers.Default
Service-Component: OSGI-INF/*.xml
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.providers.default">
<implementation class="org.eclipse.ice.client.widgets.providers.Default.DefaultPageFactoryContextFunction"/>
<property name="service.context.key" type="String" value="ice-default"/>
<service>
<provide interface="org.eclipse.e4.core.contexts.IContextFunction"/>
</service>
</scr:component>
......@@ -391,7 +391,7 @@
name="Default Error Page Provider"
point="org.eclipse.ice.client.widgets.errorPageProvider">
<implementation
class="org.eclipse.ice.client.widgets.providers.DefaultErrorPageProvider">
class="org.eclipse.ice.client.widgets.providers.Default.DefaultErrorPageProvider">
</implementation>
</extension>
<extension
......@@ -399,7 +399,7 @@
name="Default List Page Provider"
point="org.eclipse.ice.client.widgets.listPageProvider">
<implementation
class="org.eclipse.ice.client.widgets.providers.DefaultListPageProvider">
class="org.eclipse.ice.client.widgets.providers.Default.DefaultListPageProvider">
</implementation>
</extension>
<extension
......@@ -408,7 +408,7 @@
point="org.eclipse.ice.client.widgets.resourcePageProvider">
<Implementation
Class="org.eclipse.ice.client.widgets.providers.DefaultResourcePageProvider"
class="org.eclipse.ice.client.widgets.providers.DefaultResourcePageProvider">
class="org.eclipse.ice.client.widgets.providers.Default.DefaultResourcePageProvider">
</Implementation>
</extension>
<extension
......@@ -416,7 +416,7 @@
name="Basic Components Page Provider"
point="org.eclipse.ice.client.widgets.basicComponentPageProvider">
<implementation
class="org.eclipse.ice.client.widgets.providers.DefaultBasicComponentPageProvider">
class="org.eclipse.ice.client.widgets.providers.Default.DefaultBasicComponentPageProvider">
</implementation>
</extension>
<extension
......@@ -424,7 +424,7 @@
name="Geometry Page Provider"
point="org.eclipse.ice.client.widgets.geometryPageProvider">
<client
class="org.eclipse.ice.client.widgets.providers.DefaultGeometryPageProvider">
class="org.eclipse.ice.client.widgets.providers.Default.DefaultGeometryPageProvider">
</client>
</extension>
<extension
......@@ -432,7 +432,7 @@
name="EMF Section Page Provider"
point="org.eclipse.ice.client.widgets.IEMFSectionPageProvider">
<client
class="org.eclipse.ice.client.widgets.providers.DefaultIEMFSectionPageProvider">
class="org.eclipse.ice.client.widgets.providers.Default.DefaultIEMFSectionPageProvider">
</client>
</extension>
<extension
......@@ -440,7 +440,7 @@
name="Mesh Page Provider"
point="org.eclipse.ice.client.widgets.meshPageProvider">
<client
class="org.eclipse.ice.client.widgets.providers.DefaultMeshPageProvider">
class="org.eclipse.ice.client.widgets.providers.Default.DefaultMeshPageProvider">
</client>
</extension>
<extension
......@@ -448,7 +448,7 @@
name="Master Details Page Provider"
point="org.eclipse.ice.client.widgets.masterDetailsPageProvider">
<Implementation
class="org.eclipse.ice.client.widgets.providers.DefaultMasterDetailsPageProvider">
class="org.eclipse.ice.client.widgets.providers.Default.DefaultMasterDetailsPageProvider">
</Implementation>
</extension>
</plugin>
......@@ -20,8 +20,8 @@ import java.util.SortedMap;
import java.util.TreeMap;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ice.client.widgets.providers.DefaultEntryCompositeProvider;
import org.eclipse.ice.client.widgets.providers.IEntryCompositeProvider;
import org.eclipse.ice.client.widgets.providers.Default.DefaultEntryCompositeProvider;
import org.eclipse.ice.datastructures.ICEObject.IUpdateable;
import org.eclipse.ice.datastructures.ICEObject.IUpdateableListener;
import org.eclipse.ice.datastructures.entry.IEntry;
......
......@@ -15,8 +15,8 @@ package org.eclipse.ice.client.widgets;
import java.util.ArrayList;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ice.client.widgets.providers.DefaultEntryCompositeProvider;
import org.eclipse.ice.client.widgets.providers.IEntryCompositeProvider;
import org.eclipse.ice.client.widgets.providers.Default.DefaultEntryCompositeProvider;
import org.eclipse.ice.datastructures.entry.IEntry;
import org.eclipse.ice.datastructures.form.DataComponent;
import org.eclipse.jface.viewers.ISelection;
......
......@@ -24,7 +24,7 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.eavp.viz.service.IVizServiceFactory;
import org.eclipse.ice.client.widgets.providers.DefaultPageFactory;
import org.eclipse.ice.client.widgets.providers.IPageFactory;
import org.eclipse.ice.datastructures.ICEObject.Component;
import org.eclipse.ice.datastructures.ICEObject.IUpdateable;
import org.eclipse.ice.datastructures.ICEObject.IUpdateableListener;
......@@ -844,7 +844,8 @@ public class ICEFormEditor extends SharedHeaderFormEditor
ArrayList<IFormPage> formPages = new ArrayList<IFormPage>();
// Just allocate it directly for now!
DefaultPageFactory factory = new DefaultPageFactory();
IPageFactory factory = (IPageFactory) e4Context
.get(iceDataForm.getContext());
// Load data pages if they are available.
if (!iceDataForm.getComponents().isEmpty()) {
......@@ -865,6 +866,7 @@ public class ICEFormEditor extends SharedHeaderFormEditor
comps.addAll(componentMap.get("data"));
comps.addAll(componentMap.get("table"));
comps.addAll(componentMap.get("matrix"));
// ArrayList<IFormPage> pages = ;
formPages.addAll(factory.getBasicComponentPages(this, comps));
}
......
......@@ -9,11 +9,12 @@
* Initial API and implementation and/or initial documentation -
* Jay Jay Billings, Nick Stanish
*******************************************************************************/
package org.eclipse.ice.client.widgets.providers;
package org.eclipse.ice.client.widgets.providers.Default;
import java.util.ArrayList;
import org.eclipse.ice.client.widgets.ICESectionPage;
import org.eclipse.ice.client.widgets.providers.IBasicComponentPageProvider;
import org.eclipse.ice.datastructures.ICEObject.Component;
import org.eclipse.ice.datastructures.ICEObject.ICEObject;
import org.eclipse.ui.forms.editor.FormEditor;
......
......@@ -9,13 +9,14 @@
* Initial API and implementation and/or initial documentation -
* Alex McCaskey
*******************************************************************************/
package org.eclipse.ice.client.widgets.providers;
package org.eclipse.ice.client.widgets.providers.Default;
import org.eclipse.ice.client.widgets.DiscreteEntryComposite;
import org.eclipse.ice.client.widgets.ExecutableEntryComposite;
import org.eclipse.ice.client.widgets.FileEntryComposite;
import org.eclipse.ice.client.widgets.IEntryComposite;
import org.eclipse.ice.client.widgets.StringEntryComposite;
import org.eclipse.ice.client.widgets.providers.IEntryCompositeProvider;
import org.eclipse.ice.datastructures.entry.ContinuousEntry;
import org.eclipse.ice.datastructures.entry.DiscreteEntry;
import org.eclipse.ice.datastructures.entry.ExecutableEntry;
......
......@@ -10,11 +10,12 @@
* Nick Stanish, Jay Jay Billings
*******************************************************************************/
package org.eclipse.ice.client.widgets.providers;
package org.eclipse.ice.client.widgets.providers.Default;
import java.util.ArrayList;
import org.eclipse.ice.client.widgets.ErrorMessageFormPage;
import org.eclipse.ice.client.widgets.providers.IErrorPageProvider;
import org.eclipse.ice.datastructures.ICEObject.Component;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.IFormPage;
......
......@@ -11,11 +11,12 @@
* Minor updates for architecture compliance, original implementation -
* Jay Jay Billings
*******************************************************************************/
package org.eclipse.ice.client.widgets.providers;
package org.eclipse.ice.client.widgets.providers.Default;
import java.util.ArrayList;
import org.eclipse.ice.client.widgets.ICEGeometryPage;
import org.eclipse.ice.client.widgets.providers.IGeometryPageProvider;
import org.eclipse.ice.datastructures.ICEObject.Component;
import org.eclipse.ice.datastructures.form.GeometryComponent;
import org.eclipse.ui.forms.editor.FormEditor;
......
......@@ -11,11 +11,12 @@
* Minor updates for architecture compliance, original implementation -
* Jay Jay Billings
*******************************************************************************/
package org.eclipse.ice.client.widgets.providers;
package org.eclipse.ice.client.widgets.providers.Default;
import java.util.ArrayList;
import org.eclipse.ice.client.widgets.EMFSectionPage;
import org.eclipse.ice.client.widgets.providers.IEMFSectionPageProvider;
import org.eclipse.ice.datastructures.ICEObject.Component;
import org.eclipse.ice.datastructures.form.emf.EMFComponent;
import org.eclipse.ui.forms.editor.FormEditor;
......
......@@ -12,11 +12,12 @@
* Jay Jay Billings
*******************************************************************************/
package org.eclipse.ice.client.widgets.providers;
package org.eclipse.ice.client.widgets.providers.Default;
import java.util.ArrayList;
import org.eclipse.ice.client.widgets.ListComponentSectionPage;
import org.eclipse.ice.client.widgets.providers.IListPageProvider;
import org.eclipse.ice.datastructures.ICEObject.Component;
import org.eclipse.ice.datastructures.ICEObject.ListComponent;
import org.eclipse.ui.forms.editor.FormEditor;
......
......@@ -11,11 +11,12 @@
*
*******************************************************************************/
package org.eclipse.ice.client.widgets.providers;
package org.eclipse.ice.client.widgets.providers.Default;
import java.util.ArrayList;
import org.eclipse.ice.client.widgets.ICEFormPage;
import org.eclipse.ice.client.widgets.ICEMasterDetailsPage;
import org.eclipse.ice.client.widgets.providers.IMasterDetailsPageProvider;
import org.eclipse.ice.datastructures.ICEObject.Component;
import org.eclipse.ice.datastructures.form.MasterDetailsComponent;
import org.eclipse.ui.forms.editor.FormEditor;
......
......@@ -11,11 +11,12 @@
* Minor updates for architecture compliance, original implementation -
* Jay Jay Billings
*******************************************************************************/
package org.eclipse.ice.client.widgets.providers;
package org.eclipse.ice.client.widgets.providers.Default;
import java.util.ArrayList;
import org.eclipse.ice.client.widgets.ICEMeshPage;
import org.eclipse.ice.client.widgets.providers.IMeshPageProvider;
import org.eclipse.ice.datastructures.ICEObject.Component;
import org.eclipse.ice.datastructures.form.MeshComponent;
import org.eclipse.ui.forms.editor.FormEditor;
......
......@@ -9,11 +9,20 @@
* Initial API and implementation and/or initial documentation -
* Jay Jay Billings
*******************************************************************************/
package org.eclipse.ice.client.widgets.providers;
package org.eclipse.ice.client.widgets.providers.Default;
import java.util.ArrayList;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ice.client.widgets.providers.IBasicComponentPageProvider;
import org.eclipse.ice.client.widgets.providers.IEMFSectionPageProvider;
import org.eclipse.ice.client.widgets.providers.IErrorPageProvider;
import org.eclipse.ice.client.widgets.providers.IGeometryPageProvider;
import org.eclipse.ice.client.widgets.providers.IListPageProvider;
import org.eclipse.ice.client.widgets.providers.IMasterDetailsPageProvider;
import org.eclipse.ice.client.widgets.providers.IMeshPageProvider;
import org.eclipse.ice.client.widgets.providers.IPageFactory;
import org.eclipse.ice.client.widgets.providers.IResourcePageProvider;
import org.eclipse.ice.datastructures.ICEObject.Component;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.IFormPage;
......
package org.eclipse.ice.client.widgets.providers.Default;
import org.eclipse.e4.core.contexts.ContextFunction;
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.ice.client.widgets.providers.IPageFactory;
public class DefaultPageFactoryContextFunction extends ContextFunction {
@Override
public Object compute(IEclipseContext context, String contextKey) {
IPageFactory factory = ContextInjectionFactory
.make(DefaultPageFactory.class, context);
// add the new object to the application context
MApplication application = context.get(MApplication.class);
IEclipseContext ctx = application.getContext();
ctx.set(IPageFactory.class, factory);
return factory;
}
}
......@@ -9,11 +9,12 @@
* Initial API and implementation and/or initial documentation -
* Jay Jay Billings
*******************************************************************************/
package org.eclipse.ice.client.widgets.providers;
package org.eclipse.ice.client.widgets.providers.Default;
import java.util.ArrayList;
import java.util.Map;
import org.eclipse.ice.client.widgets.providers.IPageProvider;
import org.eclipse.ice.datastructures.ICEObject.Component;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.IFormPage;
......
......@@ -10,11 +10,12 @@
* Minor updates for architecture compliance, original implementation -
* Jay Jay Billings
*******************************************************************************/
package org.eclipse.ice.client.widgets.providers;
package org.eclipse.ice.client.widgets.providers.Default;
import java.util.ArrayList;
import org.eclipse.ice.client.widgets.ICEResourcePage;
import org.eclipse.ice.client.widgets.providers.IResourcePageProvider;
import org.eclipse.ice.datastructures.ICEObject.Component;
import org.eclipse.ice.datastructures.form.ResourceComponent;
import org.eclipse.ui.forms.editor.FormEditor;
......
......@@ -64,7 +64,7 @@ public class ICEObjectTester {
assertEquals(testObject.getDescription(), description);
// Check the context
assertTrue(testObject.getContext().isEmpty());
assertEquals("ice-default", testObject.getContext());
testObject.setContext("foo");
assertEquals("foo", testObject.getContext());
......
......@@ -61,10 +61,11 @@ public class ICEObject implements IUpdateable {
/**
* The context for this object. It should be used as described on
* {@link org.eclipse.ice.datastructures.ICEObject.Identifiable}. It is not
* persisted to XML because it only matters during runtime.
* persisted to XML because it only matters during runtime. It's default
* value is "ice-default."
*/
@XmlTransient
protected String context = "";
protected String context = "ice-default";
/**
* The unique identification number of the ICEObject.
......
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