示例#1
0
  public void afterInit() {
    // this.setSize(620, 320);

    this.pack();
    // Open in center...
    it.businesslogic.ireport.util.Misc.centerFrame(this);

    this.jComboBoxWhenResourceMissingType.addItem(
        new Tag(
            "Null",
            it.businesslogic.ireport.util.I18n.getString("whenResourceMissingType.Null", "Null")));
    this.jComboBoxWhenResourceMissingType.addItem(
        new Tag(
            "Empty",
            it.businesslogic.ireport.util.I18n.getString(
                "whenResourceMissingType.Empty", "Empty")));
    this.jComboBoxWhenResourceMissingType.addItem(
        new Tag(
            "Key",
            it.businesslogic.ireport.util.I18n.getString("whenResourceMissingType.Key", "Key")));
    this.jComboBoxWhenResourceMissingType.addItem(
        new Tag(
            "Error",
            it.businesslogic.ireport.util.I18n.getString(
                "whenResourceMissingType.Error", "Error")));

    applyI18n();

    it.businesslogic.ireport.util.Misc.setComboboxSelectedTagValue(
        jComboBoxWhenResourceMissingType, "Null");

    boolean found = true;
    for (int i = 1; found; ++i) {
      found = false;
      Enumeration e =
          it.businesslogic.ireport.gui.MainFrame.getMainInstance()
              .getActiveReportFrame()
              .getReport()
              .getSubDatasets()
              .elements();
      while (e.hasMoreElements() && !found) {
        SubDataset dataset = (SubDataset) e.nextElement();
        if (dataset.getName().equals("SubDataset" + i)) {
          found = true;
        }
      }
      if (!found) {
        jTextFieldName.setText("SubDataset" + i);
      }
    }

    jTextFieldResourceBoundle.setText(
        it.businesslogic.ireport.gui.MainFrame.getMainInstance()
            .getActiveReportFrame()
            .getReport()
            .getResourceBundleBaseName());
  }
示例#2
0
  public void setSubDataset(SubDataset subDataset) {
    this.subDataset = subDataset;
    this.jTextFieldName.setText(subDataset.getName());
    this.jTextFieldScriptletClass.setText(subDataset.getScriptletClass());
    this.jTextFieldResourceBoundle.setText(subDataset.getResourceBundleBaseName());
    this.jRTextExpressionAreaFilterExpression.setText(subDataset.getFilterExpression());
    if (subDataset != null) {
      jRTextExpressionAreaFilterExpression.setSubDataset(subDataset);
    }

    Misc.setComboboxSelectedTagValue(
        jComboBoxWhenResourceMissingType, subDataset.getWhenResourceMissingType());
    jButtonFields.setEnabled(true);
    jButtonVariables.setEnabled(true);
    jButtonParameters.setEnabled(true);
    jButtonQuery.setEnabled(true);
    jButtonGroups.setEnabled(true);
    jButtonProperties.setEnabled(true);
    this.jButtonOk.setText(I18n.getString("subDatasetDialog.buttonOk", "Ok"));
  }