net.sourceforge.rssowl.controller.dialog
Class ToolBarDialog

java.lang.Object
  extended by org.eclipse.jface.window.Window
      extended by org.eclipse.jface.dialogs.Dialog
          extended by net.sourceforge.rssowl.controller.dialog.ToolBarDialog
All Implemented Interfaces:
ITranslatable, org.eclipse.jface.window.IShellProvider

public class ToolBarDialog
extends org.eclipse.jface.dialogs.Dialog
implements ITranslatable

The ToolBar Dialog allows to customize the ToolBar. This includes the list of ToolItems to display and the order. In addition it is possible to add Separators between ToolItems. A dropdown allows to switch between "Icons and Text", "Text" and "Icons" display mode.

Version:
1.2.4
Author:
Benjamin Pasero

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
 
Field Summary
private  Button addSepButton
           
private static int APPLY_ID
          Apply Button Id
private  Button applyButton
           
private  Button cancelButton
           
private  java.util.ArrayList defaultOrder
           
private static int DIALOG_WIDTH
          Width of the dialog in DLUs
private  Button downButton
           
(package private)  TableItem draggedItem
           
private  DragSource dragSource
           
private  DropTarget dropTarget
           
private  java.util.HashMap itemIcons
           
(package private)  Table itemTable
           
private  Button okButton
           
private  Quickview quickview
           
(package private)  Button removeSepButton
           
private  Button restoreDefaults
           
private static java.lang.String SEPARATOR_WINGS
          Appended left and right to a Separator
private  Label separatorLabel
           
(package private)  Combo showCombo
           
private  Label showLabel
           
private  java.lang.String title
           
private  java.lang.String toolBarItems
           
private  int toolBarMode
           
static java.lang.String TOOLITEM_CLOSE
          ToolItem: Close
static java.lang.String TOOLITEM_CLOSE_ALL
          ToolItem: Close All
static java.lang.String TOOLITEM_CLOSE_OTHERS
          ToolItem: Close Others
static java.lang.String TOOLITEM_EXPORT
          ToolItem: Export
static java.lang.String TOOLITEM_FAVORITES
          ToolItem: Favorites
static java.lang.String TOOLITEM_HISTORY
          ToolItem: History
static java.lang.String TOOLITEM_IMPORT
          ToolItem: Import
static java.lang.String TOOLITEM_MARK
          ToolItem: Mark Read
static java.lang.String TOOLITEM_NEW
          ToolItem: New
static java.lang.String TOOLITEM_NEWSTIP
          ToolItem: NewsTip
static java.lang.String TOOLITEM_NEXT
          ToolItem: Next Message
static java.lang.String TOOLITEM_NEXT_TAB
          ToolItem: Next Tab
static java.lang.String TOOLITEM_PREVIOUS_TAB
          ToolItem: Previous Tab
static java.lang.String TOOLITEM_RELOAD
          ToolItem: Reload
static java.lang.String TOOLITEM_SEARCH
          ToolItem: Search
static java.lang.String TOOLITEM_SEPARATOR
          ToolItem: Separator
static java.lang.String TOOLITEM_TOOLS
          ToolItem: Tools
private  Button upButton
           
private  boolean useSmallIcons
           
(package private)  Button useSmallIconsCheck
           
 
Fields inherited from class org.eclipse.jface.dialogs.Dialog
blockedHandler, buttonBar, dialogArea, DLG_IMG_ERROR, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS
 
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK
 
Constructor Summary
ToolBarDialog(Quickview quickview, Shell parentShell, java.lang.String dialogTitle)
          Initialize a new ToolBarDialog to customize the ToolBar.
 
Method Summary
(package private)  void addSeparator()
          Add a new Separator to the current selected Index.
protected  void buttonPressed(int buttonId)
           
protected  void configureShell(Shell shell)
           
protected  void createButtonsForButtonBar(Composite parent)
           
protected  Control createDialogArea(Composite parent)
           
private  TableItem createSeparator(int index)
          Create a Separator as TableItem.
 void dispose()
          Dispose the Images used for the Item Table and the DND Support.
(package private)  void fillTable(java.lang.String toolBarItems)
          Fill the ToolBar item Table with the given Elements.
private  void flip(TableItem item1, TableItem item2)
          Copy all states of TableItem 1 into TableItem 2 and vice versa.
static java.lang.String getDefaultToolBarItems()
          Get the default ToolBar Items.
private  java.lang.String getItemStringValue()
          Get the new ToolBar as String value.
protected  int getShellStyle()
           
 java.lang.String getToolBarItems()
          Get the new ToolBar Items.
 int getToolBarMode()
          Get the new ToolBar Mode.
private  void initDefaultOrder()
          Fill a List with the default Order of ToolItems, which are not Separators.
protected  void initializeBounds()
           
private  void initItemIcons()
          Fill a Map with Images that are representing the given ToolItem.
 boolean isUseSmallIcons()
           
(package private)  void moveTableElementDown()
          Replace the selected item with the item beyond it.
(package private)  void moveTableElementUp()
          Replace the selected item with the item above it.
(package private)  void removeSeparator()
          Remove the selected Separator.
protected  void setButtonLayoutData(Button button)
          Set the layout data of the button to a GridData with appropriate widths This method was slightly modified so that it is not setting a heightHint.
protected  void setButtonLayoutData(Button button, GridData data)
          Set the layout data of the button to a GridData with appropriate heights and widths.
 void updateI18N()
          Update translation of all String literals
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonBar, createContents, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getImage, getOKButton, initializeDialogUnits, okPressed, setBlockedHandler, setButtonLayoutFormData, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getInitialLocation, getInitialSize, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOOLITEM_CLOSE

public static final java.lang.String TOOLITEM_CLOSE
ToolItem: Close

See Also:
Constant Field Values

TOOLITEM_CLOSE_ALL

public static final java.lang.String TOOLITEM_CLOSE_ALL
ToolItem: Close All

See Also:
Constant Field Values

TOOLITEM_CLOSE_OTHERS

public static final java.lang.String TOOLITEM_CLOSE_OTHERS
ToolItem: Close Others

See Also:
Constant Field Values

TOOLITEM_EXPORT

public static final java.lang.String TOOLITEM_EXPORT
ToolItem: Export

See Also:
Constant Field Values

TOOLITEM_FAVORITES

public static final java.lang.String TOOLITEM_FAVORITES
ToolItem: Favorites

See Also:
Constant Field Values

TOOLITEM_HISTORY

public static final java.lang.String TOOLITEM_HISTORY
ToolItem: History

See Also:
Constant Field Values

TOOLITEM_IMPORT

public static final java.lang.String TOOLITEM_IMPORT
ToolItem: Import

See Also:
Constant Field Values

TOOLITEM_MARK

public static final java.lang.String TOOLITEM_MARK
ToolItem: Mark Read

See Also:
Constant Field Values

TOOLITEM_NEW

public static final java.lang.String TOOLITEM_NEW
ToolItem: New

See Also:
Constant Field Values

TOOLITEM_NEWSTIP

public static final java.lang.String TOOLITEM_NEWSTIP
ToolItem: NewsTip

See Also:
Constant Field Values

TOOLITEM_NEXT

public static final java.lang.String TOOLITEM_NEXT
ToolItem: Next Message

See Also:
Constant Field Values

TOOLITEM_NEXT_TAB

public static final java.lang.String TOOLITEM_NEXT_TAB
ToolItem: Next Tab

See Also:
Constant Field Values

TOOLITEM_PREVIOUS_TAB

public static final java.lang.String TOOLITEM_PREVIOUS_TAB
ToolItem: Previous Tab

See Also:
Constant Field Values

TOOLITEM_RELOAD

public static final java.lang.String TOOLITEM_RELOAD
ToolItem: Reload

See Also:
Constant Field Values

TOOLITEM_SEARCH

public static final java.lang.String TOOLITEM_SEARCH
ToolItem: Search

See Also:
Constant Field Values

TOOLITEM_SEPARATOR

public static final java.lang.String TOOLITEM_SEPARATOR
ToolItem: Separator

See Also:
Constant Field Values

TOOLITEM_TOOLS

public static final java.lang.String TOOLITEM_TOOLS
ToolItem: Tools

See Also:
Constant Field Values

APPLY_ID

private static final int APPLY_ID
Apply Button Id

See Also:
Constant Field Values

DIALOG_WIDTH

private static final int DIALOG_WIDTH
Width of the dialog in DLUs

See Also:
Constant Field Values

SEPARATOR_WINGS

private static final java.lang.String SEPARATOR_WINGS
Appended left and right to a Separator

See Also:
Constant Field Values

addSepButton

private Button addSepButton

applyButton

private Button applyButton

cancelButton

private Button cancelButton

defaultOrder

private java.util.ArrayList defaultOrder

downButton

private Button downButton

dragSource

private DragSource dragSource

dropTarget

private DropTarget dropTarget

itemIcons

private java.util.HashMap itemIcons

okButton

private Button okButton

quickview

private Quickview quickview

restoreDefaults

private Button restoreDefaults

separatorLabel

private Label separatorLabel

showLabel

private Label showLabel

title

private java.lang.String title

toolBarItems

private java.lang.String toolBarItems

toolBarMode

private int toolBarMode

upButton

private Button upButton

useSmallIcons

private boolean useSmallIcons

draggedItem

TableItem draggedItem

itemTable

Table itemTable

removeSepButton

Button removeSepButton

showCombo

Combo showCombo

useSmallIconsCheck

Button useSmallIconsCheck
Constructor Detail

ToolBarDialog

public ToolBarDialog(Quickview quickview,
                     Shell parentShell,
                     java.lang.String dialogTitle)
Initialize a new ToolBarDialog to customize the ToolBar.

Parameters:
quickview - The ToolBar management control.
parentShell - The parent Shell of this Dialog.
dialogTitle - The Title for this Dialog.
Method Detail

getDefaultToolBarItems

public static java.lang.String getDefaultToolBarItems()
Get the default ToolBar Items.

Returns:
String The Default ToolBar Items.

dispose

public void dispose()
Dispose the Images used for the Item Table and the DND Support.


getToolBarItems

public java.lang.String getToolBarItems()
Get the new ToolBar Items.

Returns:
String The new ToolBar Items.

getToolBarMode

public int getToolBarMode()
Get the new ToolBar Mode.

Returns:
int The new ToolBar Mode.

isUseSmallIcons

public boolean isUseSmallIcons()
Returns:
TRUE if the Toolbar should use small Icons.

updateI18N

public void updateI18N()
Description copied from interface: ITranslatable
Update translation of all String literals

Specified by:
updateI18N in interface ITranslatable
See Also:
ITranslatable.updateI18N()

createSeparator

private TableItem createSeparator(int index)
Create a Separator as TableItem.

Parameters:
index - The Index this Separator will be inserted to.
Returns:
TableItem The new Separator as TableItem.

flip

private void flip(TableItem item1,
                  TableItem item2)
Copy all states of TableItem 1 into TableItem 2 and vice versa.

Parameters:
item1 - The first item to Flip.
item2 - The second item to Flip.

getItemStringValue

private java.lang.String getItemStringValue()
Get the new ToolBar as String value.

Returns:
String The new ToolBar as String value.

initDefaultOrder

private void initDefaultOrder()
Fill a List with the default Order of ToolItems, which are not Separators.


initItemIcons

private void initItemIcons()
Fill a Map with Images that are representing the given ToolItem.


buttonPressed

protected void buttonPressed(int buttonId)
Overrides:
buttonPressed in class org.eclipse.jface.dialogs.Dialog
See Also:
Dialog.buttonPressed(int)

configureShell

protected void configureShell(Shell shell)
Overrides:
configureShell in class org.eclipse.jface.window.Window
See Also:
Window.configureShell(org.eclipse.swt.widgets.Shell)

createButtonsForButtonBar

protected void createButtonsForButtonBar(Composite parent)
Overrides:
createButtonsForButtonBar in class org.eclipse.jface.dialogs.Dialog
See Also:
Dialog.createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)

createDialogArea

protected Control createDialogArea(Composite parent)
Overrides:
createDialogArea in class org.eclipse.jface.dialogs.Dialog
See Also:
Dialog.createDialogArea(org.eclipse.swt.widgets.Composite)

getShellStyle

protected int getShellStyle()
Overrides:
getShellStyle in class org.eclipse.jface.window.Window
See Also:
Window.getShellStyle()

initializeBounds

protected void initializeBounds()
Overrides:
initializeBounds in class org.eclipse.jface.dialogs.Dialog
See Also:
Dialog.initializeBounds()

setButtonLayoutData

protected void setButtonLayoutData(Button button)
Set the layout data of the button to a GridData with appropriate widths This method was slightly modified so that it is not setting a heightHint.

Overrides:
setButtonLayoutData in class org.eclipse.jface.dialogs.Dialog
Parameters:
button - The button to layout

setButtonLayoutData

protected void setButtonLayoutData(Button button,
                                   GridData data)
Set the layout data of the button to a GridData with appropriate heights and widths.

Parameters:
button - The button to set the layoutdata
data - The GridData to use

addSeparator

void addSeparator()
Add a new Separator to the current selected Index.


fillTable

void fillTable(java.lang.String toolBarItems)
Fill the ToolBar item Table with the given Elements.

Parameters:
toolBarItems - A String describing the ToolBar items.

moveTableElementDown

void moveTableElementDown()
Replace the selected item with the item beyond it.


moveTableElementUp

void moveTableElementUp()
Replace the selected item with the item above it.


removeSeparator

void removeSeparator()
Remove the selected Separator.



RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo