| /** |
| * |
| * 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.utils; |
| |
| import java.util.ArrayList; |
| import java.util.List; |
| |
| import org.eclipse.core.resources.IProject; |
| import org.eclipse.osbp.preferences.AItemDescribed; |
| import org.eclipse.osbp.preferences.ItemDescription; |
| import org.eclipse.osbp.preferences.ui.component.APreferencePage; |
| |
| /** |
| * Abstract class for any existing configuration file verifier. |
| * The class implements all necessary interfaces to be displayed in a property page. |
| */ |
| public abstract class ConfigurationFileVerifier extends AItemDescribed { |
| |
| /** Message: no problems found! */ |
| protected final static String MSG_NO_PROBLEMS_FOUND = "- No problems found."; |
| |
| /** TODO: Message for any verifier, which has functionality to be implemented! */ |
| @Deprecated |
| protected final static String MSG_TO_BE_IMPLEMENTED = "- To be implemented!"; |
| |
| /** <b>the</b> OSBP product project to be verified */ |
| protected final IProject project; |
| |
| /** icon name for the icon to be displayed to symbolize the result of verification */ |
| protected String iconName; |
| |
| /** list of found problematic items */ |
| protected List<SubItem> subItems; |
| |
| /** |
| * description of the table tree columns |
| */ |
| public static final class ConfigurationFileDescription extends ItemDescription { |
| |
| public static final ConfigurationFileDescription INSTANCE = new ConfigurationFileDescription(); |
| |
| private static final String ROW_NAME = "Configuration"; |
| |
| protected ConfigurationFileDescription() { |
| super(ROW_NAME); |
| } |
| } |
| |
| /** |
| * The relevant information will be loaded corresponding of the type of configuration file. |
| * @param project <b>the</b> OSBP product project to be verified |
| */ |
| public ConfigurationFileVerifier(IProject project) { |
| super(ConfigurationFileDescription.INSTANCE); |
| this.project = project; |
| iconName = APreferencePage.STATUS_TODO; |
| subItems = new ArrayList<AItemDescribed.SubItem>(); |
| } |
| |
| public IProject getProject() { |
| return project; |
| } |
| |
| @Override |
| public String getIconName() { |
| return iconName; |
| } |
| |
| @Override |
| public SubItem[] getSubItems() { |
| return subItems.toArray(new SubItem[0]); |
| } |
| |
| @Override |
| @Deprecated |
| protected String _serialize() { |
| return null; |
| } |
| |
| @Override |
| @Deprecated |
| protected AItemDescribed _deserialize(String serialized) { |
| return null; |
| } |
| |
| @Override |
| @Deprecated |
| public void setName(String name) { |
| } |
| |
| @Override |
| @Deprecated |
| public String getValue(String attribute) { |
| return null; |
| } |
| |
| @Override |
| @Deprecated |
| public void setValue(String attribute, String value) { |
| } |
| } |