org.gcube.portlets.admin.resourcemanagement.client.widgets.panels
Class DetachablePanel

java.lang.Object
  extended by org.gcube.portlets.admin.resourcemanagement.client.widgets.panels.DetachablePanel

public class DetachablePanel
extends Object

Consists of a panel that can be inserted inside a container and provides a functionality to be detached (and attached to it again). The detach button is executed in toggle mode. Once detached a dialog window is created to contain it.

Author:
Daniele Strollo (ISTI-CNR)

Nested Class Summary
static interface DetachablePanel.DetachablePanelHandler
           
 
Constructor Summary
DetachablePanel(com.extjs.gxt.ui.client.widget.LayoutContainer container, String title, String id, boolean modal)
          A detachable panel is created by specifying the widget suitable to contain it.
 
Method Summary
 void addHandler(DetachablePanel.DetachablePanelHandler handler)
           
 com.extjs.gxt.ui.client.widget.ContentPanel getRootPanel()
           
 com.extjs.gxt.ui.client.widget.toolbar.ToolBar getToolBar()
          Return the panel toolbar.
 void insertMainWidget(com.extjs.gxt.ui.client.widget.Component widget)
           
 void layout(boolean force)
           
protected  void onDetach()
          This method is called every time the panel is detached from its parent.
protected  void onEmbed()
          This method is called once the detached panel is embedded inside its container.
 void removeHandler(DetachablePanel.DetachablePanelHandler handler)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DetachablePanel

public DetachablePanel(com.extjs.gxt.ui.client.widget.LayoutContainer container,
                       String title,
                       String id,
                       boolean modal)
                throws org.gcube.resourcemanagement.support.shared.exceptions.InvalidParameterException
A detachable panel is created by specifying the widget suitable to contain it. Once detached the panel will be inserted in an ad-hoc dialog window.

Parameters:
container - the widget that will embed the panel
modal - if the detached window must be modal
Throws:
org.gcube.resourcemanagement.support.shared.exceptions.InvalidParameterException
Method Detail

getToolBar

public final com.extjs.gxt.ui.client.widget.toolbar.ToolBar getToolBar()
Return the panel toolbar.

Notice that the button for detaching the panel from its parent must not be removed to keep its functionality.

Returns:

getRootPanel

public final com.extjs.gxt.ui.client.widget.ContentPanel getRootPanel()

onDetach

protected final void onDetach()
This method is called every time the panel is detached from its parent. The custom behavior when detached must be defined here.


onEmbed

protected final void onEmbed()
This method is called once the detached panel is embedded inside its container.


insertMainWidget

public final void insertMainWidget(com.extjs.gxt.ui.client.widget.Component widget)

layout

public final void layout(boolean force)

addHandler

public final void addHandler(DetachablePanel.DetachablePanelHandler handler)

removeHandler

public final void removeHandler(DetachablePanel.DetachablePanelHandler handler)


Copyright © 2013. All Rights Reserved.