com.almworks.jira.structure.api.settings
Enum AutoSwitchStrategy

java.lang.Object
  extended by java.lang.Enum<AutoSwitchStrategy>
      extended by com.almworks.jira.structure.api.settings.AutoSwitchStrategy
All Implemented Interfaces:
Serializable, Comparable<AutoSwitchStrategy>

public enum AutoSwitchStrategy
extends Enum<AutoSwitchStrategy>

AutoSwitchStrategy enum defines how the initial structure is selected when the user opens issue page or project page.

Author:
Igor Sereda
See Also:
UISettings, StructureConfiguration.getUISettings(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.project.Project)

Enum Constant Summary
AUTOSWITCH_OFF
          When auto-switch is turned off, the "current" structure is opened on the page.
DEFAULT_STRUCTURE
          When auto-switch is set to DEFAULT_STRUCTURE, the default structure is always displayed when the issue or project page is opened.
STRUCTURE_WITH_ISSUE
          When auto-switch is set to STRUCTURE_WITH_ISSUE, the structure displayed on the issue page will be the structure that contains that issue.
 
Field Summary
static AutoSwitchStrategy PLUGIN_DEFAULT_AUTOSWITCH_STRATEGY
          Defines system default auto-switch strategy for an issue page.
 
Method Summary
static AutoSwitchStrategy fromStringCode(String code)
           
 String getStringCode()
           
static AutoSwitchStrategy valueOf(String name)
          Returns the enum constant of this type with the specified name.
static AutoSwitchStrategy[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

AUTOSWITCH_OFF

public static final AutoSwitchStrategy AUTOSWITCH_OFF
When auto-switch is turned off, the "current" structure is opened on the page. Current structure is usually the last structure that the user has viewed.


STRUCTURE_WITH_ISSUE

public static final AutoSwitchStrategy STRUCTURE_WITH_ISSUE

When auto-switch is set to STRUCTURE_WITH_ISSUE, the structure displayed on the issue page will be the structure that contains that issue.

If the issue belongs to several structures (viewable by the user), or if it does not belong to any, the behavior is not contractually defined. The implementation may make "best guess", based on the "current" structure (the last structure the user has viewed) and the default structure for the project.

This value does not make sense for the pages other than StructurePage.ISSUE_VIEW.


DEFAULT_STRUCTURE

public static final AutoSwitchStrategy DEFAULT_STRUCTURE
When auto-switch is set to DEFAULT_STRUCTURE, the default structure is always displayed when the issue or project page is opened. The default structure for the viewed project (or the project of the viewed issue) will be used.

See Also:
StructureConfiguration.getDefaultStructureId(com.atlassian.jira.project.Project)
Field Detail

PLUGIN_DEFAULT_AUTOSWITCH_STRATEGY

public static final AutoSwitchStrategy PLUGIN_DEFAULT_AUTOSWITCH_STRATEGY
Defines system default auto-switch strategy for an issue page.

Method Detail

values

public static AutoSwitchStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (AutoSwitchStrategy c : AutoSwitchStrategy.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static AutoSwitchStrategy valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getStringCode

public String getStringCode()
Returns:
a string that identifies this strategy (for serialization)

fromStringCode

@Nullable
public static AutoSwitchStrategy fromStringCode(String code)
Returns:
an auto-switch strategy with the matching code, or null if none exists (for serialization)


Copyright © 2013 ALMWorks. All Rights Reserved.