Skip to content

Commit

Permalink
Move the buttons into a static toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailaender committed May 3, 2022
1 parent e2f3473 commit 617e878
Show file tree
Hide file tree
Showing 8 changed files with 203 additions and 206 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2013, 2020 Lablicate GmbH.
* Copyright (c) 2013, 2022 Lablicate GmbH.
*
* All rights reserved.
* This program and the accompanying materials are made available under the
Expand All @@ -18,18 +18,18 @@

import org.eclipse.chemclipse.ux.extension.msd.ui.Activator;
import org.eclipse.chemclipse.ux.extension.msd.ui.support.MassSpectrumSupport;
import org.eclipse.chemclipse.ux.extension.ui.swt.DataExplorerUI;
import org.eclipse.chemclipse.ux.extension.ui.swt.MultiDataExplorerTreeUI;
import org.eclipse.e4.ui.di.Focus;
import org.eclipse.swt.widgets.Composite;

public class MassSpectrumFileExplorer {

private DataExplorerUI explorerUI;
private MultiDataExplorerTreeUI explorerUI;

@Inject
public MassSpectrumFileExplorer(Composite parent) {

explorerUI = new DataExplorerUI(parent, Activator.getDefault().getPreferenceStore());
explorerUI = new MultiDataExplorerTreeUI(parent, Activator.getDefault().getPreferenceStore());
explorerUI.setSupplierFileIdentifier(Collections.singleton(MassSpectrumSupport.getInstanceEditorSupport()));
explorerUI.expandLastDirectoryPath();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2014, 2020 Lablicate GmbH.
* Copyright (c) 2014, 2022 Lablicate GmbH.
*
* All rights reserved.
* This program and the accompanying materials are made available under the
Expand All @@ -18,18 +18,18 @@

import org.eclipse.chemclipse.ux.extension.msd.ui.Activator;
import org.eclipse.chemclipse.ux.extension.msd.ui.support.DatabaseSupport;
import org.eclipse.chemclipse.ux.extension.ui.swt.DataExplorerUI;
import org.eclipse.chemclipse.ux.extension.ui.swt.MultiDataExplorerTreeUI;
import org.eclipse.e4.ui.di.Focus;
import org.eclipse.swt.widgets.Composite;

public class MassSpectrumLibraryExplorer {

private DataExplorerUI explorerUI;
private MultiDataExplorerTreeUI explorerUI;

@Inject
public MassSpectrumLibraryExplorer(Composite parent) {

explorerUI = new DataExplorerUI(parent, Activator.getDefault().getPreferenceStore());
explorerUI = new MultiDataExplorerTreeUI(parent, Activator.getDefault().getPreferenceStore());
explorerUI.setSupplierFileIdentifier((Collections.singleton(DatabaseSupport.getInstanceEditorSupport())));
explorerUI.expandLastDirectoryPath();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2020 Lablicate GmbH.
* Copyright (c) 2019, 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
Expand Down Expand Up @@ -150,6 +150,10 @@ protected String getPreferenceKey(DataExplorerTreeRoot root) {
return root.getPreferenceKeyDefaultPath();
}

protected void createToolbarMain(Composite parent) {

}

protected void initTabComponent(Composite parent, DataExplorerTreeUI treeUI) {

if(treeUI.getRoot() == DataExplorerTreeRoot.USER_LOCATION) {
Expand All @@ -169,6 +173,7 @@ private DataExplorerTreeUI createDataExplorerTreeUI(TabFolder tabFolder, DataExp
Composite composite = new Composite(tabFolder, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
composite.setLayout(new GridLayout());
createToolbarMain(composite);
//
DataExplorerTreeUI dataExplorerTreeUI = new DataExplorerTreeUI(composite, root, getIdentifierSupplier());
TreeViewer treeViewer = dataExplorerTreeUI.getTreeViewer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
<fragment:ModelFragments xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:advanced="http://www.eclipse.org/ui/2010/UIModel/application/ui/advanced" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmlns:basic_1="http://www.eclipse.org/ui/2010/UIModel/application/descriptor/basic" xmlns:commands="http://www.eclipse.org/ui/2010/UIModel/application/commands" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmi:id="_RvTHsKuDEeSKQ7OYnQVHjQ">
<imports xsi:type="advanced:Area" xmi:id="_qjvtkCskEeakPPc3RJFSAg" elementId="org.eclipse.chemclipse.rcp.app.ui.editor"/>
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_TxCZIKuHEeSKQ7OYnQVHjQ" featurename="sharedElements" parentElementId="org.eclipse.chemclipse.rcp.app.ui.trimmedwindow.main">
<elements xsi:type="basic:Part" xmi:id="_qtur4Cf2EeafjOXnfHSw0Q" elementId="org.eclipse.chemclipse.ux.extension.xxd.ui.part.dataexplorer" contributionURI="bundleclass://org.eclipse.chemclipse.ux.extension.xxd.ui/org.eclipse.chemclipse.ux.extension.xxd.ui.parts.DataExplorerPart" label="Data Explorer" iconURI="platform:/plugin/org.eclipse.chemclipse.rcp.ui.icons/icons/16x16/chromatogramFileExplorer.gif">
<toolbar xmi:id="_0M9cAIavEemwu6_7mTaq4w" elementId="org.eclipse.chemclipse.ux.extension.xxd.ui.toolbar.0">
<children xsi:type="menu:DirectToolItem" xmi:id="_QFr2YIawEemwu6_7mTaq4w" elementId="org.eclipse.chemclipse.ux.extension.xxd.ui.directtoolitem.reset" label="Reset" iconURI="platform:/plugin/org.eclipse.chemclipse.rcp.ui.icons/icons/16x16/reset.gif" tooltip="Reset the file explorer" contributionURI="bundleclass://org.eclipse.chemclipse.ux.extension.xxd.ui/org.eclipse.chemclipse.ux.extension.xxd.ui.internal.handlers.ResetDataExplorerHandler"/>
<children xsi:type="menu:DirectToolItem" xmi:id="_Tru6kIaxEemwu6_7mTaq4w" elementId="org.eclipse.chemclipse.ux.extension.xxd.ui.directtoolitem.settings" label="Settings" iconURI="platform:/plugin/org.eclipse.chemclipse.rcp.ui.icons/icons/16x16/configure.gif" tooltip="Open the Settings" contributionURI="bundleclass://org.eclipse.chemclipse.ux.extension.xxd.ui/org.eclipse.chemclipse.ux.extension.xxd.ui.internal.handlers.DataExplorerSettingsHandler"/>
</toolbar>
</elements>
<elements xsi:type="basic:Part" xmi:id="_qtur4Cf2EeafjOXnfHSw0Q" elementId="org.eclipse.chemclipse.ux.extension.xxd.ui.part.dataexplorer" contributionURI="bundleclass://org.eclipse.chemclipse.ux.extension.xxd.ui/org.eclipse.chemclipse.ux.extension.xxd.ui.parts.DataExplorerPart" label="Data Explorer" iconURI="platform:/plugin/org.eclipse.chemclipse.rcp.ui.icons/icons/16x16/chromatogramFileExplorer.gif"/>
<elements xsi:type="basic:Part" xmi:id="_dXp1AC5uEeiL24_JU7_FGA" elementId="org.eclipse.chemclipse.ux.extension.xxd.ui.part.peakScanListPart" contributionURI="bundleclass://org.eclipse.chemclipse.ux.extension.xxd.ui/org.eclipse.chemclipse.ux.extension.xxd.ui.parts.PeakScanListPart" label="Peak/Scan List" iconURI="platform:/plugin/org.eclipse.chemclipse.rcp.ui.icons/icons/16x16/peaks.gif" tooltip=""/>
<elements xsi:type="basic:Part" xmi:id="_E8UhsDmqEei-wI9hy1kIxA" elementId="org.eclipse.chemclipse.ux.extension.xxd.ui.part.targets" contributionURI="bundleclass://org.eclipse.chemclipse.ux.extension.xxd.ui/org.eclipse.chemclipse.ux.extension.xxd.ui.parts.TargetsPart" label="Targets" iconURI="platform:/plugin/org.eclipse.chemclipse.rcp.ui.icons/icons/16x16/target.png"/>
<elements xsi:type="basic:Part" xmi:id="_NC1V0DmqEei-wI9hy1kIxA" elementId="org.eclipse.chemclipse.ux.extension.xxd.ui.part.comparisonScan" contributionURI="bundleclass://org.eclipse.chemclipse.ux.extension.xxd.ui/org.eclipse.chemclipse.ux.extension.xxd.ui.parts.ComparisonScanChartPart" label="Comparison Scan" iconURI="platform:/plugin/org.eclipse.chemclipse.rcp.ui.icons/icons/16x16/comparisonScanDefault.gif"/>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016, 2021 Lablicate GmbH.
* Copyright (c) 2016, 2022 Lablicate GmbH.
*
* All rights reserved.
* This program and the accompanying materials are made available under the
Expand All @@ -13,21 +13,12 @@
*******************************************************************************/
package org.eclipse.chemclipse.ux.extension.xxd.ui.parts;

import java.util.ArrayList;
import java.util.List;

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

import org.eclipse.chemclipse.model.types.DataType;
import org.eclipse.chemclipse.processing.converter.ISupplierFileIdentifier;
import org.eclipse.chemclipse.ux.extension.ui.provider.ISupplierFileEditorSupport;
import org.eclipse.chemclipse.ux.extension.ui.swt.DataExplorerUI;
import org.eclipse.chemclipse.ux.extension.xxd.ui.Activator;
import org.eclipse.chemclipse.ux.extension.xxd.ui.internal.editors.ProjectExplorerSupportFactory;
import org.eclipse.chemclipse.ux.extension.xxd.ui.part.support.GenericSupplierEditorSupport;
import org.eclipse.chemclipse.ux.extension.xxd.ui.part.support.SupplierEditorSupport;
import org.eclipse.chemclipse.ux.extension.xxd.ui.preferences.PreferenceConstants;
import org.eclipse.chemclipse.ux.extension.xxd.ui.swt.DataExplorerUI;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.ui.di.Focus;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
Expand All @@ -36,106 +27,16 @@

public class DataExplorerPart {

@Inject
private IEclipseContext context;
@Inject
private ISupplierFileIdentifier supplierFileIdentifier;
//
private DataExplorerUI dataExplorerUI;
private IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();

@PostConstruct
public void init(Composite parent, MPart part, IEclipseContext eclipseContext) {

dataExplorerUI = new DataExplorerUI(parent, preferenceStore);
setSupplierFileEditorSupport();
}

public void setSupplierFileEditorSupport() {
public void init(Composite parent, MPart part, IEclipseContext context) {

List<ISupplierFileEditorSupport> editorSupportList = new ArrayList<ISupplierFileEditorSupport>();
/*
* MSD
*/
if(preferenceStore.getBoolean(PreferenceConstants.P_SHOW_DATA_MSD)) {
editorSupportList.add(new SupplierEditorSupport(DataType.MSD, () -> context));
}
/*
* MSD Library
*/
if(preferenceStore.getBoolean(PreferenceConstants.P_SHOW_LIBRARY_MSD)) {
editorSupportList.add(org.eclipse.chemclipse.ux.extension.msd.ui.support.DatabaseSupport.getInstanceEditorSupport());
}
/*
* MSD Scan
*/
if(preferenceStore.getBoolean(PreferenceConstants.P_SHOW_SCANS_MSD)) {
editorSupportList.add(org.eclipse.chemclipse.ux.extension.msd.ui.support.MassSpectrumSupport.getInstanceEditorSupport());
}
/*
* CSD
*/
if(preferenceStore.getBoolean(PreferenceConstants.P_SHOW_DATA_CSD)) {
editorSupportList.add(new SupplierEditorSupport(DataType.CSD, () -> context));
}
/*
* WSD
*/
if(preferenceStore.getBoolean(PreferenceConstants.P_SHOW_DATA_WSD)) {
editorSupportList.add(new SupplierEditorSupport(DataType.WSD, () -> context));
}
/*
* TSD
*/
if(preferenceStore.getBoolean(PreferenceConstants.P_SHOW_DATA_TSD)) {
editorSupportList.add(new SupplierEditorSupport(DataType.TSD, () -> context));
}
/*
* XIR
*/
if(preferenceStore.getBoolean(PreferenceConstants.P_SHOW_DATA_XIR)) {
editorSupportList.add(new SupplierEditorSupport(DataType.XIR, () -> context));
}
/*
* NMR
*/
if(preferenceStore.getBoolean(PreferenceConstants.P_SHOW_DATA_NMR)) {
editorSupportList.add(new SupplierEditorSupport(DataType.NMR, () -> context));
}
/*
* CAL
*/
if(preferenceStore.getBoolean(PreferenceConstants.P_SHOW_DATA_CAL)) {
editorSupportList.add(new ProjectExplorerSupportFactory(DataType.CAL).getInstanceEditorSupport());
}
/*
* PCR
*/
if(preferenceStore.getBoolean(PreferenceConstants.P_SHOW_DATA_PCR)) {
editorSupportList.add(new SupplierEditorSupport(DataType.PCR, () -> context));
}
/*
* SEQ
*/
if(preferenceStore.getBoolean(PreferenceConstants.P_SHOW_DATA_SEQUENCE)) {
editorSupportList.add(new SupplierEditorSupport(DataType.SEQ, () -> context));
}
/*
* MTH
*/
if(preferenceStore.getBoolean(PreferenceConstants.P_SHOW_DATA_METHOD)) {
editorSupportList.add(new SupplierEditorSupport(DataType.MTH, () -> context));
}
/*
* QDB
*/
if(preferenceStore.getBoolean(PreferenceConstants.P_SHOW_DATA_QUANT_DB)) {
editorSupportList.add(new SupplierEditorSupport(DataType.QDB, () -> context));
}
//
editorSupportList.add(new GenericSupplierEditorSupport(supplierFileIdentifier, () -> context));
dataExplorerUI.setSupplierFileIdentifier(editorSupportList);
dataExplorerUI.expandLastDirectoryPath();
dataExplorerUI = new DataExplorerUI(parent, preferenceStore, context, supplierFileIdentifier);
}

public DataExplorerUI getDataExplorerUI() {
Expand Down
Loading

0 comments on commit 617e878

Please sign in to comment.