org.esa.beam.framework.ui.application.support
Class DefaultToolViewDescriptor

java.lang.Object
  extended by org.esa.beam.framework.ui.application.support.DefaultToolViewDescriptor
All Implemented Interfaces:
com.bc.ceres.binding.PropertyChangeEmitter, com.bc.ceres.core.runtime.ConfigurableExtension, PageComponentDescriptor, ToolViewDescriptor

public class DefaultToolViewDescriptor
extends Object
implements ToolViewDescriptor, com.bc.ceres.core.runtime.ConfigurableExtension

Provides a standard implementation for ToolViewDescriptor.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.esa.beam.framework.ui.application.ToolViewDescriptor
ToolViewDescriptor.DockSide, ToolViewDescriptor.State
 
Field Summary
 
Fields inherited from interface org.esa.beam.framework.ui.application.ToolViewDescriptor
PROPERTY_KEY_ACCELERATOR, PROPERTY_KEY_INIT_INDEX, PROPERTY_KEY_INIT_SIDE, PROPERTY_KEY_INIT_STATE, PROPERTY_KEY_MNEMONIC, PROPERTY_KEY_TOOL_BAR_ID
 
Fields inherited from interface org.esa.beam.framework.ui.application.PageComponentDescriptor
PROPERTY_KEY_DESCRIPTION, PROPERTY_KEY_HELP_ID, PROPERTY_KEY_LARGE_ICON, PROPERTY_KEY_MAXIMIZABLE, PROPERTY_KEY_SMALL_ICON, PROPERTY_KEY_TAB_TITLE, PROPERTY_KEY_TITLE
 
Constructor Summary
DefaultToolViewDescriptor()
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
           
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
           
 void configure(com.bc.ceres.core.runtime.ConfigurationElement config)
           
 PageComponent createPageComponent()
           
 Command createShowViewCommand(ApplicationPage applicationPage)
          Create a command that when executed, will attempt to show the page component described by this descriptor in the provided application window.
protected  ToolView createToolView()
           
 KeyStroke getAccelerator()
           
 String getDescription()
           
 int getDockedHeight()
           
 int getDockedWidth()
           
 Rectangle getFloatingBounds()
           
 String getHelpId()
           
 String getId()
           
 int getInitIndex()
           
 ToolViewDescriptor.DockSide getInitSide()
           
 ToolViewDescriptor.State getInitState()
           
 Icon getLargeIcon()
           
 char getMnemonic()
           
 Dimension getPreferredSize()
           
 Icon getSmallIcon()
           
 String getTabTitle()
           
 String getTitle()
           
 String getToolBarId()
          Gets the ID of the tool bar in which the associated "show view" command will be placed.
 boolean isAutohidable()
           
 boolean isDockable()
           
 boolean isEnabled()
           
 boolean isFloatable()
           
 boolean isHidable()
           
 boolean isMaximizable()
           
 boolean isVisible()
           
 void removePropertyChangeListener(PropertyChangeListener listener)
           
 void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
           
 void setAccelerator(KeyStroke accelerator)
           
 void setAutohidable(boolean state)
           
 void setDescription(String description)
           
 void setDockable(boolean state)
           
 void setDockedHeight(int dockedHeight)
           
 void setDockedWidth(int dockedWidth)
           
 void setEnabled(boolean state)
           
 void setFloatable(boolean state)
           
 void setFloatingBounds(Rectangle floatingBounds)
           
 void setHelpId(String helpId)
           
 void setHidable(boolean state)
           
 void setInitIndex(int initIndex)
           
 void setInitSide(ToolViewDescriptor.DockSide initSide)
           
 void setInitState(ToolViewDescriptor.State initState)
           
 void setLargeIcon(Icon largeIcon)
           
 void setMaximizable(boolean state)
           
 void setMnemonic(char mnemonic)
           
 void setPreferredSize(Dimension preferredSize)
           
 void setSmallIcon(Icon smallIcon)
           
 void setTabTitle(String tabTitle)
           
 void setTitle(String title)
           
 void setToolBarId(String toolBarId)
           
 void setVisible(boolean state)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultToolViewDescriptor

public DefaultToolViewDescriptor()
Method Detail

getId

public String getId()
Specified by:
getId in interface PageComponentDescriptor

getHelpId

public String getHelpId()
Specified by:
getHelpId in interface PageComponentDescriptor
Returns:
The help identifier.

setHelpId

public void setHelpId(String helpId)
Specified by:
setHelpId in interface PageComponentDescriptor
Parameters:
helpId - The help identifier.

getTitle

public String getTitle()
Specified by:
getTitle in interface PageComponentDescriptor
Returns:
The window title.

setTitle

public void setTitle(String title)
Specified by:
setTitle in interface PageComponentDescriptor
Parameters:
title - The window title.

getTabTitle

public String getTabTitle()
Specified by:
getTabTitle in interface PageComponentDescriptor
Returns:
The window tab-title.

setTabTitle

public void setTabTitle(String tabTitle)
Specified by:
setTabTitle in interface PageComponentDescriptor
Parameters:
tabTitle - The window tab-title.

getDescription

public String getDescription()
Specified by:
getDescription in interface PageComponentDescriptor
Returns:
The window description.

setDescription

public void setDescription(String description)
Specified by:
setDescription in interface PageComponentDescriptor
Parameters:
description - The window description.

getToolBarId

public String getToolBarId()
Description copied from interface: ToolViewDescriptor
Gets the ID of the tool bar in which the associated "show view" command will be placed. If the ID is null, the associated "show view" command will be placed in the default tool bar (ID="viewsToolBar").

Specified by:
getToolBarId in interface ToolViewDescriptor
Returns:
The ID of the tool bar.
See Also:
ToolViewDescriptor.createShowViewCommand(ApplicationPage)

setToolBarId

public void setToolBarId(String toolBarId)
Specified by:
setToolBarId in interface ToolViewDescriptor
Parameters:
toolBarId - The ID of the tool bar.
See Also:
ToolViewDescriptor.getToolBarId()

getSmallIcon

public Icon getSmallIcon()
Specified by:
getSmallIcon in interface PageComponentDescriptor
Returns:
The small window icon or null if not set.

getLargeIcon

public Icon getLargeIcon()
Specified by:
getLargeIcon in interface PageComponentDescriptor
Returns:
The large window icon or null if not set.

setSmallIcon

public void setSmallIcon(Icon smallIcon)
Specified by:
setSmallIcon in interface PageComponentDescriptor
Parameters:
smallIcon - The small window icon or null if not set.

setLargeIcon

public void setLargeIcon(Icon largeIcon)
Specified by:
setLargeIcon in interface PageComponentDescriptor
Parameters:
largeIcon - The large window icon or null if not set.

getMnemonic

public char getMnemonic()
Specified by:
getMnemonic in interface ToolViewDescriptor
Returns:
The mnemonic.

setMnemonic

public void setMnemonic(char mnemonic)
Specified by:
setMnemonic in interface ToolViewDescriptor
Parameters:
mnemonic - The mnemonic.

getAccelerator

public KeyStroke getAccelerator()
Specified by:
getAccelerator in interface ToolViewDescriptor
Returns:
The accelerator.

setAccelerator

public void setAccelerator(KeyStroke accelerator)
Specified by:
setAccelerator in interface ToolViewDescriptor
Parameters:
accelerator - The accelerator.

getInitState

public ToolViewDescriptor.State getInitState()
Specified by:
getInitState in interface ToolViewDescriptor
Returns:
The initial state.

setInitState

public void setInitState(ToolViewDescriptor.State initState)
Specified by:
setInitState in interface ToolViewDescriptor
Parameters:
initState - The initial state.

getInitSide

public ToolViewDescriptor.DockSide getInitSide()
Specified by:
getInitSide in interface ToolViewDescriptor
Returns:
The initial side.

setInitSide

public void setInitSide(ToolViewDescriptor.DockSide initSide)
Specified by:
setInitSide in interface ToolViewDescriptor
Parameters:
initSide - The initial side.

getInitIndex

public int getInitIndex()
Specified by:
getInitIndex in interface ToolViewDescriptor
Returns:
The initial index.

setInitIndex

public void setInitIndex(int initIndex)
Specified by:
setInitIndex in interface ToolViewDescriptor
Parameters:
initIndex - The initial index.

getDockedWidth

public int getDockedWidth()
Specified by:
getDockedWidth in interface ToolViewDescriptor
Returns:
The docked width in pixels.

setDockedWidth

public void setDockedWidth(int dockedWidth)
Specified by:
setDockedWidth in interface ToolViewDescriptor
Parameters:
dockedWidth - The docked width in pixels.

getDockedHeight

public int getDockedHeight()
Specified by:
getDockedHeight in interface ToolViewDescriptor
Returns:
The docked height in pixels.

setDockedHeight

public void setDockedHeight(int dockedHeight)
Specified by:
setDockedHeight in interface ToolViewDescriptor
Parameters:
dockedHeight - The docked height in pixels.

getFloatingBounds

public Rectangle getFloatingBounds()
Specified by:
getFloatingBounds in interface ToolViewDescriptor
Returns:
The bounds of the tool window when in floating mode.

setFloatingBounds

public void setFloatingBounds(Rectangle floatingBounds)
Specified by:
setFloatingBounds in interface ToolViewDescriptor
Parameters:
floatingBounds - The bounds of the tool window when in floating mode.

getPreferredSize

public Dimension getPreferredSize()
Specified by:
getPreferredSize in interface PageComponentDescriptor
Returns:
The preferred size.

setPreferredSize

public void setPreferredSize(Dimension preferredSize)
Specified by:
setPreferredSize in interface PageComponentDescriptor
Parameters:
preferredSize - The preferred size.

isHidable

public boolean isHidable()
Specified by:
isHidable in interface ToolViewDescriptor
Returns:
true if the window is hidable, false otherwise.

setHidable

public void setHidable(boolean state)
Specified by:
setHidable in interface ToolViewDescriptor
Parameters:
state - true if the window is hidable, false otherwise.

isDockable

public boolean isDockable()
Specified by:
isDockable in interface ToolViewDescriptor
Returns:
true if the window is dockable, false otherwise.

setDockable

public void setDockable(boolean state)
Specified by:
setDockable in interface ToolViewDescriptor
Parameters:
state - true if the window is dockable, false otherwise.

isFloatable

public boolean isFloatable()
Specified by:
isFloatable in interface ToolViewDescriptor
Returns:
true if the window is floatable, false otherwise.

setFloatable

public void setFloatable(boolean state)
Specified by:
setFloatable in interface ToolViewDescriptor
Parameters:
state - true if the window is floatable, false otherwise.

isAutohidable

public boolean isAutohidable()
Specified by:
isAutohidable in interface ToolViewDescriptor
Returns:
true if the window is auto-hidable, false otherwise.

setAutohidable

public void setAutohidable(boolean state)
Specified by:
setAutohidable in interface ToolViewDescriptor
Parameters:
state - true if the window is auto-hidable, false otherwise.

isMaximizable

public boolean isMaximizable()
Specified by:
isMaximizable in interface PageComponentDescriptor
Returns:
true if the window is maximizable, false otherwise.

setMaximizable

public void setMaximizable(boolean state)
Specified by:
setMaximizable in interface PageComponentDescriptor
Parameters:
state - true if the window is maximizable, false otherwise.

isVisible

public boolean isVisible()
Specified by:
isVisible in interface PageComponentDescriptor
Returns:
true if the window is visible, false otherwise.

setVisible

public void setVisible(boolean state)
Specified by:
setVisible in interface PageComponentDescriptor
Parameters:
state - true if the window shall become visible, false otherwise.

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface PageComponentDescriptor
Returns:
true if the window is enabled, false otherwise.

setEnabled

public void setEnabled(boolean state)
Specified by:
setEnabled in interface PageComponentDescriptor
Parameters:
state - true if the window is enabled, false otherwise.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Specified by:
addPropertyChangeListener in interface com.bc.ceres.binding.PropertyChangeEmitter

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      PropertyChangeListener listener)
Specified by:
addPropertyChangeListener in interface com.bc.ceres.binding.PropertyChangeEmitter

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Specified by:
removePropertyChangeListener in interface com.bc.ceres.binding.PropertyChangeEmitter

removePropertyChangeListener

public void removePropertyChangeListener(String propertyName,
                                         PropertyChangeListener listener)
Specified by:
removePropertyChangeListener in interface com.bc.ceres.binding.PropertyChangeEmitter

createPageComponent

public PageComponent createPageComponent()
Specified by:
createPageComponent in interface PageComponentDescriptor

createToolView

protected ToolView createToolView()

createShowViewCommand

public Command createShowViewCommand(ApplicationPage applicationPage)
Create a command that when executed, will attempt to show the page component described by this descriptor in the provided application window.

Specified by:
createShowViewCommand in interface ToolViewDescriptor
Parameters:
applicationPage - The window
Returns:
The show page component command.
See Also:
ToolViewDescriptor.getToolBarId()

configure

public void configure(com.bc.ceres.core.runtime.ConfigurationElement config)
               throws com.bc.ceres.core.CoreException
Specified by:
configure in interface com.bc.ceres.core.runtime.ConfigurableExtension
Throws:
com.bc.ceres.core.CoreException


Copyright © 2002-2012 Brockmann Consult GmbH. All Rights Reserved.