blob: 01eb75c284ee3a53ef56aa4013bf57a64957d432 [file] [log] [blame]
/**
*
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* 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:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*/
package org.eclipse.osbp.preferences.ui.component;
import org.eclipse.core.resources.IProject;
import org.eclipse.osbp.preferences.ui.data.ProductConfigurationStore;
import org.eclipse.osbp.preferences.ui.utils.ApplicationProjectInspector;
import org.eclipse.osbp.preferences.ui.utils.ConfigurationFileVerifier.ConfigurationFileDescription;
import org.eclipse.osbp.preferences.ui.utils.ManifestFileVerifier;
import org.eclipse.swt.widgets.Composite;
public class ProductConfigurationFieldEditor extends ATableTreeFieldEditor {
public ProductConfigurationFieldEditor(String name, String labelText, Composite parent) {
super(name, labelText, parent, ConfigurationFileDescription.INSTANCE);
}
@Override
protected void _doLoad(String value, String defaults) {
IProject productProject = ((ProductConfigurationStore)getPreferenceStore()).getProject();
String productFileName = ((ProductConfigurationStore)getPreferenceStore()).getProductFileName();
if ((productProject != null) && !productFileName.isEmpty()) {
ApplicationProjectInspector inspector = new ApplicationProjectInspector(productProject, productFileName);
if (inspector.isApplicationProject()) {
new TableTreeDescribedItem(this, inspector.getProductConfigurations(), null);
new TableTreeDescribedItem(this, inspector.getProductPlugins(), null);
new TableTreeDescribedItem(this, inspector.getProductManifest(), null);
for (ManifestFileVerifier bundle : inspector.getManifestVerifiers()) {
new TableTreeDescribedItem(this, bundle, null);
}
}
}
}
@Override
protected String _doStore() {
return null;
}
@Override
protected boolean hasRemoveButton() {
return false;
}
@Override
protected boolean hasAddButton() {
return false;
}
}