001: /*
002: * Copyright (c) 2005-2008 Substance Kirill Grouchnikov. All Rights Reserved.
003: *
004: * Redistribution and use in source and binary forms, with or without
005: * modification, are permitted provided that the following conditions are met:
006: *
007: * o Redistributions of source code must retain the above copyright notice,
008: * this list of conditions and the following disclaimer.
009: *
010: * o Redistributions in binary form must reproduce the above copyright notice,
011: * this list of conditions and the following disclaimer in the documentation
012: * and/or other materials provided with the distribution.
013: *
014: * o Neither the name of Substance Kirill Grouchnikov nor the names of
015: * its contributors may be used to endorse or promote products derived
016: * from this software without specific prior written permission.
017: *
018: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
019: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
020: * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
021: * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
022: * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
023: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
024: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
025: * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
026: * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
027: * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
028: * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
029: */
030: package org.jvnet.substance.plugin;
031:
032: import java.util.HashSet;
033: import java.util.Set;
034:
035: import org.jvnet.substance.skin.*;
036:
037: /**
038: * Core plugin for skins. See
039: * {@link org.jvnet.substance.plugin.SubstanceSkinPlugin} interface. This class
040: * is <b>for internal use only</b>.
041: *
042: * @author Kirill Grouchnikov.
043: */
044: public class BaseSkinPlugin implements SubstanceSkinPlugin {
045: /**
046: * Creates info object on a single skin.
047: *
048: * @param displayName
049: * Skin display name.
050: * @param skinClass
051: * Skin class.
052: * @param isDefault
053: * Indication whether the specified skin is default.
054: * @return Info object on the specified skin.
055: */
056: private static SkinInfo create(String displayName,
057: Class<?> skinClass, boolean isDefault) {
058: SkinInfo result = new SkinInfo(displayName, skinClass.getName());
059: result.setDefault(isDefault);
060: return result;
061: }
062:
063: /*
064: * (non-Javadoc)
065: *
066: * @see org.jvnet.substance.plugin.SubstanceSkinPlugin#getSkins()
067: */
068: public Set<SkinInfo> getSkins() {
069: Set<SkinInfo> result = new HashSet<SkinInfo>();
070: // result.add(create(AutumnSkin.NAME, AutumnSkin.class, false));
071: result
072: .add(create(BusinessSkin.NAME, BusinessSkin.class,
073: false));
074: result.add(create(BusinessBlackSteelSkin.NAME,
075: BusinessBlackSteelSkin.class, false));
076: result.add(create(BusinessBlueSteelSkin.NAME,
077: BusinessBlueSteelSkin.class, false));
078: result.add(create(CremeSkin.NAME, CremeSkin.class, false));
079: result
080: .add(create(ModerateSkin.NAME, ModerateSkin.class,
081: false));
082: result.add(create(SaharaSkin.NAME, SaharaSkin.class, false));
083: result.add(create(FieldOfWheatSkin.NAME,
084: FieldOfWheatSkin.class, false));
085: result.add(create(FindingNemoSkin.NAME, FindingNemoSkin.class,
086: false));
087: result.add(create(GreenMagicSkin.NAME, GreenMagicSkin.class,
088: false));
089: result.add(create(MangoSkin.NAME, MangoSkin.class, false));
090: result.add(create(MagmaSkin.NAME, MagmaSkin.class, false));
091: result.add(create(OfficeBlue2007Skin.NAME,
092: OfficeBlue2007Skin.class, false));
093: result.add(create(OfficeSilver2007Skin.NAME,
094: OfficeSilver2007Skin.class, false));
095: result.add(create(RavenSkin.NAME, RavenSkin.class, false));
096: result.add(create(RavenGraphiteSkin.NAME,
097: RavenGraphiteSkin.class, false));
098: result.add(create(RavenGraphiteGlassSkin.NAME,
099: RavenGraphiteGlassSkin.class, false));
100: result.add(create(ChallengerDeepSkin.NAME,
101: ChallengerDeepSkin.class, false));
102: result.add(create(EmeraldDuskSkin.NAME, EmeraldDuskSkin.class,
103: false));
104: result.add(create(NebulaSkin.NAME, NebulaSkin.class, false));
105: result.add(create(NebulaBrickWallSkin.NAME,
106: NebulaBrickWallSkin.class, false));
107: result.add(create(MistSilverSkin.NAME, MistSilverSkin.class,
108: false));
109: result
110: .add(create(MistAquaSkin.NAME, MistAquaSkin.class,
111: false));
112: result.add(create(AutumnSkin.NAME, AutumnSkin.class, false));
113: result.add(create(CremeCoffeeSkin.NAME, CremeCoffeeSkin.class,
114: false));
115:
116: return result;
117: }
118:
119: /*
120: * (non-Javadoc)
121: *
122: * @see org.jvnet.substance.plugin.SubstanceSkinPlugin#getDefaultSkinClassName()
123: */
124: public String getDefaultSkinClassName() {
125: return null;
126: }
127: }
|