Skip to content

Commit

Permalink
Fixed #181 - Peak Review [Template] - add option to adjust the positions
Browse files Browse the repository at this point in the history
  • Loading branch information
eselmeister committed Jan 5, 2022
1 parent c650ea0 commit 0ee0973
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 91 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018, 2020 Lablicate GmbH.
* Copyright (c) 2018, 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 All @@ -12,6 +12,7 @@
*******************************************************************************/
package net.openchrom.xxd.process.supplier.templates.ui.fieldeditors;

import org.eclipse.chemclipse.rcp.ui.icons.core.IApplicationImage;
import org.eclipse.jface.preference.FieldEditor;

public abstract class AbstractFieldEditor extends FieldEditor {
Expand All @@ -36,4 +37,7 @@ public abstract class AbstractFieldEditor extends FieldEditor {
public static final String MESSAGE_REMOVE_ALL = "Do you want to delete all template(s)?";
public static final String MESSAGE_EXPORT_SUCCESSFUL = "Templates have been exported successfully.";
public static final String MESSAGE_EXPORT_FAILED = "Failed to export the templates.";
}
//
public static final String TOOLTIP_ADJUST_POSITION = "the position adjust toolbar.";
public static final String IMAGE_ADJUST_POSITION = IApplicationImage.IMAGE_ADJUST_CHROMATOGRAMS;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import static net.openchrom.xxd.process.supplier.templates.ui.fieldeditors.AbstractFieldEditor.DIALOG_TITLE;
import static net.openchrom.xxd.process.supplier.templates.ui.fieldeditors.AbstractFieldEditor.EDIT_TOOLTIP;
import static net.openchrom.xxd.process.supplier.templates.ui.fieldeditors.AbstractFieldEditor.EXPORT_TITLE;
import static net.openchrom.xxd.process.supplier.templates.ui.fieldeditors.AbstractFieldEditor.IMAGE_ADJUST_POSITION;
import static net.openchrom.xxd.process.supplier.templates.ui.fieldeditors.AbstractFieldEditor.IMPORT_TITLE;
import static net.openchrom.xxd.process.supplier.templates.ui.fieldeditors.AbstractFieldEditor.MESSAGE_ADD;
import static net.openchrom.xxd.process.supplier.templates.ui.fieldeditors.AbstractFieldEditor.MESSAGE_EDIT;
Expand All @@ -25,6 +26,7 @@
import static net.openchrom.xxd.process.supplier.templates.ui.fieldeditors.AbstractFieldEditor.MESSAGE_REMOVE_ALL;
import static net.openchrom.xxd.process.supplier.templates.ui.fieldeditors.AbstractFieldEditor.REMOVE_ALL_TOOLTIP;
import static net.openchrom.xxd.process.supplier.templates.ui.fieldeditors.AbstractFieldEditor.REMOVE_TOOLTIP;
import static net.openchrom.xxd.process.supplier.templates.ui.fieldeditors.AbstractFieldEditor.TOOLTIP_ADJUST_POSITION;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -54,7 +56,6 @@
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
Expand Down Expand Up @@ -90,9 +91,6 @@ public class TemplatePeakListEditor implements SettingsUIProvider.SettingsUICont
private static final String CATEGORY = "Peak Detector";
private static final String DELETE = "Delete";
//
private static final String TOOLTIP_ADJUST_POSITION = "the position adjust toolbar.";
private static final String IMAGE_ADJUST_POSITION = IApplicationImage.IMAGE_ADJUST_CHROMATOGRAMS;
//
private Listener listener;
private List<Button> buttons = new ArrayList<>();
private Button buttonAdd;
Expand Down Expand Up @@ -198,11 +196,23 @@ private void initialize() {

private void createTableSection(Composite parent) {

Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new FillLayout());
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
PeakDetectorListUI peakDetectorListUI = new PeakDetectorListUI(parent, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
Table table = peakDetectorListUI.getTable();
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.heightHint = 450;
gridData.grabExcessVerticalSpace = true;
gridData.verticalAlignment = SWT.TOP;
table.setLayoutData(gridData);
//
PeakDetectorListUI peakDetectorListUI = new PeakDetectorListUI(composite, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
peakDetectorListUI.setEditEnabled(true);
peakDetectorListUI.setUpdateListener(new IUpdateListener() {

@Override
public void update() {

setInput();
}
});
//
Shell shell = peakDetectorListUI.getTable().getShell();
ITableSettings tableSettings = peakDetectorListUI.getTableSettings();
Expand Down
Loading

0 comments on commit 0ee0973

Please sign in to comment.