| /** |
| * |
| * 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.wizard.ui.theme; |
| |
| import org.eclipse.osbp.wizard.ui.basic.CommonProjectWizardTranslator; |
| import org.eclipse.osbp.wizard.ui.basic.IProjectMasterTemplate; |
| |
| |
| /** |
| * Wizard master templates available in this wizard implementation. |
| */ |
| public enum ThemeProjectMasterTemplate implements IProjectMasterTemplate { |
| /** The OSBP default theme. */ |
| OSBPDEFAULT |
| ; |
| |
| @Override |
| public String getDescription() { |
| return CommonProjectWizardTranslator.instance().getDocumentation(ThemeProjectMasterTemplate.class, toString()); |
| } |
| |
| /** |
| * Find the template by text, either as item name or as item description. |
| * @param text searching |
| * @return the theme project master template |
| */ |
| public static ThemeProjectMasterTemplate byText(String text) { |
| for (ThemeProjectMasterTemplate item : values()) { |
| if (text.equals(item.toString())) { |
| return item; |
| } |
| if (text.equals(item.getDescription())) { |
| return item; |
| } |
| } |
| return OSBPDEFAULT; |
| } |
| |
| @Override |
| public int compare(IProjectMasterTemplate template1, IProjectMasterTemplate template2) { |
| return template1.getDescription().compareTo(template2.getDescription()); |
| } |
| } |