How to switch to fullscreen mode an application based on Netbeans platform

E.g. we need open a window MyTopComponent (mode: output) and switch an application to fullscreen.
Before that we should hide other opened windows, e.g. PropertyTopComponent (mode: output) and FoldersTopComponent (mode: explorer).

Let’s override and implement few methods of two classes

public final class MyTopComponent extends TopComponent {
 @Override
 public void componentOpened() {
  super.componentOpened();
  PropertyTopComponent.findInstance().close();
  FoldersTopComponent.findInstance().dockIntoLeft();
  ((MainWindow) WindowManager.getDefault().getMainWindow()).setFullScreenMode(true);
 }
 @Override
 public void componentClosed() {
  super.componentClosed();
  FoldersTopComponent.findInstance().requestActive();
  ((MainWindow) WindowManager.getDefault().getMainWindow()).setFullScreenMode(false);
 }
 public void openWindow() {
  final MyTopComponent win = MyTopComponent.findInstance();
  win.open();
  win.requestActive();
 }
}

public final class FoldersTopComponent extends TopComponent {
 @Override
 public void requestVisible() {
  // do nothing
  // invokes when mouse over the button
 }
 @Override
 public void requestActive() {
  switchMode(“explorer”, “leftSlidingSide”);
 }
 public void dockIntoLeft() {
  switchMode(“leftSlidingSide”, “explorer”);
 }
 private void switchMode(String from, String to) {
  ModeImpl toMode = (ModeImpl) WindowManager.getDefault().findMode(to);
  if (toMode != null) {
   toMode.addOpenedTopComponent(this);
   ModeImpl fromMode = (ModeImpl) WindowManager.getDefault().findMode(from);
   if (fromMode != null) {
    fromMode.removeTopComponent(this);
   }
   super.requestActive();
  }
 }
}