Skip to content

Commit

Permalink
Add a user configurable .csv export.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailaender committed Jan 7, 2022
1 parent 16ec12e commit bab31f6
Show file tree
Hide file tree
Showing 41 changed files with 1,710 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,16 @@

<includes
id="net.openchrom.thirdpartylibraries.sqlite.feature"
version="0.0.0"/>
version="0.0.0"/>

<includes
id="net.openchrom.xxd.converter.supplier.animl.feature"
version="0.0.0"/>

<includes
id="net.openchrom.chromatogram.xxd.report.supplier.csv.feature"
version="0.0.0"/>

<plugin
id="net.openchrom.rcp.compilation.community.ui"
download-size="0"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>net.openchrom.chromatogram.xxd.report.supplier.csv.feature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin.includes = feature.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="net.openchrom.chromatogram.xxd.report.supplier.csv.feature"
label="Feature"
version="1.4.0.qualifier"
provider-name="OpenChrom"
plugin="net.openchrom.feature.branding">

<description url="https://www.openchrom.net">
This is the chromatogram CSV report plugin.
</description>

<copyright url="https://github.com/OpenChrom/openchrom/blob/develop/LICENSE">
Copyright (c) 2022 Lablicate GmbH.
</copyright>

<license url="http://www.eclipse.org/legal/epl-v10.html">
Copyright (c) 2022 Lablicate GmbH.

All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v1.0 which accompanies this distribution,
and is available at http://www.eclipse.org/legal/epl-v10.html
</license>

<plugin
id="net.openchrom.chromatogram.xxd.report.supplier.csv"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

<plugin
id="net.openchrom.chromatogram.xxd.report.supplier.csv.ui"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

</feature>
1 change: 1 addition & 0 deletions openchrom/features/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@
<module>net.openchrom.msd.converter.supplier.mzmlb.feature</module>
<module>net.openchrom.msd.converter.supplier.mzdb.feature</module>
<module>net.openchrom.xxd.converter.supplier.animl.feature</module>
<module>net.openchrom.xxd.report.supplier.csv.feature</module>
</modules>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>net.openchrom.chromatogram.xxd.report.supplier.csv.ui</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>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Manifest-Version: 1.0
Automatic-Module-Name: net.openchrom.chromatogram.xxd.report.supplier.csv.ui
Bundle-ManifestVersion: 2
Bundle-Name: CSV Report UI
Bundle-SymbolicName: net.openchrom.chromatogram.xxd.report.supplier.csv.ui;singleton:=true
Bundle-Version: 1.4.0.qualifier
Bundle-Activator: net.openchrom.chromatogram.xxd.report.supplier.csv.ui.Activator
Bundle-Vendor: OpenChrom
Require-Bundle: org.eclipse.core.runtime,
net.openchrom.chromatogram.xxd.report.supplier.csv;bundle-version="0.9.0",
org.eclipse.chemclipse.support;bundle-version="0.9.0",
org.eclipse.chemclipse.support.ui,
org.eclipse.ui;bundle-version="3.109.100",
org.eclipse.chemclipse.ux.extension.ui;bundle-version="0.9.0",
org.eclipse.chemclipse.ux.extension.xxd.ui,
org.eclipse.chemclipse.rcp.ui.icons,
com.fasterxml.jackson.core.jackson-databind;bundle-version="2.9.93"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Import-Package: org.osgi.service.component.annotations;version="1.3.0"
Service-Component: OSGI-INF/net.openchrom.chromatogram.xxd.report.supplier.csv.ui.services.ReportColumnsAnnotationService.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
###############################################################################
# Copyright (c) 2022 Lablicate GmbH.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Matthias Mailänder - initial API and implementation
###############################################################################
#Properties file
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" configuration-policy="optional" name="net.openchrom.chromatogram.xxd.report.supplier.csv.ui.services.ReportColumnsAnnotationService">
<service>
<provide interface="org.eclipse.chemclipse.ux.extension.xxd.ui.methods.IAnnotationWidgetService"/>
</service>
<implementation class="net.openchrom.chromatogram.xxd.report.supplier.csv.ui.services.ReportColumnsAnnotationService"/>
</scr:component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
OSGI-INF/
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.preferencePages">
<page
category="org.eclipse.chemclipse.chromatogram.xxd.report.ui.preferences.reportPreferencePage"
class="net.openchrom.chromatogram.xxd.report.supplier.csv.ui.preferences.PreferencePage"
id="net.openchrom.chromatogram.xxd.report.supplier.csv.ui.preferences.preferencePage"
name="CSV Chromatogram Report">
</page>
</extension>
</plugin>
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*******************************************************************************
* Copyright (c) 2012, 2022 Lablicate GmbH.
*
* All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr. Philip Wenig - initial API and implementation
*******************************************************************************/
package net.openchrom.chromatogram.xxd.report.supplier.csv.ui;

import org.eclipse.chemclipse.support.ui.activator.AbstractActivatorUI;
import org.osgi.framework.BundleContext;

import net.openchrom.chromatogram.xxd.report.supplier.csv.preferences.PreferenceSupplier;

public class Activator extends AbstractActivatorUI {

/*
* Instance
*/
private static Activator plugin;

/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {

super.start(context);
plugin = this;
initializePreferenceStore(PreferenceSupplier.INSTANCE());
}

/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {

plugin = null;
super.stop(context);
}

/**
* Returns the shared instance
*
* @return the shared instance
*/
public static AbstractActivatorUI getDefault() {

return plugin;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*******************************************************************************
* Copyright (c) 2022 Lablicate GmbH.
*
* All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Matthias Mailänder - initial API and implementation
*******************************************************************************/
package net.openchrom.chromatogram.xxd.report.supplier.csv.ui.preferences;

import org.eclipse.chemclipse.support.ui.preferences.fieldeditors.SpacerFieldEditor;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.ComboFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;

import net.openchrom.chromatogram.xxd.report.supplier.csv.preferences.PreferenceSupplier;
import net.openchrom.chromatogram.xxd.report.supplier.csv.ui.Activator;

public class PreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {

public PreferencePage() {

super(GRID);
setPreferenceStore(Activator.getDefault().getPreferenceStore());
setTitle("CSV Chromatogram Reports");
setDescription("Allows user customizable reports in character separated values format.");
}

/**
* Creates the field editors. Field editors are abstractions of the common
* GUI blocks needed to manipulate various types of preferences. Each field
* editor knows how to save and restore itself.
*/
@Override
public void createFieldEditors() {

addField(new SpacerFieldEditor(getFieldEditorParent()));
addField(new ComboFieldEditor(PreferenceSupplier.P_DELIMITER, "Column delimiter", PreferenceSupplier.DELIMITERS, getFieldEditorParent()));
addField(new BooleanFieldEditor(PreferenceSupplier.P_REPORT_REFERENCED_CHROMATOGRAMS, "Report Referenced Chromatograms", getFieldEditorParent()));
}

/*
* (non-Javadoc)
* @see
* org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
@Override
public void init(IWorkbench workbench) {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*******************************************************************************
* Copyright (c) 2021, 2022 Lablicate GmbH.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Philip Wenig - initial API and implementation
*******************************************************************************/
package net.openchrom.chromatogram.xxd.report.supplier.csv.ui.services;

import org.eclipse.chemclipse.ux.extension.xxd.ui.methods.IAnnotationWidgetService;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.ConfigurationPolicy;

import net.openchrom.chromatogram.xxd.report.supplier.csv.service.ReportColumnsSerializationService;
import net.openchrom.chromatogram.xxd.report.supplier.csv.ui.swt.ReportColumnEditor;

@Component(service = {IAnnotationWidgetService.class}, configurationPolicy = ConfigurationPolicy.OPTIONAL)
public class ReportColumnsAnnotationService extends ReportColumnsSerializationService implements IAnnotationWidgetService {

private ReportColumnEditor reportColumnEditor;

@Override
public Control createWidget(Composite parent, String description, Object currentSelection) {

reportColumnEditor = new ReportColumnEditor(parent, SWT.NONE);
reportColumnEditor.setToolTipText(description);
GridData gridData = new GridData(GridData.FILL_BOTH);
gridData.heightHint = 200;
reportColumnEditor.setLayoutData(gridData);
//
if(currentSelection instanceof String) {
reportColumnEditor.load((String)currentSelection);
}
//
return reportColumnEditor;
}

@Override
public Object getValue(Object currentSelection) {

return reportColumnEditor.getReportColumns();
}
}
Loading

0 comments on commit bab31f6

Please sign in to comment.