Dart Documentationdock_spawnPanelContainer

PanelContainer Class

This dock container wraps the specified element on a panel frame with a title bar and close button

Implements

IDockContainer

Constructors

Code new PanelContainer(Element elementContent, DockManager dockManager, [String title = "Panel"]) #

PanelContainer(this.elementContent, this.dockManager, [this.title = "Panel"]) {
  _initialize();
}

Code new PanelContainer.loadFromState(state, DockManager dockManager) #

PanelContainer.loadFromState(var state, this.dockManager) {
  String elementName = state["element"];
  this.elementContent = query("#$elementName");
  _initialize();
  loadState(state);
}

Methods

Code Element get containerElement() #

Element get containerElement() {
  return elementPanel;
}

Code void destroy() #

void destroy() {
  elementPanel.remove();
  elementButtonClose.on.click.remove(closeButtonClickedHandler);
}

Code Dialog get floatingDialog() #

Dialog get floatingDialog() { 
  return _floatingDialog;
}

Code void set floatingDialog(Dialog value) #

void set floatingDialog(Dialog value) {
  _floatingDialog = value;
  bool canUndock = (_floatingDialog == null);
  undockInitiator.enabled = canUndock;
}

Code String getRawTitle() #

String getRawTitle() {
  return elementTitleText.innerHTML;
}

Code int get height() #

int get height() {
  int containerHeight = elementContent.$dom_clientHeight;
  int titleHeight = elementTitle.$dom_clientHeight;
  return titleHeight + containerHeight;
}

Code void loadState(Map<String, Object> state) #

void loadState(Map<String, Object> state) {
  width = state['width'];
  height = state['height'];
  resize(width, height);
}

Code int get minimumAllowedChildNodes() #

int get minimumAllowedChildNodes() { return 0; }

Code void onCloseButtonClicked(MouseEvent evt) #

void onCloseButtonClicked(MouseEvent evt) {
  if (floatingDialog != null) {
    floatingDialog.destroy();
  } else {
    performUndock();
    destroy();
  }
}

Code void performLayout(List<IDockContainer> children) #

void performLayout(List<IDockContainer> children) {
  
}

Code void performUndock() #

Undocks the container and from the layout hierarchy The container would be removed from the DOM

void performUndock() {
  undockInitiator.enabled = false;
  dockManager.requestUndock(this);
}

Code Dialog performUndockToDialog(MouseEvent e, Point2 dragOffset) #

Undocks the panel and and converts it to a dialog box

Dialog performUndockToDialog(MouseEvent e, Point2 dragOffset) {
  undockInitiator.enabled = false;
  return dockManager.requestUndockToDialog(this, e, dragOffset);
}

Code void prepareForDocking() #

void prepareForDocking() {
  undockInitiator.enabled = true;
}

Code void resize(int _width, int _height) #

void resize(int _width, int _height) {
  _setPanelDimensions(_width, _height);
}

Code void saveState(Map<String, Object> state) #

void saveState(Map<String, Object> state) {
  state['element'] = elementContent.id;
  state['width'] = width;
  state['height'] = height;
}

Code void setActiveChild(IDockContainer child) #

void setActiveChild(IDockContainer child) { 
}

Code void setTitle(String _title) #

void setTitle(String _title) {
  title = _title;
  _updateTitle();
}

Code void setTitleIcon(String _iconName) #

void setTitleIcon(String _iconName) {
  iconName = _iconName;
  _updateTitle();
}

Code int get width() #

int get width() {
  return elementPanel.$dom_clientWidth;
}

Fields

Code var closeButtonClickedHandler #

var closeButtonClickedHandler;

Code String containerType #

String containerType = "panel";

Code DockManager dockManager #

DockManager dockManager;

Code DivElement elementButtonClose #

DivElement elementButtonClose;

Code Element elementContent #

Element elementContent;

Code DivElement elementContentHost #

DivElement elementContentHost;

Code DivElement elementPanel #

DivElement elementPanel;

Code DivElement elementTitle #

DivElement elementTitle;

Code DivElement elementTitleText #

DivElement elementTitleText;

Code String iconName #

String iconName = "icon-circle-arrow-right";

Code String name #

String name;

Code String title #

String title = "Panel";

Code UndockInitiator undockInitiator #

UndockInitiator undockInitiator;