Package com.portal.app.comp
Class PBrandTree
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JComboBox
com.portal.pfc.ui.JComboTree
com.portal.app.comp.PBrandTree
- All Implemented Interfaces:
PAppComponent
,PClientComponent
,PComponent
,PViewDataChangeListener
,ActionListener
,ItemListener
,ImageObserver
,ItemSelectable
,MenuContainer
,Serializable
,EventListener
,Accessible
,ListDataListener
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.
- Version:
- %version: 9 % %date_modified: Mon Feb 04 08:53:20 2002 %
- Author:
- raghuv
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComboBox
JComboBox.AccessibleJComboBox, JComboBox.KeySelectionManager
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Fields inherited from class javax.swing.JComboBox
actionCommand, dataModel, editor, isEditable, keySelectionManager, lightWeightPopupEnabled, maximumRowCount, renderer, selectedItemReminder
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Baseclass (JComponent) override that sets a model for the ViewReturns the active brand through the PScopeEntryPoint Object.Returns the Brand hierarchy in a swing TreeModel.Retrieves the class name of this component's controllerRetrieves the PModelHandle for this componentGet a reference to the remote component for this object.Get the base resource name used in resource lookup.getTools()
Get a list of Actions supported by this component.boolean
Check if branding is enabled.boolean
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.boolean
isLight()
Determines if this is component defers PModelHandle knowledge to its parent container.void
lookupBrandFromPoid
(PModelHandle brandPoid) Used to lookup the brand that is associated with the given brand poid.void
Retrieves the Brand hierarchy from the database.boolean
setActiveBrand
(PScopeEntryPoint newActiveBrand) Sets the given brand as the new active brand in the infranet system.void
setModelHandle
(PModelHandle data) Establishes the PModelHandle for this componentvoid
setResourceName
(String name) Set the base resource name used in resource lookup.void
Causes this component to be disassociated from its controller (GC'd)void
Called when the view data changes.Methods inherited from class com.portal.pfc.ui.JComboTree
isRootVisible, setModel, setRootVisible
Methods inherited from class javax.swing.JComboBox
actionPerformed, actionPropertyChanged, addActionListener, addItem, addItemListener, addPopupMenuListener, configureEditor, configurePropertiesFromAction, contentsChanged, createActionPropertyChangeListener, createDefaultKeySelectionManager, fireActionEvent, fireItemStateChanged, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getAction, getActionCommand, getActionListeners, getEditor, getItemAt, getItemCount, getItemListeners, getKeySelectionManager, getMaximumRowCount, getModel, getPopupMenuListeners, getPrototypeDisplayValue, getRenderer, getSelectedIndex, getSelectedItem, getSelectedObjects, getUI, getUIClassID, hidePopup, insertItemAt, installAncestorListener, intervalAdded, intervalRemoved, isEditable, isLightWeightPopupEnabled, isPopupVisible, paramString, processKeyBinding, processKeyEvent, removeActionListener, removeAllItems, removeItem, removeItemAt, removeItemListener, removePopupMenuListener, selectedItemChanged, selectWithKeyChar, setAction, setActionCommand, setEditable, setEditor, setEnabled, setKeySelectionManager, setLightWeightPopupEnabled, setMaximumRowCount, setModel, setPopupVisible, setPrototypeDisplayValue, setRenderer, setSelectedIndex, setSelectedItem, setUI, showPopup, updateUI
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
PBrandTree
public PBrandTree()Default constructor that creates a Brand component
-
-
Method Details
-
unregister
Causes this component to be disassociated from its controller (GC'd)- Specified by:
unregister
in interfacePClientComponent
- Throws:
RemoteException
-
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
- Throws:
RemoteException
RemoteException
- invalid input: '<'>
-
retrieveBrands
Retrieves 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.- Throws:
RemoteException
RemoteException
- invalid input: '<'>
-
getActiveBrand
Returns the active brand through the PScopeEntryPoint Object. Use different methods available on PScopeEntryPoint to obtain brand name, ACL poid, etc.- Returns:
- PScopeEntryPoint
- Throws:
RemoteException
RemoteException
- invalid input: '<'>
-
lookupBrandFromPoid
Used to lookup the brand that is associated with the given brand poid. The brand poid should be available as a PScopeEntryPoint in the Context.- Parameters:
brandPoid
- A PModelHandle object representing a Brand poid object.- Returns:
- PScopeEntryPoint representing brand name.
- Throws:
RemoteException
-
setActiveBrand
Sets the given brand as the new active brand in the infranet system.- Parameters:
PScopeEntryPoint
- 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.
- Throws:
RemoteException
RemoteException
- invalid input: '<'>
-
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)- Throws:
RemoteException
-
isBrandingEnabled
Check if branding is enabled.- Returns:
- true if Branding is enabled, false otherwise.
- Throws:
RemoteException
RemoteException
- invalid input: '<'>
-
addNotify
public void addNotify()Baseclass (JComponent) override that sets a model for the View- Overrides:
addNotify
in classJComponent
-
setModelHandle
Establishes the PModelHandle for this component- Specified by:
setModelHandle
in interfacePComponent
- Parameters:
data
- The new PModelHandle from which information will be extracted.- Throws:
RemoteException
-
viewDataChange
Called when the view data changes. The component should use this to update the display- Specified by:
viewDataChange
in interfacePViewDataChangeListener
- Parameters:
event
- Data change event- Throws:
RemoteException
- Thrown for errors
-
getModelHandle
Retrieves the PModelHandle for this component- Specified by:
getModelHandle
in interfacePComponent
- Returns:
- The PModelHandle associated with this component
- Throws:
RemoteException
-
isLight
Determines if this is component defers PModelHandle knowledge to its parent container. If so, the parent container will pass the PModelHandle to this component on the server side (via the controller) saving a client/server roundtrip for data exchange. If you need to do specific processing of some kind when PModelHandle is called you'll need to subclass this component and override this method. OtherwisesetModelHandle()
will not be called.- Specified by:
isLight
in interfacePComponent
- Returns:
- true
- Throws:
RemoteException
-
getControllerClassName
Retrieves the class name of this component's controller- Specified by:
getControllerClassName
in interfacePComponent
- Returns:
- "com.portal.bas.comp.PBrandBeanImpl", the default controller for this component.
- Throws:
RemoteException
-
getTools
Get a list of Actions supported by this component. When subclassed, the overriding class should call its super class version, then add its actions to the retuned list. This preserves actions supplied by base classes. The default, supplied here, include Help for this component.- Specified by:
getTools
in interfacePClientComponent
- Returns:
- a Vector containing Action objects
-
setResourceName
Set the base resource name used in resource lookup. Basically, the resource name will be this base, followed by a dot, flowwed by the local name (label).- Specified by:
setResourceName
in interfacePClientComponent
- Parameters:
name
- The new base resource name.
-
getResourceName
Get the base resource name used in resource lookup.- Specified by:
getResourceName
in interfacePClientComponent
- Returns:
- The base resource name
- Throws:
RemoteException
-
getRemoteComponent
Get a reference to the remote component for this object. The remote component is used when interfacing with this component's controller.- Specified by:
getRemoteComponent
in interfacePAppComponent
- Returns:
- a RemoteComponent
-
itemStateChanged
- Specified by:
itemStateChanged
in interfaceItemListener
-