private void jButtonSaveActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButtonSaveActionPerformed

    if (getStep() == 0) {
      if (jList1.getSelectedValue() == null) return;
      IReportConnection ic = (IReportConnection) (((Tag) jList1.getSelectedValue()).getValue());
      this.setIReportConnection(ic, true);
      return;
    } else {
      if (this.jTextFieldName.getText().trim().length() == 0) {
        javax.swing.JOptionPane.showMessageDialog(
            this,
            I18n.getString(
                "ConnectionDialog.Message.ValidConnName"), // "messages.connectionDialog.invalidName"
            I18n.getString(
                "ConnectionDialog.Message.NoConnection"), // "messages.connectionDialog.invalidNameCaption"
            javax.swing.JOptionPane.WARNING_MESSAGE);
        return;
      }
      IReportConnection tmpIReportConnection = this.iReportConnectionEditor.getIReportConnection();
      if (tmpIReportConnection == null) return;
      tmpIReportConnection.setName(jTextFieldName.getText());
      this.iReportConnection = tmpIReportConnection;
      this.setDialogResult(JOptionPane.OK_OPTION);
      this.setVisible(false);
      this.dispose();
    }
  } // GEN-LAST:event_jButtonSaveActionPerformed
 @SuppressWarnings(value = "unchecked")
 public ModeProperty(JRBaseStyle style) {
   super(
       JRBaseStyle.PROPERTY_MODE,
       Boolean.class,
       I18n.getString("AbstractStyleNode.Property.Opaque"),
       I18n.getString("AbstractStyleNode.Property.Set"));
   this.style = style;
 }
 @SuppressWarnings("unchecked")
 public JRPenProperty(JRPen pen, JRPenContainer container) {
   super(JRPen.class, pen);
   setName("pen");
   setDisplayName(I18n.getString("PenProperty.Property.Pen"));
   setShortDescription(I18n.getString("JRPenProperty.Property.detail"));
   setValue("canEditAsText", Boolean.FALSE);
   this.pen = pen;
   this.container = container;
 }
  public void initAll(boolean isNewDatasource) {
    this.setModal(true);
    initComponents();
    if (isNewDatasource) {
      this.setStep(0);
      DefaultListModel dlm = new DefaultListModel();
      List<IReportConnectionFactory> types =
          IReportManager.getInstance()
              .getIReportConnectionFactories(); // ConnectionImplementations();
      for (IReportConnectionFactory factory : types) // int i=0; i<types.size(); ++i)
      {
        // String cName = "" + types.get(i);

        try {
          // IReportConnection c = (IReportConnection)Class.forName(cName,true,
          // IReportManager.getInstance().getReportClassLoader()).newInstance();
          IReportConnection c = factory.createConnection();
          String sName = c.getDescription();
          // (String)c.getMethod("getConnectionTypeName",new Class[]{}).invoke(null, new
          // Object[]{});
          dlm.addElement(new Tag(c, sName));

        } catch (Throwable tw) {
          tw.printStackTrace();
        }
      }
      jList1.setModel(dlm);
      this.jButtonSave.setEnabled(false);
      if (jList1.getModel().getSize() > 0) {
        jList1.setSelectedIndex(0);
      }
    }

    javax.swing.KeyStroke escape =
        javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0, false);
    javax.swing.Action escapeAction =
        new javax.swing.AbstractAction() {
          public void actionPerformed(java.awt.event.ActionEvent e) {
            jButtonCancelActionPerformed(e);
          }
        };

    getRootPane()
        .getInputMap(javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW)
        .put(escape, I18n.getString("Global.Pane.Escape"));
    getRootPane().getActionMap().put(I18n.getString("Global.Pane.Escape"), escapeAction);

    // to make the default button ...
    this.getRootPane().setDefaultButton(this.jButtonSave);

    this.pack();
    this.setLocationRelativeTo(null);
  }
  @SuppressWarnings("unchecked")
  public PdfEncodingProperty(JRFont font) {
    super(
        JRBaseStyle.PROPERTY_PDF_ENCODING,
        String.class,
        I18n.getString("Global.Property.PdfEncoding"),
        I18n.getString("Global.Property.PdfEncoding"));
    this.font = font;

    setValue("canEditAsText", true);
    setValue("oneline", true);
    setValue("suppressCustomEditor", true);
  }
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    jPanelEmptyDataSource = new javax.swing.JPanel();
    jLabel24 = new javax.swing.JLabel();
    jSpinnerNumRecords = new javax.swing.JSpinner();

    setLayout(new java.awt.BorderLayout());

    jPanelEmptyDataSource.setLayout(new java.awt.GridBagLayout());

    jLabel24.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    jLabel24.setText(
        I18n.getString("JREmptyDataSourceConnectionEditor.Label.NumEmptyRec")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(16, 20, 0, 4);
    jPanelEmptyDataSource.add(jLabel24, gridBagConstraints);

    jSpinnerNumRecords.setPreferredSize(new java.awt.Dimension(70, 18));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(14, 0, 0, 20);
    jPanelEmptyDataSource.add(jSpinnerNumRecords, gridBagConstraints);

    add(jPanelEmptyDataSource, java.awt.BorderLayout.CENTER);
  } // </editor-fold>//GEN-END:initComponents
  public JRTabStopsPropertyCustomEditor(Object value, PropertyEditor editor, PropertyEnv env) {
    this.env = env;
    this.editor = editor;
    this.env.setState(PropertyEnv.STATE_NEEDS_VALIDATION);
    this.env.addPropertyChangeListener(this);

    initComponents();

    Tag[] tags =
        new Tag[] {
          new Tag(
              TabStopAlignEnum.LEFT.getValueByte(),
              I18n.getString("AbstractStyleNode.Property.Left")),
          new Tag(
              TabStopAlignEnum.CENTER.getValueByte(),
              I18n.getString("AbstractStyleNode.Property.Center")),
          new Tag(
              TabStopAlignEnum.RIGHT.getValueByte(),
              I18n.getString("AbstractStyleNode.Property.Right"))
        };

    jTableProperties.getColumnModel().getColumn(1).setCellEditor(new ComboBoxEditor(tags));

    jTableProperties.getColumnModel().getColumn(1).setCellRenderer(new ComboBoxRenderer(tags));

    DefaultListSelectionModel dlsm =
        (DefaultListSelectionModel) this.jTableProperties.getSelectionModel();
    dlsm.addListSelectionListener(
        new javax.swing.event.ListSelectionListener() {
          public void valueChanged(ListSelectionEvent e) {
            jTablePropertiesListSelectionValueChanged(e);
          }
        });

    if (value instanceof List && value != null) {
      setTabStops((List) value);
    }
  }
  private void setIReportConnection(IReportConnection conn, boolean isNew) {
    if (conn == null) return;
    this.iReportConnection = cloneConnection(conn);
    this.jTextFieldName.setText(iReportConnection.getName());
    this.jLabelTitle.setText(conn.getDescription());

    jButtonSave.setText(I18n.getString("Global.Button.Save"));
    jButtonTest.setEnabled(true);
    this.setStep(1);
    jPanelRoot.removeAll();

    iReportConnectionEditor = iReportConnection.getIReportConnectionEditor();
    if (!isNew) {
      iReportConnectionEditor.setIReportConnection(iReportConnection);
    }

    jPanelCustomComponent.add((java.awt.Component) iReportConnectionEditor);
    jPanelRoot.add(jPanelModifyDatasource);
    jPanelRoot.updateUI();
    jTextFieldName.requestFocusInWindow();
  }
 @Override
 public String getName() {
   return I18n.getString("formatting.tools.centerVertically");
 }
 @Override
 public String getShortDescription() {
   return I18n.getString("Global.Property.RunToBottom.");
 }
 @Override
 public String getDisplayName() {
   return I18n.getString("Global.Property.RunToBottom");
 }
 @Override
 public String getShortDescription() {
   return I18n.getString("The_color_of_the_Category_Axis_Tick_Label.");
 }
 @Override
 public String getDisplayName() {
   return I18n.getString("Category_Axis_Tick_Label_Color");
 }
 @Override
 public String getDisplayName() {
   return I18n.getString("Global.Property.Column");
 }
 @Override
 public String getShortDescription() {
   return I18n.getString("Global.Property.RangeAxisMinValueExpression");
 }
 @Override
 public String getDisplayName() {
   return I18n.getString("Global.Property.RangeAxisMinValueExpression");
 }
 @Override
 public String getShortDescription() {
   return I18n.getString("Global.Property.CategoryAxisLabelExpressiondetail");
 }
 @Override
 public String getDisplayName() {
   return I18n.getString("Global.Property.TimeAxisLineColor");
 }
 @Override
 public String getDisplayName() {
   return I18n.getString("Time_Axis_TimeSeries_Color");
 }
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    jPanelModifyDatasource = new javax.swing.JPanel();
    jLabelName = new javax.swing.JLabel();
    jTextFieldName = new javax.swing.JTextField();
    jSeparator3 = new javax.swing.JSeparator();
    jPanelCustomComponent = new javax.swing.JPanel();
    jLabelTitle = new javax.swing.JLabel();
    jSeparator1 = new javax.swing.JSeparator();
    jPanelRoot = new javax.swing.JPanel();
    jPanelNewDatasource = new javax.swing.JPanel();
    jLabel2 = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jList1 = new javax.swing.JList();
    jSeparator2 = new javax.swing.JSeparator();
    jPanelButtons = new javax.swing.JPanel();
    jButtonTest = new javax.swing.JButton();
    jButtonSave = new javax.swing.JButton();
    jButtonCancel = new javax.swing.JButton();

    jPanelModifyDatasource.setLayout(new java.awt.GridBagLayout());

    jLabelName.setText(I18n.getString("ConnectionDialog.Label.Name")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
    jPanelModifyDatasource.add(jLabelName, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
    jPanelModifyDatasource.add(jTextFieldName, gridBagConstraints);

    jSeparator3.setMinimumSize(new java.awt.Dimension(0, 2));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    jPanelModifyDatasource.add(jSeparator3, gridBagConstraints);

    jPanelCustomComponent.setLayout(new java.awt.BorderLayout());
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
    jPanelModifyDatasource.add(jPanelCustomComponent, gridBagConstraints);

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    getContentPane().setLayout(new java.awt.GridBagLayout());

    jLabelTitle.setBackground(new java.awt.Color(255, 255, 255));
    jLabelTitle.setFont(new java.awt.Font("Dialog", 1, 12));
    jLabelTitle.setIcon(
        new javax.swing.ImageIcon(
            getClass()
                .getResource(
                    "/com/jaspersoft/ireport/designer/connection/gui/datasource.png"))); // NOI18N
    jLabelTitle.setText(I18n.getString("ConnectionDialog.Label.Datasource")); // NOI18N
    jLabelTitle.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
    jLabelTitle.setOpaque(true);
    jLabelTitle.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    getContentPane().add(jLabelTitle, gridBagConstraints);

    jSeparator1.setMinimumSize(new java.awt.Dimension(0, 2));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    getContentPane().add(jSeparator1, gridBagConstraints);

    jPanelRoot.setPreferredSize(new java.awt.Dimension(440, 400));
    jPanelRoot.setLayout(new java.awt.BorderLayout());

    jPanelNewDatasource.setLayout(new java.awt.GridBagLayout());

    jLabel2.setText(I18n.getString("ConnectionDialog.Label.DatasourceType")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
    jPanelNewDatasource.add(jLabel2, gridBagConstraints);

    jList1.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    jList1.addListSelectionListener(
        new javax.swing.event.ListSelectionListener() {
          public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
            jList1ValueChanged(evt);
          }
        });
    jList1.addMouseListener(
        new java.awt.event.MouseAdapter() {
          public void mouseClicked(java.awt.event.MouseEvent evt) {
            jList1MouseClicked(evt);
          }
        });
    jScrollPane1.setViewportView(jList1);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 4);
    jPanelNewDatasource.add(jScrollPane1, gridBagConstraints);

    jPanelRoot.add(jPanelNewDatasource, java.awt.BorderLayout.CENTER);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    getContentPane().add(jPanelRoot, gridBagConstraints);

    jSeparator2.setMinimumSize(new java.awt.Dimension(0, 2));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    getContentPane().add(jSeparator2, gridBagConstraints);

    jPanelButtons.setMinimumSize(new java.awt.Dimension(50, 30));
    jPanelButtons.setPreferredSize(new java.awt.Dimension(50, 30));
    jPanelButtons.setLayout(new java.awt.GridBagLayout());

    jButtonTest.setText(I18n.getString("Global.Button.Test")); // NOI18N
    jButtonTest.setEnabled(false);
    jButtonTest.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonTestActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 0, 4);
    jPanelButtons.add(jButtonTest, gridBagConstraints);

    jButtonSave.setText(I18n.getString("Global.Button.Next")); // NOI18N
    jButtonSave.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonSaveActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
    jPanelButtons.add(jButtonSave, gridBagConstraints);

    jButtonCancel.setText(I18n.getString("Global.Button.Cancel")); // NOI18N
    jButtonCancel.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonCancelActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
    jPanelButtons.add(jButtonCancel, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    getContentPane().add(jPanelButtons, gridBagConstraints);

    pack();
  } // </editor-fold>//GEN-END:initComponents
 @Override
 public String getShortDescription() {
   return I18n.getString("The_color_of_the_Time_Axis_TimeSeries.");
 }
 @Override
 public String getDisplayName() {
   return I18n.getString("Global.Property.ValueAxisLabelColor");
 }
 public String getName() {
   return I18n.getString(IReportStandaloneManager.class, "CTL_OpenFileAction");
 }
 @Override
 public String getShortDescription() {
   return I18n.getString("Global.Property.TimeAxisLineColordetail");
 }
 @Override
 public String getDisplayName() {
   return I18n.getString("Global.Property.CategoryAxisLabelExpression");
 }