id="org.simantics.sysdyn.ui.basicExperiment"\r
name="Basic Experiment">\r
</context>\r
+ </extension>\r
+ <extension\r
+ point="org.simantics.browsing.ui.common.selectionProcessorBinding">\r
+ <binding\r
+ browseContext="http://www.simantics.org/Sysdyn-1.0/Browser">\r
+ <implementation\r
+ class="org.simantics.sysdyn.ui.properties.ResourceSelectionProcessor">\r
+ </implementation>\r
+ </binding>\r
+ </extension>\r
+ <extension\r
+ point="org.eclipse.ui.propertyPages">\r
+ <page\r
+ class="org.simantics.sysdyn.ui.WorkbenchPropertyPage1"\r
+ id="org.simantics.sysdyn.ui.page1"\r
+ name="name">\r
+ </page>\r
</extension>
</plugin>\r
import org.simantics.browsing.ui.swt.ContextMenuInitializer;\r
import org.simantics.browsing.ui.swt.GraphExplorerView;\r
import org.simantics.browsing.ui.swt.IContextMenuInitializer;\r
+import org.simantics.browsing.ui.swt.IPropertyPage;\r
import org.simantics.sysdyn.ui.Activator;\r
+import org.simantics.sysdyn.ui.properties.SysdynPropertyPage;\r
\r
\r
public class SysdynBrowser extends GraphExplorerView {\r
\r
@Override\r
protected Set<String> getBrowseContexts() {\r
+ System.out.println("browsecontextit: " + browseContexts);\r
return browseContexts;\r
}\r
\r
//IToolBarManager toolBar = getViewSite().getActionBars().getToolBarManager();\r
//toolBar.add(new HomeAction());\r
}\r
+ \r
+ @SuppressWarnings("unchecked")\r
+ @Override\r
+ public Object getAdapter(Class adapter) {\r
+ System.out.println("get adapter: " + adapter);\r
+ if (adapter == IPropertyPage.class)\r
+ return new SysdynPropertyPage(getSite(), Collections.singleton("http://www.simantics.org/Sysdyn-1.0/Browser"));\r
+ return super.getAdapter(adapter);\r
+ }\r
}\r
package org.simantics.sysdyn.ui.dependencies;\r
\r
+import java.util.Set;\r
+\r
import org.eclipse.core.runtime.IProgressMonitor;\r
import org.eclipse.core.runtime.IStatus;\r
import org.eclipse.core.runtime.Status;\r
import org.simantics.graphviz.Graph;\r
import org.simantics.graphviz.ui.GraphvizComponent;\r
import org.simantics.ui.SimanticsUI;\r
+import org.simantics.utils.ui.ISelectionUtils;\r
\r
public class DependencyView extends ViewPart {\r
\r
if(selection instanceof IStructuredSelection) { \r
Object[] els = ((IStructuredSelection) selection).toArray();\r
if(els.length == 1) {\r
- if(els[0] instanceof Resource && !els[0].equals(currentSelection)) {\r
- currentSelection = (Resource)els[0];\r
+ Set<Resource> ress = ISelectionUtils.filterSetSelection(selection, Resource.class);\r
+ Resource r = (ress.toArray(Resource.NONE))[0];\r
+ if(r != null && !r.equals(currentSelection)) {\r
+ currentSelection = r;\r
readGraph(currentSelection);\r
}\r
}\r
\r
import java.awt.Frame;\r
import java.util.ArrayList;\r
-import java.util.Collection;\r
+import java.util.Collections;\r
\r
import javax.swing.SwingUtilities;\r
\r
import org.eclipse.ui.IEditorInput;\r
import org.eclipse.ui.IEditorSite;\r
import org.eclipse.ui.PartInitException;\r
+import org.simantics.browsing.ui.swt.IPropertyPage;\r
import org.simantics.db.Builtins;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.h2d.element.IElementListener;\r
import org.simantics.h2d.event.handler.DefaultEventHandlers;\r
import org.simantics.layer0.utils.triggers.IActivation;\r
-import org.simantics.layer0.utils.triggers.IActivationManager;\r
import org.simantics.modeling.ModelingResources;\r
import org.simantics.objmap.IMapping;\r
import org.simantics.objmap.IMappingListener;\r
import org.simantics.sysdyn.ui.actions.CreateStock;\r
import org.simantics.sysdyn.ui.actions.CreateValve;\r
import org.simantics.sysdyn.ui.actions.OpenContextMenu;\r
+import org.simantics.sysdyn.ui.properties.SysdynPropertyPage;\r
import org.simantics.ui.SimanticsUI;\r
import org.simantics.ui.workbench.ResourceEditorPart;\r
import org.simantics.ui.workbench.TitleRequest;\r
return null;\r
}\r
}\r
+ if (adapter == IPropertyPage.class) {\r
+ return new SysdynPropertyPage(getSite(), Collections.singleton("http://www.simantics.org/Sysdyn-1.0/Browser"));\r
+ }\r
return super.getAdapter(adapter);\r
}\r
}\r
import org.eclipse.swt.widgets.Composite;\r
import org.eclipse.swt.widgets.Table;\r
import org.eclipse.swt.widgets.TableItem;\r
-import org.eclipse.swt.widgets.Text;\r
-import org.eclipse.ui.IEditorInput;\r
-import org.eclipse.ui.IEditorPart;\r
import org.eclipse.ui.ISelectionListener;\r
import org.eclipse.ui.IWorkbenchPart;\r
import org.eclipse.ui.IWorkbenchPartReference;\r
-import org.eclipse.ui.PlatformUI;\r
import org.eclipse.ui.part.ViewPart;\r
import org.simantics.db.Builtins;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.sysdyn.ui.equation.expressions.ExpressionField;\r
import org.simantics.sysdyn.ui.equation.expressions.StockExpressionViewFactor;\r
import org.simantics.ui.SimanticsUI;\r
-import org.simantics.ui.workbench.ResourceEditorInput;\r
import org.simantics.utils.ui.ISelectionUtils;\r
import org.eclipse.jface.text.Position;\r
\r
if(!variables.isEmpty()) {\r
ArrayList<String> modelVariables = new ArrayList<String>();\r
Set<String> noSuchVariables = new HashSet<String>();\r
- IEditorPart editor = \r
- PlatformUI.getWorkbench()\r
- .getActiveWorkbenchWindow().getActivePage().getActiveEditor();\r
- IEditorInput input = editor.getEditorInput();\r
- ResourceEditorInput rei = (ResourceEditorInput) input;\r
SysdynModelManager sdm = SysdynModelManager.getInstance(SimanticsUI.getSession());\r
- SysdynModel model = sdm.getModel(rei.getResource());\r
+ SysdynModel model = sdm.getModel(configuration);\r
Configuration conf = model.getConfiguration();\r
ArrayList<IElement> elements = conf.elements;\r
for(IElement e : elements) {\r
for (IProjectElement member : ((IModelDescriptor) model).members()) {\r
if (member instanceof IExperimentDescriptor && experiment.equals(member.get())) {\r
model.setHint(ProjectKeys.KEY_SELECTED_EXPERIMENT, member);\r
- System.out.println("MOIOI" + member);\r
project.setHint(ProjectKeys.KEY_SELECTED_UI_EXPERIMENT, member);\r
break;\r
}\r
--- /dev/null
+package org.simantics.sysdyn.ui.properties;\r
+\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.ui.IWorkbenchSite;\r
+import org.simantics.browsing.ui.swt.PropertyTabContributorImpl;\r
+import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;\r
+import org.simantics.db.management.ISessionContext;\r
+\r
+public class ConfigurationTab extends PropertyTabContributorImpl {\r
+\r
+ @Override\r
+ public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.ui.properties;\r
+\r
+import org.eclipse.jface.layout.GridDataFactory;\r
+import org.eclipse.jface.layout.GridLayoutFactory;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.graphics.Font;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.ui.IWorkbenchSite;\r
+import org.simantics.browsing.ui.swt.PropertyTabContributorImpl;\r
+import org.simantics.browsing.ui.swt.widgets.StringPropertyFactory;\r
+import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;\r
+import org.simantics.db.Builtins;\r
+import org.simantics.db.management.ISessionContext;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.ui.properties.widgets.NameWidget;\r
+import org.simantics.sysdyn.ui.properties.widgets.UnitWidget;\r
+\r
+public class EquationTab extends PropertyTabContributorImpl {\r
+\r
+ static public final Font FONT = new Font(null, "Courier New", 12, SWT.NORMAL);\r
+ \r
+ @Override\r
+ public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) {\r
+ Composite composite = new Composite(body, SWT.NONE);\r
+ GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);\r
+ GridLayoutFactory.fillDefaults().margins(3, 3).numColumns(4).applyTo(composite);\r
+ NameWidget nameWidget = new NameWidget(composite, support, SWT.BORDER);\r
+ nameWidget.setTextFactory(new StringPropertyFactory(context, Builtins.URIs.HasName));\r
+ \r
+ UnitWidget unitWidget = new UnitWidget(composite, support, SWT.NONE);\r
+ unitWidget.setTextFactory(new StringPropertyFactory(context, SysdynResource.URIs.HasUnit));\r
+ }\r
+\r
+ \r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.ui.properties;\r
+\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.ui.IWorkbenchSite;\r
+import org.simantics.browsing.ui.swt.PropertyTabContributorImpl;\r
+import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;\r
+import org.simantics.db.management.ISessionContext;\r
+\r
+public class ExperimentTab extends PropertyTabContributorImpl {\r
+\r
+ @Override\r
+ public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) {\r
+ \r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.ui.properties;\r
+\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.ui.IWorkbenchSite;\r
+import org.simantics.browsing.ui.swt.PropertyTabContributorImpl;\r
+import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;\r
+import org.simantics.db.management.ISessionContext;\r
+\r
+public class ModelTab extends PropertyTabContributorImpl {\r
+\r
+ @Override\r
+ public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) {\r
+ \r
+ }\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.ui.properties;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+import java.util.Collections;\r
+\r
+import org.eclipse.jface.viewers.ISelection;\r
+import org.simantics.browsing.ui.SelectionProcessor;\r
+import org.simantics.browsing.ui.swt.ComparableTabContributor;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.exception.ServiceException;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.ui.utils.AdaptionUtils;\r
+\r
+public class ResourceSelectionProcessor implements SelectionProcessor<ISelection, ReadGraph> {\r
+ \r
+ @Override\r
+ public Collection<?> process(ISelection selection, ReadGraph backend) {\r
+ Resource r = AdaptionUtils.adaptToSingle(selection, Resource.class);\r
+ if(r != null)\r
+ try {\r
+ SysdynResource sr = SysdynResource.getInstance(backend);\r
+ ArrayList<ComparableTabContributor> tabs = new ArrayList<ComparableTabContributor>();\r
+ if (backend.isInstanceOf(r, sr.IndependentVariable))\r
+ return Collections.singleton(\r
+ new ComparableTabContributor(\r
+ new EquationTab(),\r
+ 0,\r
+ r,\r
+ "Equation"));\r
+ if (backend.isInstanceOf(r, sr.Configuration))\r
+ return Collections.singleton(\r
+ new ComparableTabContributor(\r
+ new ConfigurationTab(),\r
+ 0,\r
+ r,\r
+ "Configuration Properties"));\r
+ if (backend.isInstanceOf(r, sr.Experiment))\r
+ return Collections.singleton(\r
+ new ComparableTabContributor(\r
+ new ConfigurationTab(),\r
+ 0,\r
+ r,\r
+ "Experiment Properties"));\r
+ if (backend.isInstanceOf(r, sr.SysdynModel))\r
+ return Collections.singleton(\r
+ new ComparableTabContributor(\r
+ new ConfigurationTab(),\r
+ 0,\r
+ r,\r
+ "Model Properties"));\r
+ if (backend.isInstanceOf(r, sr.Result))\r
+ return Collections.singleton(\r
+ new ComparableTabContributor(\r
+ new ConfigurationTab(),\r
+ 0,\r
+ r,\r
+ "Result Properties"));\r
+ } catch (ServiceException e) {\r
+ e.printStackTrace();\r
+ }\r
+ return Collections.emptyList();\r
+ }\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.ui.properties;\r
+\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.ui.IWorkbenchSite;\r
+import org.simantics.browsing.ui.swt.PropertyTabContributorImpl;\r
+import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;\r
+import org.simantics.db.management.ISessionContext;\r
+\r
+public class ResultTab extends PropertyTabContributorImpl {\r
+\r
+ @Override\r
+ public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) {\r
+ \r
+ }\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.ui.properties;\r
+\r
+import java.util.Set;\r
+\r
+import org.eclipse.ui.IWorkbenchPartSite;\r
+import org.simantics.browsing.ui.swt.StandardPropertyPage;\r
+\r
+public class SysdynPropertyPage extends StandardPropertyPage {\r
+ \r
+ \r
+ public SysdynPropertyPage(IWorkbenchPartSite site, Set<String> set) {\r
+ super(site, set);\r
+ System.out.println("sysdynpropertypage");\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.ui.properties.widgets;\r
+\r
+public class ExpressionTypeWidget {\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.ui.properties.widgets;\r
+\r
+import org.eclipse.jface.layout.GridDataFactory;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.events.KeyEvent;\r
+import org.eclipse.swt.events.KeyListener;\r
+import org.eclipse.swt.events.ModifyEvent;\r
+import org.eclipse.swt.events.ModifyListener;\r
+import org.eclipse.swt.events.VerifyEvent;\r
+import org.eclipse.swt.events.VerifyListener;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Text;\r
+import org.simantics.browsing.ui.swt.widgets.impl.ReadFactory;\r
+import org.simantics.browsing.ui.swt.widgets.impl.Widget;\r
+import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;\r
+import org.simantics.db.procedure.Listener;\r
+import org.simantics.sysdyn.ui.properties.EquationTab;\r
+\r
+public class NameWidget implements Widget {\r
+ \r
+ final private org.eclipse.swt.widgets.Text nameText;\r
+ String originalName;\r
+ private ReadFactory<?, String> textFactory;\r
+ \r
+ public NameWidget(Composite parent, WidgetSupport support, int style) {\r
+ support.register(this);\r
+ nameText = new org.eclipse.swt.widgets.Text(parent, style);\r
+ nameText.setFont(EquationTab.FONT);\r
+ \r
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(nameText);\r
+\r
+ nameText.addVerifyListener(new VerifyListener() {\r
+\r
+ @Override\r
+ public void verifyText(VerifyEvent e) {\r
+ e.doit = false;\r
+ char c = e.character; \r
+ if(c != ' ') {\r
+ e.doit = true;\r
+ }\r
+ }\r
+ });\r
+ \r
+ nameText.addModifyListener(new ModifyListener() {\r
+\r
+ @Override\r
+ public void modifyText(ModifyEvent e) {\r
+ if(((Text)e.widget).getText().contains(" ")) {\r
+ ((Text)e.widget).setText(originalName);\r
+ }\r
+ }\r
+ });\r
+\r
+ nameText.addKeyListener(new KeyListener() {\r
+\r
+ @Override\r
+ public void keyReleased(KeyEvent e) {\r
+\r
+ }\r
+\r
+ @Override\r
+ public void keyPressed(KeyEvent e) {\r
+ if(e.keyCode == SWT.ESC && originalName != null) {\r
+ ((Text)e.widget).setText(originalName);\r
+ ((Text)e.widget).setSelection(originalName.length());\r
+ } \r
+ }\r
+ });\r
+ }\r
+\r
+ @Override\r
+ public void setInput(Object input) {\r
+ \r
+ if(textFactory != null) {\r
+ textFactory.listen(input, new Listener<String>() {\r
+\r
+ @Override\r
+ public void exception(Throwable t) {\r
+ t.printStackTrace();\r
+ }\r
+\r
+ @Override\r
+ public void execute(final String text) {\r
+\r
+ if(text == null) return;\r
+ \r
+ nameText.getDisplay().asyncExec(new Runnable() {\r
+\r
+ @Override\r
+ public void run() {\r
+ \r
+ if(isDisposed()) return;\r
+ nameText.setText(text);\r
+ \r
+ }\r
+\r
+ });\r
+ }\r
+\r
+ @Override\r
+ public boolean isDisposed() {\r
+ return nameText.isDisposed();\r
+ }\r
+\r
+ });\r
+ }\r
+ \r
+ }\r
+ \r
+ public void setTextFactory(ReadFactory<?, String> textFactory) {\r
+ this.textFactory = textFactory;\r
+ }\r
+ \r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.ui.properties.widgets;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+\r
+import org.eclipse.jface.layout.GridDataFactory;\r
+import org.eclipse.jface.layout.GridLayoutFactory;\r
+import org.eclipse.jface.viewers.ISelection;\r
+import org.eclipse.jface.viewers.IStructuredSelection;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.graphics.FontMetrics;\r
+import org.eclipse.swt.graphics.GC;\r
+import org.eclipse.swt.widgets.Combo;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Label;\r
+import org.simantics.browsing.ui.swt.widgets.impl.ReadFactory;\r
+import org.simantics.browsing.ui.swt.widgets.impl.Widget;\r
+import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;\r
+import org.simantics.db.Builtins;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.procedure.Listener;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.ui.properties.EquationTab;\r
+import org.simantics.ui.SimanticsUI;\r
+import org.simantics.utils.ui.ExceptionUtils;\r
+import org.simantics.utils.ui.ISelectionUtils;\r
+\r
+public class UnitWidget implements Widget {\r
+\r
+ Combo unitCombo;\r
+ private ReadFactory<?, String> textFactory;\r
+\r
+ public UnitWidget(Composite parent, WidgetSupport support, int style) {\r
+ support.register(this);\r
+\r
+ Composite composite = new Composite(parent, style);\r
+ GridDataFactory.fillDefaults().applyTo(composite);\r
+ GridLayoutFactory.fillDefaults().numColumns(2).applyTo(composite);\r
+\r
+ Label label = new Label(composite, SWT.SINGLE );\r
+ label.setFont(EquationTab.FONT);\r
+ label.setText("Unit:");\r
+ //label.setAlignment(SWT.RIGHT);\r
+ GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(label);\r
+\r
+\r
+ unitCombo = new Combo(composite, SWT.DROP_DOWN | SWT.BORDER);\r
+ unitCombo.setFont(EquationTab.FONT);\r
+\r
+ int columns = 6;\r
+ GC gc = new GC (unitCombo);\r
+ FontMetrics fm = gc.getFontMetrics ();\r
+ int width = columns * fm.getAverageCharWidth ();\r
+ int height = fm.getHeight ();\r
+ gc.dispose (); \r
+ GridDataFactory.fillDefaults().hint(unitCombo.computeSize(width, height)).applyTo(unitCombo);\r
+ }\r
+\r
+ public void setTextFactory(ReadFactory<?, String> textFactory) {\r
+ this.textFactory = textFactory;\r
+ }\r
+\r
+ @Override\r
+ public void setInput(final Object input) {\r
+ if(textFactory != null) {\r
+ textFactory.listen(input, new Listener<String>() {\r
+\r
+ @Override\r
+ public void exception(Throwable t) {\r
+ t.printStackTrace();\r
+ }\r
+\r
+ @Override\r
+ public void execute(final String text) {\r
+\r
+ if(text == null) return;\r
+\r
+ unitCombo.getDisplay().asyncExec(new Runnable() {\r
+\r
+ @Override\r
+ public void run() {\r
+\r
+ if(isDisposed()) return;\r
+ \r
+ if(input instanceof ISelection) {\r
+ ISelection selection = (ISelection)input;\r
+ if(unitCombo.getItemCount() > 0) unitCombo.removeAll();\r
+ for(String unit : getUnits(selection)) {\r
+ unitCombo.add(unit);\r
+ }\r
+ }\r
+ if(unitCombo.indexOf(text) >= 0)\r
+ unitCombo.select(unitCombo.indexOf(text));\r
+ else\r
+ unitCombo.setText(text);\r
+ }\r
+\r
+ });\r
+ }\r
+\r
+ @Override\r
+ public boolean isDisposed() {\r
+ return unitCombo.isDisposed();\r
+ }\r
+\r
+ });\r
+ }\r
+ }\r
+\r
+ // Returns all the used units in the model\r
+ private ArrayList<String> getUnits(ISelection selection) {\r
+ ArrayList<String> units = new ArrayList<String>();\r
+ if(selection instanceof IStructuredSelection) {\r
+ final Resource resource = ISelectionUtils.filterSingleSelection(selection, Resource.class);\r
+ if(resource != null) {\r
+ try {\r
+ units = SimanticsUI.getSession().syncRequest(new Read<ArrayList<String>>() {\r
+\r
+ @Override\r
+ public ArrayList<String> perform(ReadGraph graph)\r
+ throws DatabaseException {\r
+ ArrayList<String> units = new ArrayList<String>();\r
+\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ Builtins b = graph.getBuiltins();\r
+ Resource model = graph.getPossibleObject(resource, b.PartOf);\r
+ if (model != null) {\r
+ Collection<Resource> variables = graph.getObjects(model, b.ConsistsOf);\r
+ for(Resource v : variables) {\r
+ Object unit = graph.getPossibleRelatedValue(v, sr.HasUnit);\r
+ if (unit != null && !units.contains((String) unit)) {\r
+ units.add((String)unit);\r
+ }\r
+ }\r
+ }\r
+\r
+ return units;\r
+\r
+ }\r
+\r
+\r
+ });\r
+ } catch (DatabaseException ee) {\r
+ ExceptionUtils.logAndShowError(ee);\r
+ }\r
+ }\r
+ }\r
+ return units;\r
+ }\r
+}\r