コード例 #1
0
  /**
   * The constructor.
   *
   * @param parent The parent.
   * @param idata The installation data.
   */
  public FinishPanel(InstallerFrame parent, InstallData idata) {
    super(parent, idata);

    vs = new VariableSubstitutor(idata.getVariableValueMap());

    // The 'super' layout
    GridBagLayout superLayout = new GridBagLayout();
    setLayout(superLayout);
    GridBagConstraints gbConstraints = new GridBagConstraints();
    gbConstraints.insets = new Insets(0, 0, 0, 0);
    gbConstraints.fill = GridBagConstraints.NONE;
    gbConstraints.anchor = GridBagConstraints.CENTER;

    // We initialize our 'real' layout
    centerPanel = new JPanel();
    layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS);
    centerPanel.setLayout(layout);
    superLayout.addLayoutComponent(centerPanel, gbConstraints);
    add(centerPanel);
  }
コード例 #2
0
  /** Called when the panel becomes active. */
  public void panelActivate() {
    parent.lockNextButton();
    parent.lockPrevButton();
    if (idata.installSuccess) {
      // We set the information
      centerPanel.add(
          new JLabel(
              parent.langpack.getString("FinishPanel.success"),
              parent.icons.getImageIcon("information"),
              JLabel.TRAILING));
      centerPanel.add(Box.createVerticalStrut(20));

      if (idata.info.getWriteUninstaller()) {
        // We prepare a message for the uninstaller feature
        String path = translatePath("$INSTALL_PATH") + File.separator + "Uninstaller";

        centerPanel.add(
            new JLabel(
                parent.langpack.getString("FinishPanel.uninst.info"),
                parent.icons.getImageIcon("information"),
                JLabel.TRAILING));
        centerPanel.add(new JLabel(path, parent.icons.getImageIcon("empty"), JLabel.TRAILING));
      }

      // We add the autoButton
      centerPanel.add(Box.createVerticalStrut(20));
      autoButton =
          ButtonFactory.createButton(
              parent.langpack.getString("FinishPanel.auto"),
              parent.icons.getImageIcon("edit"),
              idata.buttonsHColor);
      autoButton.setToolTipText(parent.langpack.getString("FinishPanel.auto.tip"));
      autoButton.addActionListener(this);
      centerPanel.add(autoButton);
    } else
      centerPanel.add(
          new JLabel(
              parent.langpack.getString("FinishPanel.fail"),
              parent.icons.getImageIcon("information"),
              JLabel.TRAILING));
  }
コード例 #3
0
  /**
   * The constructor.
   *
   * @param parent The parent window.
   * @param idata The installation data.
   */
  public SudoPanel(InstallerFrame parent, InstallData idata) {
    super(parent, idata);

    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

    add(
        new JLabel(
            /*parent.langpack.getString("SudoPanel.info")*/ "For installing administrator privileges are necessary",
            JLabel.TRAILING));

    add(Box.createRigidArea(new Dimension(0, 5)));

    add(
        new JLabel(
            /*parent.langpack.getString("SudoPanel.tip")*/ "Please note that passwords are case-sensitive",
            parent.icons.getImageIcon("tip"),
            JLabel.TRAILING));

    add(Box.createRigidArea(new Dimension(0, 5)));

    JPanel spacePanel = new JPanel();
    spacePanel.setAlignmentX(LEFT_ALIGNMENT);
    spacePanel.setAlignmentY(CENTER_ALIGNMENT);
    spacePanel.setBorder(BorderFactory.createEmptyBorder(80, 30, 0, 50));
    spacePanel.setLayout(new BorderLayout(5, 5));
    spacePanel.add(
        new JLabel(
            /*parent.langpack.getString("SudoPanel.specifyAdminPassword")*/ "Please specify your password:"),
        BorderLayout.NORTH);
    passwordField = new JPasswordField();
    passwordField.addActionListener(this);
    JPanel space2Panel = new JPanel();
    space2Panel.setLayout(new BorderLayout());
    space2Panel.add(passwordField, BorderLayout.NORTH);
    space2Panel.add(Box.createRigidArea(new Dimension(0, 5)), BorderLayout.CENTER);
    spacePanel.add(space2Panel, BorderLayout.CENTER);
    add(spacePanel);
  }