DefaultDialogDockableBarDockableHolder layout problem

This forum is used by users to request and discuss new product features. Please do not use this forum for technical support including bug reports.

Moderator: JIDE Support

Forum rules
Product suggestions only. Please do not use this forum for technical support including bug reports.

DefaultDialogDockableBarDockableHolder layout problem

Postby nicola.gioia » Wed Feb 28, 2007 1:57 am

I am using a DefaultDialogDockableBarDockableHolder and I want to save the layout of the dialog, to reload it on new dialog displaying.
But the saveLayout seem to not work correctly.
In the example that i will post next I display a DefaultDialogDockableBarDockableHolder and on the menu file i save the layout, but the registry will not be updated, so when i close and reopen the Dialog the layout is not the layout saved.
If I change the DefaultDialogDockableBarDockableHolder with DefaultDockableBarDockableHolder in extends all seem to work correctly (both the save and the load) and if I come back restoring the DefaultDialogDockableBarDockableHolder as superclass, the load operation correctly load the latest layout previously saved.

Where is the problem? I wrote wrong code or there are errors?

The example code is:
Code: Select all
import java.awt.*;
import java.awt.event.*;

import javax.swing.*;

import com.jidesoft.action.*;
import com.jidesoft.swing.*;


public class DefaultDialogDockableBarDockableHolderBug extends DefaultDialogDockableBarDockableHolder{

   public DefaultDialogDockableBarDockableHolderBug(Frame parent) {
      super(parent);
      init();
   }

   private void init() {
      setLocationRelativeTo(getParent());
      setDefaultCloseOperation(DISPOSE_ON_CLOSE);
      getLayoutPersistence().setProfileKey("bug.test");
      
      getLayoutPersistence().beginLoadLayoutData();
      this.getDockableBarManager().addDockableBar(CommandBarFactory.createLookAndFeelCommandBar(this));
      this.getDockableBarManager().addDockableBar(getMyMenuBar());
         
         JTextArea ta = new JTextArea("test test test test\n test test test test\n"+
               "test test test test\n test test test test\n"+
               "test test test test\n test test test test\n"+
               "test test test test\n test test test test\n");
         getDockingManager().getWorkspace().add(ta,BorderLayout.CENTER);
//      setModal(true);
      getLayoutPersistence().loadLayoutData();
      
      
   }
   
   private CommandBar getMyMenuBar() {
      CommandBar commandBar = new CommandMenuBar("Menu Bar");
      commandBar.setInitSide(DockableBarContext.DOCK_SIDE_NORTH);
      commandBar.setInitIndex(0);
      commandBar.setPaintBackground(false);
      commandBar.setStretch(true);
      commandBar.setFloatable(true);
      commandBar.setHidable(false);
      
      JideMenu file= new JideMenu("File");
      
      AbstractAction a = new AbstractAction("SaveLayout"){
         public void actionPerformed(ActionEvent e) {
            getLayoutPersistence().saveLayoutData();
            JOptionPane.showMessageDialog(DefaultDialogDockableBarDockableHolderBug.this, "Layout saved");
         }
      };
      
      a.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_DOWN_MASK));
      
      JMenuItem i = new JMenuItem(a);

      file.add(i);
      commandBar.add(file);
      
      commandBar.getContext().setInitMode(DockableBarContext.STATE_HORI_DOCKED);
      return commandBar;
   }
   public static void main(String[] args) {
      SwingUtilities.invokeLater(new Runnable(){
         public void run() {
            final JFrame f = new JFrame("test");
            JButton b = new JButton("show dialog");
            b.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent e) {
                  SwingUtilities.invokeLater(new Runnable(){
                     public void run() {
                        new DefaultDialogDockableBarDockableHolderBug(f);
                     }
                  });
               }
            });
            
            f.getContentPane().add(b);
            
            f.pack();
            JideSwingUtilities.globalCenterWindow(f);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setVisible(true);
         }
      });
   }
}
nicola.gioia
 
Posts: 60
Joined: Tue Sep 20, 2005 6:57 am

Postby JIDE Support » Wed Feb 28, 2007 3:07 am

Hi,

I cannot reproduce it. When I start the demo you have provided, I'll move the LookAndFeel-menu above the file menu, click "File" and "Save Layout". Then I exit the application and run it again and it'll show the menu as I left it before.

What version of Java and JIDE are you using?
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Postby nicola.gioia » Wed Feb 28, 2007 10:53 am

Hi!
The output of java -version is
Code: Select all
java version "1.5.0_10"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)
Java HotSpot(TM) Client VM (build 1.5.0_10-b03, mixed mode, sharing)

I'm using jide 1.9.2.1

I tried to move the bars... and all is ok. But when i resize the window the window size (and position) is not saved.

Thanks.
nicola.gioia
 
Posts: 60
Joined: Tue Sep 20, 2005 6:57 am

Postby JIDE Support » Wed Feb 28, 2007 11:06 am

I found a bug in our code which doesn't consider the Dialog case. I'll fix it and let you know when a patch is available.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Postby nicola.gioia » Thu Mar 01, 2007 3:15 am

Ok, thanks!
nicola.gioia
 
Posts: 60
Joined: Tue Sep 20, 2005 6:57 am

Postby JIDE Support » Mon Mar 19, 2007 9:48 pm

Just so you know, this bug is fixed in 1.9.5 release.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Postby nicola.gioia » Fri Mar 23, 2007 7:02 am

Thanks.
P.S. but when will be released the 1.9.5 version?
nicola.gioia
 
Posts: 60
Joined: Tue Sep 20, 2005 6:57 am


Return to Product Suggestions

Who is online

Users browsing this forum: Google [Bot] and 11 guests

cron