Package org.formic.wizard.form

Examples of org.formic.wizard.form.GuiForm


   */
  public Component init()
  {
    final JPanel panel =
      new JPanel(new MigLayout("wrap 2, fillx", "[growprio 0] [fill]"));
    GuiForm form = createForm();

    String home = fieldName("home");

    eclipseHomeChooser =
      new FileChooser(JFileChooser.DIRECTORIES_ONLY);

    panel.add(form.createMessagePanel(), "span");
    panel.add(new JLabel(Installer.getString(home)));
    panel.add(eclipseHomeChooser);

    form.bind(home, eclipseHomeChooser.getTextField(),
        new ValidatorBuilder()
        .required()
        .isDirectory()
        .validator(new EclipseHomeValidator())
        .validator());
View Full Code Here


   * {@inheritDoc}
   * @see org.formic.wizard.step.GuiStep#init()
   */
  public Component init()
  {
    GuiForm form = createForm();

    String files = fieldName("files");
    fileChooser = new FileChooser(JFileChooser.DIRECTORIES_ONLY);

    // allow just .vim dirs to not be hidden
    fileChooser.getFileChooser().setFileHidingEnabled(false);
    fileChooser.getFileChooser().addChoosableFileFilter(new FileFilter(){
      public boolean accept(java.io.File f) {
        String path = f.getAbsolutePath();
        return f.isDirectory() && (
          path.matches(".*/\\.vim(/.*|$)") ||
          !path.matches(".*/\\..*"));
      }
      public String getDescription() {
        return null;
      }
    });

    String skip = fieldName("skip");
    skipCheckBox = new JCheckBox(Installer.getString(skip));
    skipCheckBox.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent e){
        boolean selected = ((JCheckBox)e.getSource()).isSelected();
        JTextField fileField = fileChooser.getTextField();
        fileField.setEnabled(!selected);
        fileChooser.getButton().setEnabled(!selected);

        if (dirList != null){
          dirList.setEnabled(!selected);
        }

        // hacky
        Validator validator = (Validator)
          fileField.getClientProperty("validator");
        setValid(selected || validator.isValid(fileField.getText()));
      }
    });

    panel = new JPanel(new MigLayout(
          "wrap 2", "[fill]", "[] [] [] [fill, grow]"));
    panel.add(form.createMessagePanel(), "span");
    panel.add(new JLabel(Installer.getString(files)), "split");
    panel.add(fileChooser, "skip");
    panel.add(skipCheckBox, "span");

    form.bind(files,
        fileChooser.getTextField(),
        new ValidatorBuilder()
          .required()
          .isDirectory()
          .fileExists()
View Full Code Here

TOP

Related Classes of org.formic.wizard.form.GuiForm

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.