org.openoffice.ide.eclipse.core.unotypebrowser
Class UnoTypeBrowser

java.lang.Object
  extended by org.eclipse.jface.window.Window
      extended by org.eclipse.jface.dialogs.Dialog
          extended by org.eclipse.jface.dialogs.TrayDialog
              extended by org.eclipse.jface.dialogs.StatusDialog
                  extended by org.openoffice.ide.eclipse.core.unotypebrowser.UnoTypeBrowser
All Implemented Interfaces:
org.eclipse.jface.window.IShellProvider, IFieldChangedListener, IInitListener

public class UnoTypeBrowser
extends org.eclipse.jface.dialogs.StatusDialog
implements IFieldChangedListener, IInitListener

A dialog to browse UNO types. This class doesn't launch the types query: this job is performed by the UNO type provider to avoid very slow window rendering.

Author:
cedricbosdo

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
 
Field Summary
 
Fields inherited from class org.eclipse.jface.dialogs.Dialog
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, 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
UnoTypeBrowser(org.eclipse.swt.widgets.Shell pParentShell, int pAllowedTypes)
          Creates a new browser dialog.
 
Method Summary
 void activateFields(boolean pActivate)
          Method to activate or unactivate the dialog fields.
protected  void createButtonsForButtonBar(org.eclipse.swt.widgets.Composite pParent)
          
protected  org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite pParent)
          
 void fieldChanged(FieldEvent pEvent)
          Method called when the row has changed.
 InternalUnoType getSelectedType()
           
 void initialized()
          Method called when the UnoTypeProvider is initialized.
protected  void okPressed()
          
 void setSelectedType(InternalUnoType pType)
          Set the type selected in the list.
 
Methods inherited from class org.eclipse.jface.dialogs.StatusDialog
configureShell, create, createButtonBar, getStatus, setImage, setStatusLineAboveButtons, setTitle, updateButtonsEnableState, updateStatus
 
Methods inherited from class org.eclipse.jface.dialogs.TrayDialog
close, closeTray, createHelpControl, getLayout, getTray, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailable
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, buttonPressed, cancelPressed, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, createButton, createContents, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getInitialSize, getOKButton, initializeBounds, initializeDialogUnits, isResizable, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, 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
 

Constructor Detail

UnoTypeBrowser

public UnoTypeBrowser(org.eclipse.swt.widgets.Shell pParentShell,
                      int pAllowedTypes)
Creates a new browser dialog. The browser, waits for the type provider to finish its work if it's not already over.

Parameters:
pParentShell - the shell where to create the dialog
pAllowedTypes - the bit-ORed allowed types
Method Detail

createButtonsForButtonBar

protected void createButtonsForButtonBar(org.eclipse.swt.widgets.Composite pParent)

Overrides:
createButtonsForButtonBar in class org.eclipse.jface.dialogs.StatusDialog

createDialogArea

protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite pParent)

Overrides:
createDialogArea in class org.eclipse.jface.dialogs.Dialog

initialized

public void initialized()
Method called when the UnoTypeProvider is initialized.

Specified by:
initialized in interface IInitListener

activateFields

public void activateFields(boolean pActivate)
Method to activate or unactivate the dialog fields. This method should be used when long operations are performed.

Parameters:
pActivate - true to activate all the fields, false to set the fields as not active.

okPressed

protected void okPressed()

Overrides:
okPressed in class org.eclipse.jface.dialogs.Dialog

fieldChanged

public void fieldChanged(FieldEvent pEvent)
Method called when the row has changed.

Specified by:
fieldChanged in interface IFieldChangedListener
Parameters:
pEvent - the field event thrown

getSelectedType

public InternalUnoType getSelectedType()
Returns:
the selected InternalUnoType.

setSelectedType

public void setSelectedType(InternalUnoType pType)
Set the type selected in the list.

Parameters:
pType - the type which should be selected