blob: 211390432f133c19005f8716a977460a28361e2b [file] [log] [blame]
//
// 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.
//
= DevFaqReplaceWindowSystem
:jbake-type: wiki
:jbake-tags: wiki, devfaq, needsreview
:jbake-status: published
:keywords: Apache NetBeans wiki DevFaqReplaceWindowSystem
:description: Apache NetBeans wiki DevFaqReplaceWindowSystem
:toc: left
:toc-title:
:syntax: true
== How Can I Replace the Window Manager?
Perhaps your users are a bit confused by the ability to close, slide or dock windows or maybe you're trying to retain the behavior of some existing application's window system. There are times, however rare, in which you want to replace the typical NetBeans Window Manager `org.netbeans.core.windows.WindowManagerImpl` with a different one.
Before doing this you should know that starting with NetBeans 6.5, it link:http://blogs.sun.com/geertjan/entry/limiting_the_netbeans_window_system[will be easy to change certain behaviors of the window system]. So needing to replace the window manager is rare already and will be needed even less often in the future.
But if you still want to do it, you can:
* Create an implementation of the `org.openide.windows.WindowManager` interface
* Register your implementation into the default lookup and link:http://wiki.netbeans.org/DevFaqLookupHowToOverride[replace any others]
Of course, there's a lot of work involved in creating your own WindowManager implementation, but you can have a look at the `org.openide.windows.DummyWindowManager` class for starters. It's a simple implementation that opens all TopComponents in their own frame but which can also make windows invisible which is handy for testing.
The `DummyWindowManager` is used as a last resort when no other window manager is present; you will not need to register it in the default Lookup as described earlier. If you want to use it, keep in mind these two tips:
* Do not include the `Core - Windows` or `Core` modules in your application. Including `Core` will result in an error message from the NonGui class because it seems to expect an implementation of the `NbTopManager.WindowManager` class which you cannot (easily) provide.
* No windows will be shown by default on startup. Use a `ModuleInstall` class' `restored()` method to display your TopComponent.
=== 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/DevFaqReplaceWindowSystem[http://wiki.netbeans.org/DevFaqReplaceWindowSystem] ,
that was last modified by NetBeans user Admin
on 2009-11-06T15:59:14Z.
*NOTE:* This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed.