| // |
| // Licensed to the Apache Software Foundation (ASF) under one |
| // or more contributor license agreements. See the NOTICE file |
| // distributed with this work for additional information |
| // regarding copyright ownership. The ASF licenses this file |
| // to you under the Apache License, Version 2.0 (the |
| // "License"); you may not use this file except in compliance |
| // with the License. You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, |
| // software distributed under the License is distributed on an |
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| // KIND, either express or implied. See the License for the |
| // specific language governing permissions and limitations |
| // under the License. |
| // |
| |
| = DevFaqWindowsMode |
| :jbake-type: wiki |
| :jbake-tags: wiki, devfaq, needsreview |
| :jbake-status: published |
| :keywords: Apache NetBeans wiki DevFaqWindowsMode |
| :description: Apache NetBeans wiki DevFaqWindowsMode |
| :toc: left |
| :toc-title: |
| :syntax: true |
| |
| === What is a Mode in the Windowing System? |
| |
| "Mode" refers to "docking mode". A Mode is a place in a main window, a place between splitters. Separate "floating" window is also backed by Mode. Mode is usually visually represented by a tabbed container. Programmatically it is represented by the class `org.openide.windows.Mode` |
| |
| Think of a `Mode` as synonymous with a one of the tabbed containers you see in the IDE's main window. The name "Mode" is historical, and a bit unfortunate. When you hear "Mode," think tabbed container and you'll be fine. |
| |
| *A Mode is _not_ a GUI component*. There is no legitimate programmatic way to fetch the component that represents a Mode on-screen, and the windowing system makes no guarantees about what that component is. |
| |
| Modes can contain one or more link:DevFaqWindowsTopComponent.asciidoc[TopComponent]s. They may be visible or non-visible at any given time. |
| |
| The link:DevFaqCustomWindowMode.asciidoc[DevFaqCustomWindowMode] page has a visual representation of the available modes, and link:http://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/doc-files/api.html[http://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/doc-files/api.html] has details about the contents of wstcref and settings files. |
| |
| === Pre-Defined Modes |
| |
| NetBeans defines six modes in core.ui: |
| |
| * topSlidingSide |
| * rightSlidingSide |
| * leftSlidingSide |
| * bottomSlidingSide |
| * explorer |
| * properties |
| |
| NetBeans defines additional modes in other places: |
| |
| * commonpalette |
| * output |
| * navigator |
| * editor |
| * CssPreviewTCWsmode |
| |
| === Docking a TopComponent into a Mode |
| |
| To dock a TopComponent into the 'editor' mode: |
| |
| [source,java] |
| ---- |
| |
| Mode myMode = WindowManager.getDefault().findMode("editor"); |
| TopComponent myTopComponent = WindowManager.getDefault().findTopComponent("MyTopComponent"); |
| myMode.dockInto(myTopComponent); |
| ---- |
| |
| ''The ID string of the TopComponent can usually be found in that TopComponent's Java file where it gets registered using annotations, or in the layer.xml. |
| '' |
| |
| === Apache Migration Information |
| |
| The content in this page was kindly donated by Oracle Corp. to the |
| Apache Software Foundation. |
| |
| This page was exported from link:http://wiki.netbeans.org/DevFaqWindowsMode[http://wiki.netbeans.org/DevFaqWindowsMode] , |
| that was last modified by NetBeans user Maehem |
| on 2012-11-13T01:09:52Z. |
| |
| |
| *NOTE:* This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed. |