PreferencesWindow.java :  » Database-Client » DBBrowser » org » dbbrowser » ui » Java Open Source

Java Open Source » Database Client » DBBrowser 
DBBrowser » org » dbbrowser » ui » PreferencesWindow.java
package org.dbbrowser.ui;

import java.util.Observer;
import javax.swing.JFrame;
import javax.swing.JTabbedPane;
import infrastructure.internationalization.InternationalizationManager;

public class PreferencesWindow
{
  private static final String TITLE = InternationalizationManager.getInstance().getMessage( "dbbrowser-ui", "dbbrowser-ui-dbbrowser-window-title-label", null);
  private static final String PREFERENCES_TAB_LABEL = InternationalizationManager.getInstance().getMessage( "dbbrowser-ui", "dbbrowser-ui-preferences-window-preferences-panel-title", null);
  private static final String KEY_BINDINGS_TAB_LABEL = InternationalizationManager.getInstance().getMessage( "dbbrowser-ui", "dbbrowser-ui-preferences-window-edit-key-bindings-panel-title", null);

  private JFrame preferencesFrame = null;
  
  private JTabbedPane tabbedPane = new JTabbedPane();
  private Observer observerForChangesInPreferences = null;
  
  
  public PreferencesWindow(Observer observer)
  {
    this.observerForChangesInPreferences = observer;
    this.preferencesFrame = new JFrame(TITLE);
    this.preferencesFrame.setResizable( true );
    this.preferencesFrame.setSize(600, 400);
    this.preferencesFrame.setLocationRelativeTo( null );
    
    initialize();
    
  }
  
  public void show()
  {
    preferencesFrame.setVisible( true );
  }
  
  private void initialize()
  {
    //Add the preferences panel
    PreferencesPanel preferencesPanel = new PreferencesPanel();
    this.tabbedPane.add( PREFERENCES_TAB_LABEL, preferencesPanel );
    
    //Add the key bindings panel
    EditKeyBindingsPanel editKeyBindingsPanel = new EditKeyBindingsPanel( this.observerForChangesInPreferences );
    this.tabbedPane.add( KEY_BINDINGS_TAB_LABEL, editKeyBindingsPanel );    
    
    this.preferencesFrame.getContentPane().add( this.tabbedPane );
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.