improved menu design #3

This commit is contained in:
Didier Clermonté 2016-05-31 18:50:56 +02:00
parent 243f419106
commit d105337acd
5 changed files with 72 additions and 23 deletions

View File

@ -61,7 +61,7 @@ public class BackupPanel extends JPanel
* *
*/ */
static final ResourceBundle BUNDLE = ResourceBundle.getBundle("org.dclermonte.siba.gui.messages"); //$NON-NLS-1$ static final ResourceBundle BUNDLE = ResourceBundle.getBundle("org.dclermonte.siba.gui.messages"); //$NON-NLS-1$
private JTextField textField; static JTextField textField;
private JTextField textField_1; private JTextField textField_1;
/** /**

View File

@ -51,8 +51,8 @@ public class CheckPanel extends JPanel
{ {
private static final ResourceBundle BUNDLE = ResourceBundle.getBundle("org.dclermonte.siba.gui.messages"); //$NON-NLS-1$ private static final ResourceBundle BUNDLE = ResourceBundle.getBundle("org.dclermonte.siba.gui.messages"); //$NON-NLS-1$
private static final long serialVersionUID = -1580485684838045920L; private static final long serialVersionUID = -1580485684838045920L;
private JTextField textField; static File choosenFile;
private File choosenFile; static JTextField textField;
/** /**
* This is the constructor for this panel. * This is the constructor for this panel.

View File

@ -30,6 +30,7 @@ import java.awt.Point;
import java.awt.Toolkit; import java.awt.Toolkit;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.io.File;
import java.util.Locale; import java.util.Locale;
import java.util.ResourceBundle; import java.util.ResourceBundle;
@ -184,20 +185,61 @@ public class SibaGUI
menuBar.setBackground(new Color(152, 251, 152)); menuBar.setBackground(new Color(152, 251, 152));
this.frmSimpleBackup.setJMenuBar(menuBar); this.frmSimpleBackup.setJMenuBar(menuBar);
JMenuItem mntmNewMenuItem_1 = new JMenuItem(BUNDLE.getString("SibaGUI.mntmNewMenuItem_1.text")); //$NON-NLS-1$ JMenu mnFile = new JMenu(BUNDLE.getString("SibaGUI.mnFile.text")); //$NON-NLS-1$
mntmNewMenuItem_1.setMaximumSize(new Dimension(100, 32767)); mnFile.setForeground(Color.BLACK);
mntmNewMenuItem_1.setHorizontalTextPosition(SwingConstants.LEFT); menuBar.add(mnFile);
mntmNewMenuItem_1.setHorizontalAlignment(SwingConstants.LEFT);
mntmNewMenuItem_1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); JMenuItem mntmBackup = new JMenuItem(BUNDLE.getString("SibaGUI.mntmBackup.text")); //$NON-NLS-1$
mntmNewMenuItem_1.addActionListener(new ActionListener() mntmBackup.addActionListener(new ActionListener()
{ {
@Override @Override
public void actionPerformed(final ActionEvent e) public void actionPerformed(final ActionEvent e)
{
tabbedPane.setSelectedIndex(0);
File file = SourceDirectorySelector.showSelectorDialog(null, null);
if (file == null)
{
return;
}
BackupPanel.textField.setText(file.getPath());
// panel.setVisible(true);
}
});
mnFile.add(mntmBackup);
JMenuItem mntmCheck = new JMenuItem(BUNDLE.getString("SibaGUI.mntmCheck.text")); //$NON-NLS-1$
mntmCheck.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(final ActionEvent e)
{
tabbedPane.setSelectedIndex(1);
File result;
CheckPanel.choosenFile = CheckDirectorySelector.showSelectorDialog(null, null);
if (!(CheckPanel.choosenFile == null) && CheckPanel.choosenFile.exists())
{
CheckPanel.textField.setText(CheckPanel.choosenFile.getName());
result = CheckPanel.choosenFile;
}
else
{
result = null;
}
}
});
mnFile.add(mntmCheck);
JMenuItem mntmQuit = new JMenuItem(BUNDLE.getString("SibaGUI.mntmQuit.text")); //$NON-NLS-1$
mntmQuit.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(final ActionEvent arg0)
{ {
SibaGUI.this.frmSimpleBackup.dispose(); SibaGUI.this.frmSimpleBackup.dispose();
} }
}); });
menuBar.add(mntmNewMenuItem_1); mnFile.add(mntmQuit);
JMenu mnNewMenu = new JMenu(BUNDLE.getString("SibaGUI.mnNewMenu.text")); //$NON-NLS-1$ JMenu mnNewMenu = new JMenu(BUNDLE.getString("SibaGUI.mnNewMenu.text")); //$NON-NLS-1$
mnNewMenu.setLocation(new Point(500, 0)); mnNewMenu.setLocation(new Point(500, 0));

View File

@ -1,30 +1,34 @@
#Field ResourceBundle: BUNDLE #Field ResourceBundle: BUNDLE
#Tue Apr 26 16:39:35 CEST 2016 #Tue May 31 16:44:12 CEST 2016
BackupPanel.TitleBackupPanel.text=Backup BackupPanel.TitleBackupPanel.text=Backup
BackupPanel.TitleCheckPanel.text=Check BackupPanel.TitleCheckPanel.text=Check
BackupPanel.TitleWarning.text=Warning
BackupPanel.btnNewButton.text=\u2026 BackupPanel.btnNewButton.text=\u2026
BackupPanel.btnNewButton_1.text=\u2026 BackupPanel.btnNewButton_1.text=\u2026
BackupPanel.btnNewButton_2.text=Backup BackupPanel.btnNewButton_2.text=Backup
BackupPanel.checkFileChooserButton.text=File to check
BackupPanel.confirmDialogMessage.text=Your directory has been backup \n in the file \:\n
BackupPanel.confirmDialogTitle.text=Backup done
BackupPanel.dataMissing.text=Data Missing
BackupPanel.lblNewLabel_2.text=<html><p style\="margin-bottom\: 0cm; line-height\: 100%">Choose&nbsp;\:</p><p style\="margin-bottom\: 0cm; line-height\: 100%">- 1&nbsp;\: The directory to backup</p><p style\="margin-bottom\: 0cm; line-height\: 100%">- 2&nbsp;\: The directory where you want to put the backup</p><p style\="margin-bottom\: 0cm; line-height\: 100%">- 3&nbsp;\: Click Backup</p></html> BackupPanel.lblNewLabel_2.text=<html><p style\="margin-bottom\: 0cm; line-height\: 100%">Choose&nbsp;\:</p><p style\="margin-bottom\: 0cm; line-height\: 100%">- 1&nbsp;\: The directory to backup</p><p style\="margin-bottom\: 0cm; line-height\: 100%">- 2&nbsp;\: The directory where you want to put the backup</p><p style\="margin-bottom\: 0cm; line-height\: 100%">- 3&nbsp;\: Click Backup</p></html>
BackupPanel.lblSourceDirectory.text=Source Directory : BackupPanel.lblSourceDirectory.text=Source Directory \:
BackupPanel.lblTargetDirectory.text=Target Directory : BackupPanel.lblTargetDirectory.text=Target Directory \:
BackupPanel.sourceFileChooserButton.text=Source Directory BackupPanel.sourceFileChooserButton.text=Source Directory
BackupPanel.targetFileChooserButton.text=Target Directory BackupPanel.targetFileChooserButton.text=Target Directory
CheckDirectorySelector.this.dialogTitle=Directory where is the backup CheckDirectorySelector.this.dialogTitle=Directory where is the backup
CheckPanel.btnNewButton.text=\u2026 CheckPanel.btnNewButton.text=\u2026
CheckPanel.btnNewButton_1.text=Check CheckPanel.btnNewButton_1.text=Check
CheckPanel.lblNewLabel.text=File to be Checked CheckPanel.confirmDialogBad.text=is corrupted
SibaGUI.mnNewMenu.text=Help CheckPanel.confirmDialogGood.text=has been check and is good
SibaGUI.mntmNewMenuItem_1.text=End
SibaGUI.mntmNewMenuItem_2.text=About
SourceDirectorySelector.this.dialogTitle=Directory to backup
TargetDirectorySelector.this.dialogTitle=Directory for the backup
BackupPanel.checkFileChooserButton.text= File to check
BackupPanel.confirmDialogTitle.text = Backup done
BackupPanel.confirmDialogMessage.text = Your directory has been backup \n in the file :\n
CheckPanel.confirmDialogTitle.text=Check done CheckPanel.confirmDialogTitle.text=Check done
CheckPanel.confirmDialogYourString.text=Your File CheckPanel.confirmDialogYourString.text=Your File
CheckPanel.confirmDialogGood.text = has been check and is good CheckPanel.lblNewLabel.text=File to be Checked
CheckPanel.confirmDialogBad.text = is corrupted SibaGUI.mnFile.text=File
BackupPanel.dataMissing.text = Data Missing SibaGUI.mnNewMenu.text=Help
BackupPanel.TitleWarning.text = Warning SibaGUI.mntmBackup.text=Backup
SibaGUI.mntmCheck.text=Check
SibaGUI.mntmNewMenuItem_1.text=End
SibaGUI.mntmNewMenuItem_2.text=About
SibaGUI.mntmQuit.text=Quit
SourceDirectorySelector.this.dialogTitle=Directory to backup
TargetDirectorySelector.this.dialogTitle=Directory for the backup

View File

@ -15,7 +15,6 @@ CheckPanel.btnNewButton.text=\u2026
CheckPanel.btnNewButton_1.text=Vérifier CheckPanel.btnNewButton_1.text=Vérifier
CheckPanel.lblNewLabel.text=Sauvegarde \u00E0 v\u00E9rifier CheckPanel.lblNewLabel.text=Sauvegarde \u00E0 v\u00E9rifier
SibaGUI.mnNewMenu.text=Aide SibaGUI.mnNewMenu.text=Aide
SibaGUI.mntmNewMenuItem_1.text=Sortir
SibaGUI.mntmNewMenuItem_2.text=A propos SibaGUI.mntmNewMenuItem_2.text=A propos
SourceDirectorySelector.this.dialogTitle=Choix du répertoire à sauvegarder SourceDirectorySelector.this.dialogTitle=Choix du répertoire à sauvegarder
TargetDirectorySelector.this.dialogTitle=Choix du répertoire de destination TargetDirectorySelector.this.dialogTitle=Choix du répertoire de destination
@ -28,3 +27,7 @@ CheckPanel.confirmDialogGood.text = a
CheckPanel.confirmDialogBad.text = comporte des erreurs CheckPanel.confirmDialogBad.text = comporte des erreurs
BackupPanel.dataMissing.text = Données incomplètes BackupPanel.dataMissing.text = Données incomplètes
BackupPanel.TitleWarning.text = Attention BackupPanel.TitleWarning.text = Attention
SibaGUI.mnFile.text=Fichier
SibaGUI.mntmBackup.text=Sauvegarde
SibaGUI.mntmQuit.text=Sortir
SibaGUI.mntmCheck.text=Vérification