Ejemplo n.º 1
0
 @Override
 public void addView(JInternalFrameEx f, Object constraints) {
   MultiSplitLayoutConstraints mc = (MultiSplitLayoutConstraints) constraints;
   f.setTabIndex(mc.tabIndex);
   f.setVisible(true);
   getSwingDesktopPane().add(f, mc);
   // ticket 90942, detail pane initially only has 20px height
   DesktopManager dm = getSwingDesktopPane().getDesktopManager();
   if (dm instanceof MultiSplitDesktopManager) {
     ((MultiSplitDesktopManager) dm).fitFrames(new JInternalFrame[] {f});
   }
   // end ticket
   getSwingDesktopPane().revalidate();
   getSwingDesktopPane().repaint();
 }
Ejemplo n.º 2
0
  @Override
  public void removeView(JInternalFrameEx f) {
    f.setVisible(false);
    f.dispose();
    DesktopManager dm = getSwingDesktopPane().getDesktopManager();
    dm.closeFrame(f);
    getSwingDesktopPane().remove(f);

    if (dm instanceof MultiSplitDesktopManager) {
      ((MultiSplitDesktopManager) dm).fitFrames(getSwingDesktopPane().getAllFrames());
    }
    if (SwingUtility.IS_JAVA_7_OR_LESS) {
      // Workaround JRE Bug #4759312; See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4759312
      // for details
      getSwingDesktopPane().selectFrame(true);
    }
  }