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

Added a table input to the Peak Compensation Quantifier #304

Merged
merged 1 commit into from
Sep 12, 2022
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,13 @@
type="org.eclipse.chemclipse.ux.extension.xxd.ui.methods.SettingsUIProvider">
</adapter>
</factory>
<factory
adaptableType="net.openchrom.xxd.process.supplier.templates.settings.CompensationQuantifierSettings"
class="net.openchrom.xxd.process.supplier.templates.ui.adapter.CompensationQuantifierSettingsAdapterFactory">
<adapter
type="org.eclipse.chemclipse.ux.extension.xxd.ui.methods.SettingsUIProvider">
</adapter>
</factory>
</extension>
<extension
point="org.eclipse.help.toc">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*******************************************************************************
* Copyright (c) 2020, 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:
* Christoph Läubrich - initial API and implementation
* Philip Wenig - enable profiles
*******************************************************************************/
package net.openchrom.xxd.process.supplier.templates.ui.adapter;

import java.io.IOException;

import org.eclipse.chemclipse.processing.supplier.IProcessorPreferences;
import org.eclipse.chemclipse.ux.extension.xxd.ui.methods.SettingsUIProvider;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.swt.widgets.Composite;

import net.openchrom.xxd.process.supplier.templates.settings.CompensationQuantifierSettings;
import net.openchrom.xxd.process.supplier.templates.ui.swt.CompensationQuantifierEditor;

public class CompensationQuantifierSettingsAdapterFactory implements IAdapterFactory {

@Override
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {

if(adaptableObject instanceof CompensationQuantifierSettings settings) {
if(adapterType == SettingsUIProvider.class) {
return adapterType.cast(createSettingsUIProvider(settings));
}
}
return null;
}

private static SettingsUIProvider<CompensationQuantifierSettings> createSettingsUIProvider(CompensationQuantifierSettings adaptedSettings) {

return new SettingsUIProvider<CompensationQuantifierSettings>() {

@Override
public SettingsUIProvider.SettingsUIControl createUI(Composite parent, IProcessorPreferences<CompensationQuantifierSettings> preferences, boolean showProfileToolbar) throws IOException {

CompensationQuantifierSettings userSettings = preferences.getUserSettings();
return new CompensationQuantifierEditor(parent, preferences, userSettings == null ? adaptedSettings : userSettings);
}
};
}

@Override
public Class<?>[] getAdapterList() {

return new Class<?>[]{SettingsUIProvider.class};
}
}
Loading