Class BrandTree

All Implemented Interfaces:
ActionListener, ItemListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, ListDataListener

public class BrandTree extends JComboTree implements ItemListener, Serializable
Portal aware Brand component. This displays the whole brand hierarchy as a tree with-in a combo box. Users can navigate through the brand tree and/or switch scope to a new brand. When the user selects a new brand, this component fires a vetoable event for the property "brand", before actually switching to a new brand scope. The APIs allows the developers to get the current active brand scope and to set to a new brand scope.
See Also:
  • Constructor Details

    • BrandTree

      public BrandTree(PortalContext ctx)
      Default constructor that creates a Brand component
  • Method Details

    • getBrands

      public TreeModel getBrands()
      Returns the Brand hierarchy in a swing TreeModel. The root node may be dummy only serving the purpose of parenting the loose brands. Use isDummy() on the root node to determine if it is just a dummy root node.
      Returns:
      TreeModel
    • reloadBrands

      public void reloadBrands()
      Reloads the Brand hierarchy from the database. This causes an opcode call be made to infranet to retrieve the brand hierarchy and update the component data. Unlike getBrands(), this forces a call to back end to get the updated brand hierarchy instead of returning one from the cache.
    • getActiveBrand

      public com.portal.permission.ScopeEntryPoint getActiveBrand()
      Returns the active brand through the ScopeEntryPoint Object. Use different methods available on ScopeEntryPoint to obtain brand name, ACL poid, etc.
      Returns:
      ScopeEntryPoint
    • lookupBrandFromPoid

      public com.portal.permission.ScopeEntryPoint lookupBrandFromPoid(Poid brandPoid)
      Used to lookup the brand that is associated with the given brand poid. The brand poid should be available as a ScopeEntryPoint in the Context.
      Parameters:
      brandPoid - The brand poid object.
      Returns:
      ScopeEntryPoint representing brand name.
    • setActiveBrand

      public boolean setActiveBrand(com.portal.permission.ScopeEntryPoint newActiveBrand)
      Sets the given brand as the new active brand in the infranet system.
      Parameters:
      ScopeEntryPoint - A Brand info object containing the brand to which the credentials/scope should be set to
      Returns:
      Returns true if active brand was set successfully, else returns false.
    • isDummyRoot

      public boolean isDummyRoot()
      Returns true if the root node of the tree model is a dummy root node only serving the purpose of parenting loose brands and account groups. (In such a case root node is invisible in the tree displayed)
    • isBrandingEnabled

      public boolean isBrandingEnabled()
      Check if branding is enabled.
      Returns:
      true if Branding is enabled, false otherwise.
    • addNotify

      public void addNotify()
      Baseclass (JComponent) override that sets a model for the View
      Overrides:
      addNotify in class JComponent
    • itemStateChanged

      public void itemStateChanged(ItemEvent e)
      Specified by:
      itemStateChanged in interface ItemListener