27.7.10

Window System

  • The window system is a framework provided by the NetBeans Platform.
  • It is responsible for the administration and display of all application windows.
  • It allows the user to customize the layout of the user interface.

Introduction

  • The window system is document based.
    • The central section – that is, the editor section – is all about the display of several files in tabs.
    • View sections are placed around the editor section.
    • Components are arranged within the view sections.
  • The window system is comprised of modes.
    • A mode is a NetBeans Platform class that provides a container for window, displayed like a tab.
    • The windows must be subclasses of TopComponent.
    • Evey displayed window is managed by the WindowManager.
    • Windows can be grouped as well.
      • The assembly of the window system is described in the layer file.

Customization

  • You can disable several features to prevent undesired changes by the end user, such as the undocking or closing of windows.
  • Go to the Properties dialog of your NetBeans Platform Application (or Module Suite) and open the category Build –> Window System.

Window: TopComponent

  • Creating a TopComponent
    • Definition and mapping of a TopComponent in the layer file
    • Settings file to declaratively add a TopComponent
    • TopComponent Reference file mapping a TopComponent to a mode
    • Definition of an action for opening a TopComponent
    • Docking a TopComponent into a specific mode programmatically
  • States
    • Different states of a TopComponent
      • opened
      • closed
      • visible
      • invisible
      • active
      • inactive
    • Methods for the different states
      • opened: protected void componentOpened()
      • closed: protected void componentClosed()
      • visible protected void componentShowing()
      • invisible: protected void componentHidden()
      • active: protected void componentActivated()
  • Context Menu
  • Persistence
  • Registry

Docking Container: Mode

  • Creating a mode

image

  • Modifying a Mode

Groups of Windows: TopComponentGroup

  • Creating a TopComponentGroup

Administration: WindowManager

  • findMode(String name)
  • findMode(TopComponent t)
  • findTopComponent(String id)
  • findTopComponentID(TopComponent t)
  • findTopComponentGroup(String name)

Window System Architecture

image

No comments: