name.dhiller.jBorderLiner
Class BL_ToolbarItem

java.lang.Object
  extended by name.dhiller.jBorderLiner.BL_ToolbarItem
Direct Known Subclasses:
BL_TB_ActiveBtn, BL_TB_ApplyToBtn, BL_TB_LSPreviewBtn, BL_TB_SelectColorBtn, BL_TB_SelectLSBtn, BL_TB_SelectLWBtn

abstract class BL_ToolbarItem
extends Object

ToolbarItem this concept could cause problems in a multi-thread / multi-frame environment see Developer's Guide, p. 277 (4.7.1. Protocol Handler)

Since:
OOo 2.0.3 (controlCommand)
Version:
080117
Author:
dhiller

Field Summary
private  boolean bEnabled
           
private  Vector contextAssignment
           
(package private)  com.sun.star.util.URL m_URL
           
 
Constructor Summary
BL_ToolbarItem()
          Creates a new instance of BL_ToolbarItem
 
Method Summary
(package private)  void changeStatusFrame(com.sun.star.frame.XFrame xFrame, com.sun.star.frame.FeatureStateEvent aState)
          change the status of a toolbaritem of a particular Frame
(package private)  void dispatch(com.sun.star.util.URL aURL, com.sun.star.beans.PropertyValue[] aArguments)
           
(package private)  com.sun.star.frame.XStatusListener GetControl(com.sun.star.frame.XFrame xFrame)
          get the control of a frame
(package private)  ContextElement getControlElement(com.sun.star.frame.XStatusListener xControl)
          checks, if context already exists.
(package private)  ContextElement getControlElementFromFrame(com.sun.star.frame.XFrame xFrame)
          gets the controlElement from the frame
(package private)  com.sun.star.frame.XFrame GetFrame(com.sun.star.frame.XStatusListener xControl)
          get the frame of a control
private  int hasContext(com.sun.star.frame.XStatusListener xControl)
          checks, if context already exists.
(package private)  void Init(com.sun.star.frame.XFrame xFrame, com.sun.star.frame.XStatusListener xControl, com.sun.star.util.URL aURL, Object oObject)
          Initialize a toolbar item
(package private)  void removeContext(com.sun.star.frame.XStatusListener xControl, com.sun.star.util.URL aURL)
          remove context (e.g. window was closed)
(package private)  void SendCommandTo(com.sun.star.frame.XStatusListener xControl, String rCommand, com.sun.star.beans.NamedValue[] rArgs)
          send a command to a particular control
(package private)  void sendCommandToAll(String command, com.sun.star.beans.NamedValue[] rArgs)
          send a command to all xControl(s)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_URL

com.sun.star.util.URL m_URL

contextAssignment

private Vector contextAssignment

bEnabled

private boolean bEnabled
Constructor Detail

BL_ToolbarItem

BL_ToolbarItem()
Creates a new instance of BL_ToolbarItem

Method Detail

Init

void Init(com.sun.star.frame.XFrame xFrame,
          com.sun.star.frame.XStatusListener xControl,
          com.sun.star.util.URL aURL,
          Object oObject)
Initialize a toolbar item

Parameters:
aFrame - Frame of Control
xControl - - unique identifier of toolbar per document
aURL - - URL of that feature (unique identifier of item within toolbar, not per document)
oObject - - Object linked to that toolbar item

dispatch

void dispatch(com.sun.star.util.URL aURL,
              com.sun.star.beans.PropertyValue[] aArguments)

sendCommandToAll

final void sendCommandToAll(String command,
                            com.sun.star.beans.NamedValue[] rArgs)
send a command to all xControl(s)

Parameters:
command - - e.g. "SetValues"
rArgs - - e.g. "Value" - icurrentLineStyle

SendCommandTo

final void SendCommandTo(com.sun.star.frame.XStatusListener xControl,
                         String rCommand,
                         com.sun.star.beans.NamedValue[] rArgs)
send a command to a particular control

Parameters:
xControl - Control to send command to
rCommand - Command
rArgs - command specific arguments

removeContext

final void removeContext(com.sun.star.frame.XStatusListener xControl,
                         com.sun.star.util.URL aURL)
remove context (e.g. window was closed)

Parameters:
xControl - - control to be removed
aURL - - URL, not used

hasContext

private final int hasContext(com.sun.star.frame.XStatusListener xControl)
checks, if context already exists. This is necessary, since equals of the Elements is not overwritten

Parameters:
xControl -
Returns:
index where xControl is in the list

getControlElement

final ContextElement getControlElement(com.sun.star.frame.XStatusListener xControl)
checks, if context already exists. This is necessary, since equals of the Elements is not overwritten

Parameters:
xControl -
Returns:
index where xControl is in the list

GetFrame

final com.sun.star.frame.XFrame GetFrame(com.sun.star.frame.XStatusListener xControl)
get the frame of a control

Parameters:
xControl - Control to get the frame for
Returns:
XFrame of that control

changeStatusFrame

final void changeStatusFrame(com.sun.star.frame.XFrame xFrame,
                             com.sun.star.frame.FeatureStateEvent aState)
change the status of a toolbaritem of a particular Frame

Parameters:
xFrame - Frame to send command to
aState - new FeatureState

GetControl

final com.sun.star.frame.XStatusListener GetControl(com.sun.star.frame.XFrame xFrame)
get the control of a frame

Parameters:
XFrame - Frame to get the control for
Returns:
xControl control of that frame

getControlElementFromFrame

final ContextElement getControlElementFromFrame(com.sun.star.frame.XFrame xFrame)
gets the controlElement from the frame

Parameters:
XFrame -
Returns:
ControlElement or null if frame does not exist