Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result of Marietta Hamberger's research project #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bundles/org.insilico.core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
6 changes: 5 additions & 1 deletion bundles/org.insilico.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ Bundle-SymbolicName: org.insilico.core;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Vendor: Draeger Lab
Export-Package: org.insilico.core;uses:="org.eclipse.fx.ui.services.startup,org.eclipse.fx.ui.workbench.fx,org.eclipse.fx.core.app",
Export-Package: org.insilico.core.handlers,
org.insilico.core;uses:="org.eclipse.fx.ui.services.startup,
org.eclipse.fx.ui.workbench.fx,
org.eclipse.fx.core.app",
org.insilico.core.handlers
Bundle-ActivationPolicy: lazy
Import-Package: javax.inject;version="1.0.0"
Expand All @@ -22,4 +25,5 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="3.11.1",
org.eclipse.fx.ui.workbench.base;bundle-version="3.0.0",
org.eclipse.fx.core;bundle-version="3.0.0",
org.eclipse.core.databinding;bundle-version="1.6.0"
Automatic-Module-Name: org.insilico.core

17 changes: 9 additions & 8 deletions bundles/org.insilico.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@
</includes>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-source-plugin</artifactId>
<version>${tycho.version}</version>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-source-plugin</artifactId>
<version>${tycho.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.insilico.core;
package org.insilico.core;

import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.CoreException;
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.insilico.core/src/org/insilico/core/Main.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.insilico.core;
package org.insilico.core;

import org.eclipse.fx.ui.workbench.fx.E4MainThreadApplication;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
* @author roman
*
*/
package org.insilico.core;
package org.insilico.core;
6 changes: 6 additions & 0 deletions bundles/org.insilico.jsbml.core/.project
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
Expand Down
7 changes: 6 additions & 1 deletion bundles/org.insilico.jsbml.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Service-Component: OSGI-INF/services/org.insilico.jsbml.core.services.provider.SBMLEditorProvider.xml,
OSGI-INF/services/org.insilico.jsbml.core.services.provider.SBMLIconProvider.xml,
OSGI-INF/services/org.insilico.jsbml.core.services.provider.SBMLDocumentLoader.xml
OSGI-INF/services/org.insilico.jsbml.core.services.provider.SBMLDocumentLoader.xml,
OSGI-INF/org.insilico.jsbml.core.services.provider.SBMLIconProvider.xml,
OSGI-INF/org.insilico.jsbml.core.services.provider.SBMLDocumentLoader.xml,
OSGI-INF/org.insilico.jsbml.core.services.provider.SBMLEditorProvider.xml
Export-Package: org.insilico.jsbml.core,
org.insilico.jsbml.core.editor,
org.insilico.jsbml.core.services,
org.insilico.jsbml.core.services.provider
Automatic-Module-Name: org.insilico.jsbml.core
Import-Package: org.osgi.service.component.annotations;version="1.2.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.insilico.jsbml.core.services.provider.SBMLDocumentLoader">
<property name="service.context.key" value="org.sbml.jsbml.SBMLDocument"/>
<service>
<provide interface="org.eclipse.e4.core.contexts.IContextFunction"/>
</service>
<implementation class="org.insilico.jsbml.core.services.provider.SBMLDocumentLoader"/>
</scr:component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.insilico.jsbml.core.services.provider.SBMLEditorProvider">
<service>
<provide interface="org.eclipse.fx.code.editor.fx.e4.EditorClassURLProvider"/>
</service>
<implementation class="org.insilico.jsbml.core.services.provider.SBMLEditorProvider"/>
</scr:component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.insilico.jsbml.core.services.provider.SBMLIconProvider">
<service>
<provide interface="org.eclipse.fx.code.editor.services.FileIconProvider"/>
</service>
<implementation class="org.insilico.jsbml.core.services.provider.SBMLIconProvider"/>
</scr:component>
17 changes: 9 additions & 8 deletions bundles/org.insilico.jsbml.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@
</includes>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-source-plugin</artifactId>
<version>${tycho.version}</version>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-source-plugin</artifactId>
<version>${tycho.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.insilico.jsbml.core;
package org.insilico.jsbml.core;

public interface Constants {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package org.insilico.jsbml.core.editor;
package org.insilico.jsbml.core.editor;

import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

import javax.annotation.PostConstruct;
import javax.inject.Inject;

import org.sbml.jsbml.SBMLDocument;
import org.sbml.jsbml.SBase;

import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeView;
import javafx.scene.layout.BorderPane;
Expand All @@ -21,9 +18,11 @@ public class DocumentTreeView {

@PostConstruct
private void init(BorderPane parent) {
if (doc!=null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this check added we assume that the doc can be null on this stage. Do we need to set an alternative error view for the case when the doc is not available or we inform the user in some different way?

TreeView<SBase> docTreeView = new TreeView<>(convertToTreeItem(doc, 2));

parent.setCenter(docTreeView);
}
}

private TreeItem<SBase> convertToTreeItem(SBase elem, int expandLevels) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.insilico.jsbml.core.services;
package org.insilico.jsbml.core.services;

import org.sbml.jsbml.SBMLDocument;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
* @author roman
*
*/
@SuppressWarnings("restriction")
@Component(service = IContextFunction.class,
property = {"service.context.key=org.sbml.jsbml.SBMLDocument"})
public class SBMLDocumentLoader extends ContextFunction {
Expand All @@ -40,7 +39,8 @@ public class SBMLDocumentLoader extends ContextFunction {

@Override
public Object compute(IEclipseContext context, String contextKey) {
System.out.println("Compute...");
return IInjector.NOT_A_VALUE;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe change this to a "not implemented" Exception

/*System.out.println("Compute...");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove redundant code or at least add a description of the potential code intention.

Object urlVal = context.get(DOCUMENT_URL);

if (urlVal == null) {
Expand Down Expand Up @@ -69,7 +69,12 @@ public Object compute(IEclipseContext context, String contextKey) {
// Load if needed
try {
URI url = URIUtil.fromString(urlString);
doc = JSBML.readSBMLFromFile(url.getPath());
if (url!=null) {
if (url.getPath()!=null) {
doc = JSBML.readSBMLFromFile(url.getPath());
}
}

// doc = SBMLReader.read(new File(url));
cache.put(urlString, doc);
}
Expand All @@ -85,6 +90,6 @@ public Object compute(IEclipseContext context, String contextKey) {
}

System.out.println("No doc selected");
return IInjector.NOT_A_VALUE;
return IInjector.NOT_A_VALUE;*/
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.osgi.service.component.annotations.Component;

/**
* OSGi Service Component which provides a editor part for SBML files. The editor is provides via
* OSGi Service Component which provides an editor part for SBML files. The editor is provided via
* the {@link EditorClassURLProvider} service.
*
* @author roman
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*
*/
@Component
@SuppressWarnings("restriction")
public class SBMLIconProvider implements FileIconProvider {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* @author roman
* @see org.insilico.jsbml.core
*/
package org.insilico.jsbml.core.services.provider;
package org.insilico.jsbml.core.services.provider;
1 change: 1 addition & 0 deletions bundles/org.insilico.sbmlsheets/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
39 changes: 39 additions & 0 deletions bundles/org.insilico.sbmlsheets/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.insilico.sbmlsheets</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ds.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
40 changes: 40 additions & 0 deletions bundles/org.insilico.sbmlsheets/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SBMLsheets
Bundle-SymbolicName: org.insilico.sbmlsheets;singleton:=true
Bundle-Version: 1.0.0.qualifier
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.fx.ui.services;bundle-version="3.0.0",
org.eclipse.fx.code.editor;bundle-version="3.0.0",
org.sbml.jsbml.core;bundle-version="1.3.1",
org.eclipse.fx.code.editor.fx.e4;bundle-version="3.0.0",
org.eclipse.e4.core.contexts;bundle-version="1.5.0",
org.eclipse.e4.core.di;bundle-version="1.6.1",
org.eclipse.e4.ui.model.workbench;bundle-version="1.2.0",
org.insilico.ui.themes.light;bundle-version="1.0.0",
org.insilico.ui;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Service-Component: OSGI-INF/services/org.insilico.sbmlsheets.services.provider.SBMLEditorProvider.xml,
OSGI-INF/services/org.insilico.sbmlsheets.services.provider.SBMLIconProvider.xml,
OSGI-INF/services/org.insilico.sbmlsheets.services.provider.SBMLDocumentLoader.xml,
OSGI-INF/services/org.insilico.sbmlsheets.services.provider.SpreadsheetEditorProvider.xml,
OSGI-INF/services/org.insilico.sbmlsheets.services.provider.SpreadsheetDocumentLoader.xml,
OSGI-INF/org.insilico.sbmlsheets.services.provider.SBMLIconProvider.xml,
OSGI-INF/org.insilico.sbmlsheets.services.provider.SBMLEditorProvider.xml,
OSGI-INF/org.insilico.sbmlsheets.services.provider.SBMLDocumentLoader.xml,
OSGI-INF/org.insilico.sbmlsheets.services.provider.SpreadsheetDocumentLoader.xml,
OSGI-INF/org.insilico.sbmlsheets.services.provider.SpreadsheetEditorProvider.xml,
OSGI-INF/org.insilico.sbmlsheets.services.provider.SheetProjectEditorProvider.xml,
OSGI-INF/org.insilico.sbmlsheets.services.provider.SheetProjectDocumentLoader.xml
Export-Package: org.insilico.sbmlsheets.core,
org.insilico.sbmlsheets.editor,
org.insilico.sbmlsheets.services,
org.insilico.sbmlsheets.services.provider
Automatic-Module-Name: org.insilico.sbmlsheets
Import-Package: org.eclipse.core.databinding.observable.list,
org.eclipse.core.resources,
org.eclipse.e4.ui.workbench,
org.eclipse.e4.ui.workbench.modeling,
org.insilico.core,
org.osgi.service.component.annotations;version="1.2.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.insilico.sbmlsheets.services.provider.SBMLDocumentLoader">
<property name="service.context.key" value="org.sbml.jsbml.SBMLDocument"/>
<service>
<provide interface="org.eclipse.e4.core.contexts.IContextFunction"/>
</service>
<implementation class="org.insilico.sbmlsheets.services.provider.SBMLDocumentLoader"/>
</scr:component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.insilico.sbmlsheets.services.provider.SBMLEditorProvider">
<service>
<provide interface="org.eclipse.fx.code.editor.fx.e4.EditorClassURLProvider"/>
</service>
<implementation class="org.insilico.sbmlsheets.services.provider.SBMLEditorProvider"/>
</scr:component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.insilico.sbmlsheets.services.provider.SBMLIconProvider">
<service>
<provide interface="org.eclipse.fx.code.editor.services.FileIconProvider"/>
</service>
<implementation class="org.insilico.sbmlsheets.services.provider.SBMLIconProvider"/>
</scr:component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.insilico.sbmlsheets.services.provider.SheetProjectDocumentLoader">
<property name="service.context.key" value="org.insilico.sbmlsheets.core.TableEditor"/>
<service>
<provide interface="org.eclipse.e4.core.contexts.IContextFunction"/>
</service>
<implementation class="org.insilico.sbmlsheets.services.provider.SheetProjectDocumentLoader"/>
</scr:component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.insilico.sbmlsheets.services.provider.SheetProjectEditorProvider">
<service>
<provide interface="org.eclipse.fx.code.editor.fx.e4.EditorClassURLProvider"/>
</service>
<implementation class="org.insilico.sbmlsheets.services.provider.SheetProjectEditorProvider"/>
</scr:component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.insilico.sbmlsheets.services.provider.SpreadsheetDocumentLoader">
<property name="service.context.key" value="org.insilico.sbmlsheets.core.Spreadsheet"/>
<service>
<provide interface="org.eclipse.e4.core.contexts.IContextFunction"/>
</service>
<implementation class="org.insilico.sbmlsheets.services.provider.SpreadsheetDocumentLoader"/>
</scr:component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.insilico.sbmlsheets.services.provider.SpreadsheetEditorProvider">
<service>
<provide interface="org.eclipse.fx.code.editor.fx.e4.EditorClassURLProvider"/>
</service>
<implementation class="org.insilico.sbmlsheets.services.provider.SpreadsheetEditorProvider"/>
</scr:component>
Loading