Package javax.swing.plaf.basic

Examples of javax.swing.plaf.basic.BasicFileChooserUI


   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)
  {
    BasicFileChooserUI ui = new BasicFileChooserUI(new JFileChooser());
    Action a = ui.getApproveSelectionAction();
    harness.check(a.getValue("Name"), "approveSelection");
   
    Action a2 = ui.getApproveSelectionAction();
    harness.check(a == a2);
  }
View Full Code Here


   */
  public void test(TestHarness harness)
  {
    JFileChooser fc = new JFileChooser();
    fc.setDialogType(JFileChooser.OPEN_DIALOG);
    BasicFileChooserUI ui = new BasicFileChooserUI(fc);
    ui.installUI(fc);
    harness.check(ui.getApproveButtonMnemonic(fc), 79);
    fc.setDialogType(JFileChooser.SAVE_DIALOG);
    harness.check(ui.getApproveButtonMnemonic(fc), 83);
    fc.setApproveButtonMnemonic(99);   
    harness.check(ui.getApproveButtonMnemonic(fc), 99);
  }
View Full Code Here

   */
  public void test(TestHarness harness)
  {
    JFileChooser fc = new JFileChooser();
    fc.setDialogType(JFileChooser.OPEN_DIALOG);
    BasicFileChooserUI ui = new BasicFileChooserUI(fc);
    ui.installUI(fc);
    harness.check(ui.getApproveButtonToolTipText(fc), "Open selected file");
    fc.setDialogType(JFileChooser.SAVE_DIALOG);
    harness.check(ui.getApproveButtonToolTipText(fc), "Save selected file");
    fc.setApproveButtonToolTipText("Hello World!");   
    harness.check(ui.getApproveButtonToolTipText(fc), "Hello World!");
  }
View Full Code Here

   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)
  {
    BasicFileChooserUI ui = new BasicFileChooserUI(new JFileChooser());
    Action a = ui.getNewFolderAction();
    harness.check(a.getValue("Name"), "New Folder");
   
    Action a2 = ui.getNewFolderAction();
    harness.check(a == a2);
  }
View Full Code Here

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)
  {
    JFileChooser fc = new JFileChooser();
    BasicFileChooserUI ui = new BasicFileChooserUI(fc);
    harness.check(ui.getDialogTitle(fc), null);
    ui.installUI(fc);
    harness.check(ui.getDialogTitle(fc), "Open");
    fc.setDialogType(JFileChooser.SAVE_DIALOG);
    harness.check(ui.getDialogTitle(fc), "Save");
    fc.setDialogTitle("XYZ");
    harness.check(ui.getDialogTitle(fc), "XYZ");
    fc.setDialogTitle(null);
    harness.check(ui.getDialogTitle(fc), "Save");
   
    // try a null argument
    boolean pass = false;
    try
    {
      /*String t =*/ ui.getDialogTitle(null);
    }
    catch (NullPointerException e)
    {
      pass = true;
    }
View Full Code Here

   */
  public void test(TestHarness harness)
  {
    JFileChooser fc = new JFileChooser();
    fc.setDialogType(JFileChooser.OPEN_DIALOG);
    BasicFileChooserUI ui = new BasicFileChooserUI(fc);
    ui.installUI(fc);
    harness.check(ui.getApproveButtonText(fc), "Open");
    fc.setDialogType(JFileChooser.SAVE_DIALOG);
    harness.check(ui.getApproveButtonText(fc), "Save");
    fc.setApproveButtonText("Hello World!");   
    harness.check(ui.getApproveButtonText(fc), "Hello World!");
   
    // try null argument
    boolean pass = false;
    try
    {
      /*String t =*/ ui.getApproveButtonText(null);
    }
    catch (NullPointerException e)
    {
      pass = true;
    }
View Full Code Here

   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)
  {
    BasicFileChooserUI ui = new BasicFileChooserUI(new JFileChooser());
    Action a = ui.getChangeToParentDirectoryAction();
    harness.check(a.getValue("Name"), "Go Up");
   
    Action a2 = ui.getChangeToParentDirectoryAction();
    harness.check(a == a2);
  }
View Full Code Here

   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)
  {
    BasicFileChooserUI ui = new BasicFileChooserUI(new JFileChooser());
    AbstractAction a = (AbstractAction) ui.getGoHomeAction();
    harness.check(a.getValue("Name"), "Go Home");
    Object[] keys = a.getKeys();
    harness.check(keys.length, 1);
    Action a2 = ui.getGoHomeAction();
    harness.check(a == a2);
  }
View Full Code Here

   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)
  {
    BasicFileChooserUI ui = new BasicFileChooserUI(new JFileChooser());
    Action a = ui.getUpdateAction();
    harness.check(a.getValue("Name"), null);
   
    Action a2 = ui.getUpdateAction();
    harness.check(a == a2);
  }
View Full Code Here

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)
  {
    JFileChooser fc = new JFileChooser();
    BasicFileChooserUI ui = new BasicFileChooserUI(fc);
    harness.check(ui.getDirectoryName(), null);
    ui.installUI(fc);
    harness.check(ui.getDirectoryName(), null);
    ui.setDirectoryName("XYZ");
    harness.check(ui.getDirectoryName(), null);
    fc.setCurrentDirectory(new File("ABC"));
    harness.check(ui.getDirectoryName(), null);
  }
View Full Code Here

TOP

Related Classes of javax.swing.plaf.basic.BasicFileChooserUI

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.