[]
        
(Showing Draft Content)

Themes

Class Themes

java.lang.Object
com.grapecity.documents.excel.Themes

public class Themes extends Object
Represents a theme manager.

Use this class to access themes by name and to create custom themes that can be applied to a workbook. A Themes instance can retrieve built-in themes and custom themes added to the manager.


 Themes themes = new Themes();
 ITheme theme = themes.get(Themes.GetBerlin().getName());
 workbook.setTheme(theme);
 
  • Constructor Details

    • Themes

      public Themes()
  • Method Details

    • get

      public final ITheme get(String name)
      Gets the theme with the specified name.

      This method searches built-in themes first and then searches custom themes added to this Themes collection. Theme name matching is case-insensitive, and leading and trailing whitespace in name are ignored.

      
       Themes themes = new Themes();
       ITheme theme = themes.get(Themes.GetOfficeTheme().getName());
       workbook.setTheme(theme);
       
      Parameters:
      name - The theme name to search for. Must not be null; leading and trailing whitespace is ignored.
      Returns:
      The matching ITheme, or null if no built-in or custom theme matches the specified name.
      Throws:
      NullPointerException - if name is null.
    • add

      public ITheme add(String themeName, ITheme baseTheme)
      Creates a new custom theme based on the specified base theme.

      If baseTheme is null, the new theme is created from the Office theme. If themeName is null or empty, a unique custom theme name is generated automatically.

      
       Themes themes = new Themes();
       ITheme baseTheme = Themes.GetBadge();
       ITheme customTheme = themes.add("Custom Badge", baseTheme);
       workbook.setTheme(customTheme);
       
      Parameters:
      themeName - The name of the new theme. If null or empty, a unique name is generated. If non-empty, it must not match a built-in or existing custom theme name ignoring case.
      baseTheme - The theme to copy as the base for the new theme. If null, the Office theme is used.
      Returns:
      The newly created ITheme.
      Throws:
      IllegalArgumentException - if themeName is non-empty and is not a valid theme name.
    • add

      public ITheme add(String themeName)
      Creates a new theme with the specified name.

      This method forwards to add(String,ITheme) with null as the base theme, so the new theme is created from the Office theme and added to this Themes collection.

      
       Themes themes = new Themes();
       ITheme theme = themes.add("Custom Theme");
       workbook.setTheme(theme);
       
      Parameters:
      themeName - The name of the new theme. If null or empty, a custom theme name is generated automatically. If non-empty, the name must be valid.
      Returns:
      The newly created ITheme.
      Throws:
      IllegalArgumentException - if themeName is non-empty and is not a valid theme name.
    • getCount

      public final int getCount()
      Gets the number of themes in this theme collection.

      The returned value includes both the built-in themes and any custom themes added to the collection.

      
       Themes themes = new Themes();
       themes.add("Custom Theme");
       int count = themes.getCount();
       
      Returns:
      The total number of themes in the collection.
    • GetOfficeTheme

      public static ITheme GetOfficeTheme()
      Specifies the Office theme.
      
       ITheme theme = Themes.GetOfficeTheme();
       workbook.setTheme(theme);
       
      Returns:
      The Office theme.
    • GetBadge

      public static ITheme GetBadge()
      Specifies the Badge theme.
      
       ITheme theme = Themes.GetBadge();
       workbook.setTheme(theme);
       
      Returns:
      The Badge theme.
    • GetBanded

      public static ITheme GetBanded()
      Specifies the Banded theme.
      
       ITheme theme = Themes.GetBanded();
       workbook.setTheme(theme);
       
      Returns:
      The Banded theme.
    • GetBasis

      public static ITheme GetBasis()
      Specifies the Basis theme.
      
       ITheme theme = Themes.GetBasis();
       workbook.setTheme(theme);
       
      Returns:
      The Basis theme.
    • GetBerlin

      public static ITheme GetBerlin()
      Specifies the Berlin theme.
      
       ITheme theme = Themes.GetBerlin();
       workbook.setTheme(theme);
       
      Returns:
      The Berlin theme.
    • GetCelestial

      public static ITheme GetCelestial()
      Specifies the Celestial theme.
      
       ITheme theme = Themes.GetCelestial();
       workbook.setTheme(theme);
       
      Returns:
      The Celestial theme.
    • GetCircuit

      public static ITheme GetCircuit()
      Specifies the Circuit theme.
      
       ITheme theme = Themes.GetCircuit();
       workbook.setTheme(theme);
       
      Returns:
      The Circuit theme.
    • GetCrop

      public static ITheme GetCrop()
      Specifies the Crop theme.
      
       ITheme theme = Themes.GetCrop();
       workbook.setTheme(theme);
       
      Returns:
      The Crop theme.
    • GetDamask

      public static ITheme GetDamask()
      Specifies the Damask theme.
      
       ITheme theme = Themes.GetDamask();
       workbook.setTheme(theme);
       
      Returns:
      The Damask theme.
    • GetDepth

      public static ITheme GetDepth()
      Specifies the Depth theme.
      
       ITheme theme = Themes.GetDepth();
       workbook.setTheme(theme);
       
      Returns:
      The Depth theme.
    • GetDividend

      public static ITheme GetDividend()
      Specifies the Dividend theme.
      
       ITheme theme = Themes.GetDividend();
       workbook.setTheme(theme);
       
      Returns:
      The Dividend theme.
    • GetDroplet

      public static ITheme GetDroplet()
      Specifies the Droplet theme.
      
       ITheme theme = Themes.GetDroplet();
       workbook.setTheme(theme);
       
      Returns:
      The Droplet theme.
    • GetFacet

      public static ITheme GetFacet()
      Specifies the Facet theme.
      
       ITheme theme = Themes.GetFacet();
       workbook.setTheme(theme);
       
      Returns:
      The Facet theme.
    • GetFeathered

      public static ITheme GetFeathered()
      Specifies the Feathered theme.
      
       ITheme theme = Themes.GetFeathered();
       workbook.setTheme(theme);
       
      Returns:
      The Feathered theme.
    • GetFrame

      public static ITheme GetFrame()
      Specifies the Frame theme.
      
       ITheme theme = Themes.GetFrame();
       workbook.setTheme(theme);
       
      Returns:
      The Frame theme.
    • GetGallery

      public static ITheme GetGallery()
      Specifies the Gallery theme.
      
       ITheme theme = Themes.GetGallery();
       workbook.setTheme(theme);
       
      Returns:
      The Gallery theme.
    • GetHeadlines

      public static ITheme GetHeadlines()
      Specifies the Headlines theme.
      
       ITheme theme = Themes.GetHeadlines();
       workbook.setTheme(theme);
       
      Returns:
      The Headlines theme.
    • GetIntegral

      public static ITheme GetIntegral()
      Specifies the Integral theme.
      
       ITheme theme = Themes.GetIntegral();
       workbook.setTheme(theme);
       
      Returns:
      The Integral theme.
    • GetIonBoardroom

      public static ITheme GetIonBoardroom()
      Specifies the IonBoardroom theme.
      
       ITheme theme = Themes.GetIonBoardroom();
       workbook.setTheme(theme);
       
      Returns:
      The IonBoardroom theme.
    • GetIon

      public static ITheme GetIon()
      Specifies the Ion theme.
      
       ITheme theme = Themes.GetIon();
       workbook.setTheme(theme);
       
      Returns:
      The Ion theme.
    • GetMainEvent

      public static ITheme GetMainEvent()
      Specifies the MainEvent theme.
      
       ITheme theme = Themes.GetMainEvent();
       workbook.setTheme(theme);
       
      Returns:
      The MainEvent theme.
    • GetMesh

      public static ITheme GetMesh()
      Specifies the Mesh theme.
      
       ITheme theme = Themes.GetMesh();
       workbook.setTheme(theme);
       
      Returns:
      The Mesh theme.
    • GetMetropolitan

      public static ITheme GetMetropolitan()
      Specifies the Metropolitan theme.
      
       ITheme theme = Themes.GetMetropolitan();
       workbook.setTheme(theme);
       
      Returns:
      The Metropolitan theme.
    • GetOrganic

      public static ITheme GetOrganic()
      Specifies the Organic theme.
      
       ITheme theme = Themes.GetOrganic();
       workbook.setTheme(theme);
       
      Returns:
      The Organic theme.
    • GetParcel

      public static ITheme GetParcel()
      Specifies the Parcel theme.
      
       ITheme theme = Themes.GetParcel();
       workbook.setTheme(theme);
       
      Returns:
      The Parcel theme.
    • GetParallax

      public static ITheme GetParallax()
      Specifies the Parallax theme.
      
       ITheme theme = Themes.GetParallax();
       workbook.setTheme(theme);
       
      Returns:
      The Parallax theme.
    • GetQuotable

      public static ITheme GetQuotable()
      Specifies the Quotable theme.
      
       ITheme theme = Themes.GetQuotable();
       workbook.setTheme(theme);
       
      Returns:
      The Quotable theme.
    • GetRetrospect

      public static ITheme GetRetrospect()
      Specifies the Retrospect theme.
      
       ITheme theme = Themes.GetRetrospect();
       workbook.setTheme(theme);
       
      Returns:
      The Retrospect theme.
    • GetSavon

      public static ITheme GetSavon()
      Specifies the Savon theme.
      
       ITheme theme = Themes.GetSavon();
       workbook.setTheme(theme);
       
      Returns:
      The Savon theme.
    • GetSlate

      public static ITheme GetSlate()
      Specifies the Slate theme.
      
       ITheme theme = Themes.GetSlate();
       workbook.setTheme(theme);
       
      Returns:
      The Slate theme.
    • GetSlice

      public static ITheme GetSlice()
      Specifies the Slice theme.
      
       ITheme theme = Themes.GetSlice();
       workbook.setTheme(theme);
       
      Returns:
      The Slice theme.
    • GetVaporTrail

      public static ITheme GetVaporTrail()
      Specifies the VaporTrail theme.
      
       ITheme theme = Themes.GetVaporTrail();
       workbook.setTheme(theme);
       
      Returns:
      The VaporTrail theme.
    • GetView

      public static ITheme GetView()
      Specifies the View theme.
      
       ITheme theme = Themes.GetView();
       workbook.setTheme(theme);
       
      Returns:
      The View theme.
    • GetWisp

      public static ITheme GetWisp()
      Specifies the Wisp theme.
      
       ITheme theme = Themes.GetWisp();
       workbook.setTheme(theme);
       
      Returns:
      The Wisp theme.
    • GetWoodType

      public static ITheme GetWoodType()
      Specifies the WoodType theme.
      
       ITheme theme = Themes.GetWoodType();
       workbook.setTheme(theme);
       
      Returns:
      The WoodType theme.
    • GetOffice2007

      public static ITheme GetOffice2007()
      Specifies the Office2007.
      
       ITheme theme = Themes.GetOffice2007();
       workbook.setTheme(theme);
       
      Returns:
      The Office2007.
    • GetApex

      public static ITheme GetApex()
      Specifies the Apex theme.
      
       ITheme theme = Themes.GetApex();
       workbook.setTheme(theme);
       
      Returns:
      The Apex theme.
    • GetAspect

      public static ITheme GetAspect()
      Specifies the Aspect theme.
      
       ITheme theme = Themes.GetAspect();
       workbook.setTheme(theme);
       
      Returns:
      The Aspect theme.
    • GetCivic

      public static ITheme GetCivic()
      Specifies the Civic theme.
      
       ITheme theme = Themes.GetCivic();
       workbook.setTheme(theme);
       
      Returns:
      The Civic theme.
    • GetConcourse

      public static ITheme GetConcourse()
      Specifies the Concourse theme.
      
       ITheme theme = Themes.GetConcourse();
       workbook.setTheme(theme);
       
      Returns:
      The Concourse theme.
    • GetEquity

      public static ITheme GetEquity()
      Specifies the Equity theme.
      
       ITheme theme = Themes.GetEquity();
       workbook.setTheme(theme);
       
      Returns:
      The Equity theme.
    • GetFlow

      public static ITheme GetFlow()
      Specifies the Flow theme.
      
       ITheme theme = Themes.GetFlow();
       workbook.setTheme(theme);
       
      Returns:
      The Flow theme.
    • GetFoundry

      public static ITheme GetFoundry()
      Specifies the Foundry theme.
      
       ITheme theme = Themes.GetFoundry();
       workbook.setTheme(theme);
       
      Returns:
      The Foundry theme.
    • GetMedian

      public static ITheme GetMedian()
      Specifies the Median theme.
      
       ITheme theme = Themes.GetMedian();
       workbook.setTheme(theme);
       
      Returns:
      The Median theme.
    • GetMetro

      public static ITheme GetMetro()
      Specifies the Metro theme.
      
       ITheme theme = Themes.GetMetro();
       workbook.setTheme(theme);
       
      Returns:
      The Metro theme.
    • GetModule

      public static ITheme GetModule()
      Specifies the Module theme.
      
       ITheme theme = Themes.GetModule();
       workbook.setTheme(theme);
       
      Returns:
      The Module theme.
    • GetOpulent

      public static ITheme GetOpulent()
      Specifies the Opulent theme.
      
       ITheme theme = Themes.GetOpulent();
       workbook.setTheme(theme);
       
      Returns:
      The Opulent theme.
    • GetOriel

      public static ITheme GetOriel()
      Specifies the Oriel theme.
      
       ITheme theme = Themes.GetOriel();
       workbook.setTheme(theme);
       
      Returns:
      The Oriel theme.
    • GetOrigin

      public static ITheme GetOrigin()
      Specifies the Origin theme.
      
       ITheme theme = Themes.GetOrigin();
       workbook.setTheme(theme);
       
      Returns:
      The Origin theme.
    • GetPaper

      public static ITheme GetPaper()
      Specifies the Paper theme.
      
       ITheme theme = Themes.GetPaper();
       workbook.setTheme(theme);
       
      Returns:
      The Paper theme.
    • GetSolstice

      public static ITheme GetSolstice()
      Specifies the Solstice theme.
      
       ITheme theme = Themes.GetSolstice();
       workbook.setTheme(theme);
       
      Returns:
      The Solstice theme.
    • GetTechnic

      public static ITheme GetTechnic()
      Specifies the Technic theme.
      
       ITheme theme = Themes.GetTechnic();
       workbook.setTheme(theme);
       
      Returns:
      The Technic theme.
    • GetTrek

      public static ITheme GetTrek()
      Specifies the Trek theme.
      
       ITheme theme = Themes.GetTrek();
       workbook.setTheme(theme);
       
      Returns:
      The Trek theme.
    • GetUrban

      public static ITheme GetUrban()
      Specifies the Urban theme.
      
       ITheme theme = Themes.GetUrban();
       workbook.setTheme(theme);
       
      Returns:
      The Urban theme.
    • GetVerve

      public static ITheme GetVerve()
      Specifies the Verve theme.
      
       ITheme theme = Themes.GetVerve();
       workbook.setTheme(theme);
       
      Returns:
      The Verve theme.