Example #1
0
 public static void buttonsVisible(
     JRadioButton button1, JRadioButton button2, JRadioButton button3, JRadioButton button4) {
   button1.setVisible(true);
   button2.setVisible(true);
   button3.setVisible(true);
   button4.setVisible(true);
 }
  // Visual element creation
  public void init() {
    // Because the damn thing doesn't play well with a FlowLayout
    setLayout(new BorderLayout());

    // Initialize the upper grid panel
    gridPanel = new JPanel(new GridLayout(2, 4, 5, 5));

    // Allow space between the text areas
    gridPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

    for (Room room : rooms) {
      // Make sure everything is sufficiently large and add them to the grid
      room.setPreferredSize(new Dimension(50, 50));
      gridPanel.add(room, room.roomIndex);
    }

    // Initialize the information input panel
    infoPanel = new JPanel(new FlowLayout());

    // Create the helper labels
    nameLabel = new JLabel("Name:");
    phoneLabel = new JLabel("Phone #:");
    partyLabel = new JLabel("Number in party:");
    smokingLabel = new JLabel("Smoking preference:");

    // Create the text input fields
    nameField = new JTextField(20);
    phoneField = new JTextField(12);

    // Create a *party* box
    Vector<String> items = new Vector<String>();
    for (int i = 8; i <= 20; i++) {
      items.add(String.valueOf(i));
    }

    partyBox = new JComboBox(items);

    // Create the radio buttons
    hiddenRadio = new JRadioButton("");
    hiddenRadio.setVisible(false);
    hiddenRadio.setSelected(true);

    smokingRadio = new JRadioButton("Smoking");

    nonSmokingRadio = new JRadioButton("Non-Smoking");

    // Create the radio group and add the radio buttons
    radioGroup = new ButtonGroup();
    radioGroup.add(hiddenRadio);
    radioGroup.add(smokingRadio);
    radioGroup.add(nonSmokingRadio);

    // Add the objects to the info panel
    infoPanel.add(nameLabel);
    infoPanel.add(nameField);
    infoPanel.add(phoneLabel);
    infoPanel.add(phoneField);
    infoPanel.add(partyLabel);
    infoPanel.add(partyBox);
    infoPanel.add(smokingLabel);
    infoPanel.add(smokingRadio);
    infoPanel.add(nonSmokingRadio);

    // Create the submit panel
    submitPanel = new JPanel();

    submitButton = new JButton("Book room");
    submitButton.addActionListener(this);

    submitPanel.add(submitButton);

    add(gridPanel, BorderLayout.NORTH);
    add(infoPanel, BorderLayout.CENTER);
    add(submitPanel, BorderLayout.SOUTH);
  }
  public static void main(String args[]) {
    JRadioButton rb = new JRadioButton();
    rb.getAccessibleContext();
    rb.isFocusTraversable();
    rb.setEnabled(false);
    rb.setEnabled(true);
    rb.requestFocus();
    rb.requestFocusInWindow();
    rb.getPreferredSize();
    rb.getMaximumSize();
    rb.getMinimumSize();
    rb.contains(1, 2);
    Component c1 = rb.add(new Component() {});
    Component c2 = rb.add(new Component() {});
    Component c3 = rb.add(new Component() {});
    Insets ins = rb.getInsets();
    rb.getAlignmentY();
    rb.getAlignmentX();
    rb.getGraphics();
    rb.setVisible(false);
    rb.setVisible(true);
    rb.setForeground(Color.red);
    rb.setBackground(Color.red);
    for (String font : Toolkit.getDefaultToolkit().getFontList()) {
      for (int j = 8; j < 17; j++) {
        Font f1 = new Font(font, Font.PLAIN, j);
        Font f2 = new Font(font, Font.BOLD, j);
        Font f3 = new Font(font, Font.ITALIC, j);
        Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);

        rb.setFont(f1);
        rb.setFont(f2);
        rb.setFont(f3);
        rb.setFont(f4);

        rb.getFontMetrics(f1);
        rb.getFontMetrics(f2);
        rb.getFontMetrics(f3);
        rb.getFontMetrics(f4);
      }
    }
    rb.enable();
    rb.disable();
    rb.reshape(10, 10, 10, 10);
    rb.getBounds(new Rectangle(1, 1, 1, 1));
    rb.getSize(new Dimension(1, 2));
    rb.getLocation(new Point(1, 2));
    rb.getX();
    rb.getY();
    rb.getWidth();
    rb.getHeight();
    rb.isOpaque();
    rb.isValidateRoot();
    rb.isOptimizedDrawingEnabled();
    rb.isDoubleBuffered();
    rb.getComponentCount();
    rb.countComponents();
    rb.getComponent(1);
    rb.getComponent(2);
    Component[] cs = rb.getComponents();
    rb.getLayout();
    rb.setLayout(new FlowLayout());
    rb.doLayout();
    rb.layout();
    rb.invalidate();
    rb.validate();
    rb.remove(0);
    rb.remove(c2);
    rb.removeAll();
    rb.preferredSize();
    rb.minimumSize();
    rb.getComponentAt(1, 2);
    rb.locate(1, 2);
    rb.getComponentAt(new Point(1, 2));
    rb.isFocusCycleRoot(new Container());
    rb.transferFocusBackward();
    rb.setName("goober");
    rb.getName();
    rb.getParent();
    rb.getGraphicsConfiguration();
    rb.getTreeLock();
    rb.getToolkit();
    rb.isValid();
    rb.isDisplayable();
    rb.isVisible();
    rb.isShowing();
    rb.isEnabled();
    rb.enable(false);
    rb.enable(true);
    rb.enableInputMethods(false);
    rb.enableInputMethods(true);
    rb.show();
    rb.show(false);
    rb.show(true);
    rb.hide();
    rb.getForeground();
    rb.isForegroundSet();
    rb.getBackground();
    rb.isBackgroundSet();
    rb.getFont();
    rb.isFontSet();
    Container c = new Container();
    c.add(rb);
    rb.getLocale();
    for (Locale locale : Locale.getAvailableLocales()) rb.setLocale(locale);

    rb.getColorModel();
    rb.getLocation();

    boolean exceptions = false;
    try {
      rb.getLocationOnScreen();
    } catch (IllegalComponentStateException e) {
      exceptions = true;
    }
    if (!exceptions)
      throw new RuntimeException("IllegalComponentStateException did not occur when expected");

    rb.location();
    rb.setLocation(1, 2);
    rb.move(1, 2);
    rb.setLocation(new Point(1, 2));
    rb.getSize();
    rb.size();
    rb.setSize(1, 32);
    rb.resize(1, 32);
    rb.setSize(new Dimension(1, 32));
    rb.resize(new Dimension(1, 32));
    rb.getBounds();
    rb.bounds();
    rb.setBounds(10, 10, 10, 10);
    rb.setBounds(new Rectangle(10, 10, 10, 10));
    rb.isLightweight();
    rb.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
    rb.getCursor();
    rb.isCursorSet();
    rb.inside(1, 2);
    rb.contains(new Point(1, 2));
    rb.isFocusable();
    rb.setFocusable(true);
    rb.setFocusable(false);
    rb.transferFocus();
    rb.getFocusCycleRootAncestor();
    rb.nextFocus();
    rb.transferFocusUpCycle();
    rb.hasFocus();
    rb.isFocusOwner();
    rb.toString();
    rb.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
    rb.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
    rb.setComponentOrientation(ComponentOrientation.UNKNOWN);
    rb.getComponentOrientation();
  }
Example #4
0
  public void setPanel(PlotType plotType) {

    tabbedPane.removeAll();
    this.setVisible(true);

    // add plot-specific tab
    String tabTitle = plotType.getTranslatedKey(loc);
    tabbedPane.insertTab(tabTitle, null, new JScrollPane(mainPanel), null, 0);
    classesPanel.setVisible(false);
    histogramPanel.setVisible(false);
    scatterplotPanel.setVisible(false);
    barChartPanel.setVisible(false);
    boxPlotPanel.setVisible(false);

    rbNormalized.setVisible(false);
    ckOverlayNormal.setVisible(false);
    ckShowHistogram.setVisible(false);
    ckCumulative.setVisible(false);
    ckOverlayPolygon.setVisible(false);

    // add graph tab
    tabbedPane.addTab(loc.getMenu("Graph"), new JScrollPane(graphPanel));
    graphPanel.setVisible(true);
    showYAxisSettings = true;

    // set visibility for plot-specific panels
    switch (plotType) {
      case HISTOGRAM:
        classesPanel.setVisible(true);
        histogramPanel.setVisible(true);
        rbNormalized.setVisible(true);
        ckOverlayNormal.setVisible(true);
        ckShowHistogram.setVisible(true);
        ckCumulative.setVisible(true);
        ckOverlayPolygon.setVisible(true);

        layoutHistogramPanel();

        break;

      case BOXPLOT:
      case MULTIBOXPLOT:
        boxPlotPanel.setVisible(true);
        break;

      case BARCHART:
        barChartPanel.setVisible(true);
        layoutBarChartPanel();
        break;

      case SCATTERPLOT:
        scatterplotPanel.setVisible(true);
        break;

        // graph tab only
      case DOTPLOT:
      case NORMALQUANTILE:
      case RESIDUAL:
        tabbedPane.removeTabAt(0);
        break;

      case STEMPLOT:
        this.setVisible(false);
        break;
    }

    setLabels();
    updateGUI();
  }
Example #5
0
  @Override
  protected void initComponents() {

    double size[][] = {
      {TableLayout.PREFERRED, TableLayout.FILL}, {20, 20, 20, 20, 20, 20, 20, TableLayout.FILL}
    };

    TableLayout layout = new TableLayout(size);
    layout.setVGap(3);
    layout.setHGap(5);
    this.setLayout(layout);
    lbName =
        new JLabel(
            SpringLocaleDelegate.getInstance()
                    .getMessage(
                        "wizard.step.entityoption.10", "Wie m\u00f6chten Sie Attribute erfassen")
                + " ");
    rbGatherAttributes =
        new JRadioButton(
            SpringLocaleDelegate.getInstance()
                .getMessage("wizard.step.entityoption.11", "Attribute manuell erfassen"));
    rbGatherAttributes.setToolTipText(
        SpringLocaleDelegate.getInstance()
            .getMessage("wizard.step.entityoption.tooltip.11", "Attribute manuell erfassen"));
    rbCopyAttributes =
        new JRadioButton(
            SpringLocaleDelegate.getInstance()
                .getMessage(
                    "wizard.step.entityoption.12",
                    "Attribute von anderer Entit\u00e4t selektiv \u00fcbernehmen"));
    rbCopyAttributes.setToolTipText(
        SpringLocaleDelegate.getInstance()
            .getMessage(
                "wizard.step.entityoption.tooltip.12",
                "Attribute von anderer Entit\u00e4t selektiv \u00fcbernehmen"));
    rbAssignAttributes =
        new JRadioButton(
            SpringLocaleDelegate.getInstance()
                .getMessage(
                    "wizard.step.entityoption.13",
                    "\u00dcbernahme aus bestehender Datenbanktabelle"));
    rbAssignAttributes.setToolTipText(
        SpringLocaleDelegate.getInstance()
            .getMessage(
                "wizard.step.entityoption.tooltip.13",
                "\u00dcbernahme aus bestehender Datenbanktabelle"));
    rbTemplateAttributes =
        new JRadioButton(
            SpringLocaleDelegate.getInstance()
                .getMessage("wizard.step.entityoption.14", "Vorlage \u00fcbernehmen"));
    rbTemplateAttributes.setToolTipText(
        SpringLocaleDelegate.getInstance()
            .getMessage("wizard.step.entityoption.tooltip.14", "Vorlage \u00fcbernehmen"));
    rbImportTable =
        new JRadioButton(
            SpringLocaleDelegate.getInstance()
                .getMessage("wizard.step.entityoption.15", "Entit\u00e4t importieren"));
    rbImportTable.setToolTipText(
        SpringLocaleDelegate.getInstance()
            .getMessage("wizard.step.entityoption.tooltip.15", "Entit\u00e4t importieren"));
    rbImportTable.setVisible(false);
    lbEntity =
        new JLabel(
            SpringLocaleDelegate.getInstance()
                    .getMessage(
                        "wizard.step.entityoption.16",
                        "Bitte w\u00e4hlen Sie eine Entit\u00e4t aus")
                + ":");
    lbEntity.setVisible(false);
    cbxEntity = new JComboBox();
    cbxEntity.setVisible(false);
    tblFields = new JTable(new EntityAttributeSelectTableModel());
    tblFields.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    tblFields.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    cbxTable = new JComboBox();
    cbxTable.setVisible(false);

    scrollFields = new JScrollPane(tblFields);
    scrollFields.setVisible(false);

    bGroup = new ButtonGroup();
    bGroup.add(rbGatherAttributes);
    bGroup.add(rbCopyAttributes);
    bGroup.add(rbAssignAttributes);
    bGroup.add(rbTemplateAttributes);
    bGroup.add(rbImportTable);

    rbGatherAttributes.setSelected(true);
    NuclosEntityOptionStep.this.setComplete(true);

    rbGatherAttributes.addItemListener(
        new ItemListener() {

          @Override
          public void itemStateChanged(final ItemEvent e) {
            SwingUtilities.invokeLater(
                new Runnable() {

                  @Override
                  public void run() {
                    int state = e.getStateChange();
                    if (state == ItemEvent.SELECTED) {
                      NuclosEntityOptionStep.this.setComplete(true);
                      pnlImport.setVisible(false);
                      cbxTable.setVisible(false);
                      cbxEntity.setVisible(false);
                      scrollFields.setVisible(false);
                    }
                  }
                });
          }
        });

    rbImportTable.addItemListener(
        new ItemListener() {

          @Override
          public void itemStateChanged(final ItemEvent e) {
            SwingUtilities.invokeLater(
                new Runnable() {

                  @Override
                  public void run() {
                    int state = e.getStateChange();
                    if (state == ItemEvent.SELECTED) {
                      pnlImport.setVisible(true);
                      NuclosEntityOptionStep.this.setComplete(false);
                    } else {
                      pnlImport.setVisible(false);
                      NuclosEntityOptionStep.this.setComplete(true);
                    }
                  }
                });
          }
        });

    rbCopyAttributes.addItemListener(
        new ItemListener() {

          @Override
          public void itemStateChanged(final ItemEvent e) {
            SwingUtilities.invokeLater(
                new Runnable() {

                  @Override
                  public void run() {
                    int state = e.getStateChange();
                    if (state == ItemEvent.SELECTED) {
                      NuclosEntityOptionStep.this.setComplete(true);
                      tblFields.setModel(new EntityAttributeSelectTableModel());
                      lbEntity.setVisible(true);
                      cbxEntity.setSelectedIndex(0);
                      cbxEntity.setVisible(true);
                      cbxTable.setVisible(false);
                      scrollFields.setVisible(true);
                    } else {
                      lbEntity.setVisible(false);
                      cbxEntity.setVisible(false);
                      cbxTable.setVisible(false);
                      scrollFields.setVisible(false);
                    }
                  }
                });
          }
        });

    rbAssignAttributes.addItemListener(
        new ItemListener() {

          @Override
          public void itemStateChanged(final ItemEvent e) {
            SwingUtilities.invokeLater(
                new Runnable() {

                  @Override
                  public void run() {
                    int state = e.getStateChange();
                    if (state == ItemEvent.SELECTED) {
                      NuclosEntityOptionStep.this.setComplete(true);
                      tblFields.setModel(new EntityAttributeSelectTableModel());
                      cbxTable.setSelectedIndex(0);
                      cbxTable.setVisible(true);
                      cbxEntity.setVisible(false);
                      scrollFields.setVisible(true);
                    }
                  }
                });
          }
        });

    rbTemplateAttributes.addItemListener(
        new ItemListener() {

          @Override
          public void itemStateChanged(final ItemEvent e) {
            SwingUtilities.invokeLater(
                new Runnable() {

                  @Override
                  public void run() {
                    int state = e.getStateChange();
                    if (state == ItemEvent.SELECTED) {
                      lbEntity.setVisible(true);
                      cbxEntity.setSelectedIndex(0);
                      cbxEntity.setVisible(true);
                      cbxTable.setVisible(false);
                      pnlImport.setVisible(false);
                      scrollFields.setVisible(false);
                    } else {
                      lbEntity.setVisible(false);
                      cbxEntity.setVisible(false);
                      cbxTable.setVisible(false);
                    }
                  }
                });
          }
        });

    cbxEntity.addItemListener(
        new ItemListener() {

          @Override
          public void itemStateChanged(final ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
              final Object obj = e.getItem();
              try {
                if (obj instanceof EntityMetaDataVO) {
                  final EntityAttributeSelectTableModel model =
                      new EntityAttributeSelectTableModel();
                  EntityMetaDataVO vo = (EntityMetaDataVO) obj;
                  Collection<EntityFieldMetaDataVO> fields =
                      MetaDataClientProvider.getInstance()
                          .getAllEntityFieldsByEntity(vo.getEntity())
                          .values();

                  ArrayList<EntityFieldMetaDataVO> lstSorted =
                      CollectionUtils.sorted(
                          fields,
                          new Comparator<EntityFieldMetaDataVO>() {

                            @Override
                            public int compare(EntityFieldMetaDataVO o1, EntityFieldMetaDataVO o2) {
                              return o1.getField()
                                  .toLowerCase()
                                  .compareTo(o2.getField().toLowerCase());
                            }
                          });
                  for (EntityFieldMetaDataVO field : lstSorted) {
                    if (NuclosWizardUtils.isSystemField(field)) continue;
                    Attribute attr = new Attribute();
                    attr.setLabel(
                        SpringLocaleDelegate.getInstance()
                            .getResource(
                                field.getLocaleResourceIdForLabel(), field.getFallbacklabel()));
                    attr.setDescription(
                        SpringLocaleDelegate.getInstance()
                            .getResource(field.getLocaleResourceIdForDescription(), ""));
                    attr.setDistinct(field.isUnique());
                    attr.setMandatory(!field.isNullable());
                    attr.setLogBook(field.isLogBookTracking());
                    attr.setInternalName(field.getField());
                    attr.setDbName(field.getDbColumn());
                    attr.setField(field.getField());
                    attr.setOldInternalName(field.getField());
                    attr.setValueListProvider(field.isSearchable());
                    attr.setModifiable(field.isModifiable());
                    attr.setDefaultValue(field.getDefaultValue());
                    attr.setCalcFunction(field.getCalcFunction());
                    attr.setOutputFormat(field.getFormatOutput());
                    attr.setInputValidation(field.getFormatInput());
                    attr.setIndexed(Boolean.TRUE.equals(field.isIndexed()));
                    attr.setCalculationScript(field.getCalculationScript());
                    String sForeignEntity = field.getForeignEntity();
                    String sLookupEntity = field.getLookupEntity();
                    if (sForeignEntity != null) {
                      EntityMetaDataVO voForeignEntity =
                          MetaDataClientProvider.getInstance().getEntity(sForeignEntity);
                      attr.setMetaVO(voForeignEntity);
                      attr.setOnDeleteCascade(field.isOnDeleteCascade());
                      attr.setField(field.getForeignEntityField());
                      attr.setDatatyp(DataTyp.getReferenzTyp());
                      if (!Modules.getInstance().isModuleEntity(sForeignEntity)
                          && field.getForeignEntityField() != null) {
                        String sForeignField = field.getForeignEntityField();
                        if (sForeignField.indexOf("${") >= 0) {
                          attr.setDatatyp(DataTyp.getReferenzTyp());
                        } else {
                          EntityFieldMetaDataVO voField =
                              MetaDataClientProvider.getInstance()
                                  .getEntityField(sForeignEntity, field.getForeignEntityField());

                          attr.getDatatyp().setJavaType(voField.getDataType());
                          if (voField.getPrecision() != null)
                            attr.getDatatyp().setPrecision(voField.getPrecision());
                          if (voField.getScale() != null)
                            attr.getDatatyp().setScale(voField.getScale());
                          if (voField.getFormatOutput() != null)
                            attr.getDatatyp().setOutputFormat(voField.getFormatOutput());
                        }
                      }
                      if (voForeignEntity.isFieldValueEntity()) {
                        attr.setDatatyp(DataTyp.getDefaultStringTyp());
                        attr.setValueListNew(false);
                        NuclosEntityNameStep.loadValueList(attr);
                      }
                    } else if (sLookupEntity != null) {
                      attr.setLookupMetaVO(
                          MetaDataClientProvider.getInstance().getEntity(sLookupEntity));
                      attr.setOnDeleteCascade(field.isOnDeleteCascade());
                      attr.setField(field.getLookupEntityField());
                      attr.setDatatyp(DataTyp.getLookupTyp());
                      if (!Modules.getInstance().isModuleEntity(sLookupEntity)
                          && field.getLookupEntityField() != null) {
                        String sLookupField = field.getLookupEntityField();
                        if (sLookupField.indexOf("${") >= 0) {
                          attr.setDatatyp(DataTyp.getLookupTyp());
                        } else {
                          EntityFieldMetaDataVO voField =
                              MetaDataClientProvider.getInstance()
                                  .getEntityField(sLookupEntity, field.getLookupEntityField());

                          attr.getDatatyp().setJavaType(voField.getDataType());
                          if (voField.getPrecision() != null)
                            attr.getDatatyp().setPrecision(voField.getPrecision());
                          if (voField.getScale() != null)
                            attr.getDatatyp().setScale(voField.getScale());
                          if (voField.getFormatOutput() != null)
                            attr.getDatatyp().setOutputFormat(voField.getFormatOutput());
                        }
                      }
                    } else {
                      attr.setDatatyp(
                          NuclosWizardUtils.getDataTyp(
                              field.getDataType(),
                              field.getDefaultComponentType(),
                              field.getScale(),
                              field.getPrecision(),
                              field.getFormatInput(),
                              field.getFormatOutput()));
                    }
                    model.addAttribute(attr);
                  }
                  SwingUtilities.invokeLater(
                      new Runnable() {

                        @Override
                        public void run() {
                          tblFields.setModel(model);
                          TableUtils.setOptimalColumnWidths(tblFields);
                        }
                      });
                } else if (obj instanceof String) {
                  EntityAttributeSelectTableModel model = new EntityAttributeSelectTableModel();
                  tblFields.setModel(model);
                }
              } catch (Exception e1) {
                LOG.info("itemStateChanged failed: " + e1, e1);
              }
            }
          }
        });

    cbxTable.addItemListener(
        new ItemListener() {

          @Override
          public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
              final Object obj = e.getItem();
              if (obj instanceof String) {
                String strTable = (String) obj;
                final EntityAttributeSelectTableModel model = new EntityAttributeSelectTableModel();
                if (strTable.length() == 0) {
                  tblFields.setModel(model);
                  return;
                }

                Map<String, MasterDataVO> mp =
                    MetaDataDelegate.getInstance().getColumnsFromTable(strTable);
                for (String sCol : mp.keySet()) {
                  if (NuclosWizardUtils.isSystemField(sCol)) continue;
                  Attribute attr = new Attribute();
                  attr.setLabel(sCol);
                  attr.setDbName(sCol);
                  attr.setDescription(sCol);
                  attr.setInternalName(sCol);
                  MasterDataVO vo = mp.get(sCol);

                  DataTyp typ = new DataTyp();
                  typ.setPrecision((Integer) vo.getField("precision"));
                  typ.setScale((Integer) vo.getField("scale"));
                  typ.setName((String) vo.getField("name"));
                  typ.setJavaType((String) vo.getField("javatyp"));

                  attr.setDatatyp(typ);
                  setTranslationForAttribute(
                      attr, NuclosEntityOptionStep.this.model.getAttributeModel());

                  model.addAttribute(attr);
                }
                SwingUtilities.invokeLater(
                    new Runnable() {

                      @Override
                      public void run() {
                        tblFields.setModel(model);
                      }
                    });
              }
            }
          }
        });

    initPanel();

    this.add(lbName, "0,0");
    this.add(rbGatherAttributes, "1,0");
    this.add(rbCopyAttributes, "1,1");
    this.add(rbTemplateAttributes, "1,2");
    this.add(rbAssignAttributes, "1,3");
    this.add(rbImportTable, "1,4");
    this.add(lbEntity, "0,5");
    this.add(cbxEntity, "0,6");
    this.add(cbxTable, "0,6");
    this.add(pnlImport, "0,7, 1,7");
    this.add(scrollFields, "0,7 ,1,7");

    fillEntityCombobox();
    fillTableCombobox();
  }
 @Override
 public void setOctoPlusVisible(final boolean visible) {
   _octoPlusRadioButton.setVisible(visible);
 }
 @Override
 public void setSbusVisible(final boolean visible) {
   _receiverSbusRadioButton.setVisible(visible);
 }
  @Override
  protected JComponent createCenterPanel() {
    myTitledSeparator.setText(myAnalysisNoon);

    // include test option
    myInspectTestSource.setSelected(myAnalysisOptions.ANALYZE_TEST_SOURCES);

    // module scope if applicable
    myModuleButton.setText(
        AnalysisScopeBundle.message("scope.option.module.with.mnemonic", myModuleName));
    boolean useModuleScope = false;
    if (myModuleName != null) {
      useModuleScope = myAnalysisOptions.SCOPE_TYPE == AnalysisScope.MODULE;
      myModuleButton.setSelected(myRememberScope && useModuleScope);
    }

    myModuleButton.setVisible(
        myModuleName != null && ModuleManager.getInstance(myProject).getModules().length > 1);

    boolean useUncommitedFiles = false;
    final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
    final boolean hasVCS = !changeListManager.getAffectedFiles().isEmpty();
    if (hasVCS) {
      useUncommitedFiles = myAnalysisOptions.SCOPE_TYPE == AnalysisScope.UNCOMMITTED_FILES;
      myUncommitedFilesButton.setSelected(myRememberScope && useUncommitedFiles);
    }
    myUncommitedFilesButton.setVisible(hasVCS);

    DefaultComboBoxModel model = new DefaultComboBoxModel();
    model.addElement(ALL);
    final List<? extends ChangeList> changeLists = changeListManager.getChangeListsCopy();
    for (ChangeList changeList : changeLists) {
      model.addElement(changeList.getName());
    }
    myChangeLists.setModel(model);
    myChangeLists.setEnabled(myUncommitedFilesButton.isSelected());
    myChangeLists.setVisible(hasVCS);

    // file/package/directory/module scope
    if (myFileName != null) {
      myFileButton.setText(myFileName);
      myFileButton.setMnemonic(myFileName.charAt(getSelectedScopeMnemonic()));
    } else {
      myFileButton.setVisible(false);
    }

    VirtualFile file = PsiUtilBase.getVirtualFile(myContext);
    ProjectFileIndex fileIndex = ProjectRootManager.getInstance(myProject).getFileIndex();
    boolean searchInLib =
        file != null && (fileIndex.isInLibraryClasses(file) || fileIndex.isInLibrarySource(file));

    String preselect =
        StringUtil.isEmptyOrSpaces(myAnalysisOptions.CUSTOM_SCOPE_NAME)
            ? FindSettings.getInstance().getDefaultScopeName()
            : myAnalysisOptions.CUSTOM_SCOPE_NAME;
    if (searchInLib
        && GlobalSearchScope.projectScope(myProject).getDisplayName().equals(preselect)) {
      preselect = GlobalSearchScope.allScope(myProject).getDisplayName();
    }
    if (GlobalSearchScope.allScope(myProject).getDisplayName().equals(preselect)
        && myAnalysisOptions.SCOPE_TYPE == AnalysisScope.CUSTOM) {
      myAnalysisOptions.CUSTOM_SCOPE_NAME = preselect;
      searchInLib = true;
    }

    // custom scope
    myCustomScopeButton.setSelected(
        myRememberScope && myAnalysisOptions.SCOPE_TYPE == AnalysisScope.CUSTOM);

    myScopeCombo.init(myProject, searchInLib, true, preselect);

    // correct selection
    myProjectButton.setSelected(
        myRememberScope && myAnalysisOptions.SCOPE_TYPE == AnalysisScope.PROJECT
            || myFileName == null);
    myFileButton.setSelected(
        myFileName != null
            && (!myRememberScope
                || myAnalysisOptions.SCOPE_TYPE != AnalysisScope.PROJECT
                    && !useModuleScope
                    && myAnalysisOptions.SCOPE_TYPE != AnalysisScope.CUSTOM
                    && !useUncommitedFiles));

    myScopeCombo.setEnabled(myCustomScopeButton.isSelected());

    final ActionListener radioButtonPressed =
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            onScopeRadioButtonPressed();
          }
        };
    final Enumeration<AbstractButton> enumeration = myGroup.getElements();
    while (enumeration.hasMoreElements()) {
      enumeration.nextElement().addActionListener(radioButtonPressed);
    }

    // additional panel - inspection profile chooser
    JPanel wholePanel = new JPanel(new BorderLayout());
    wholePanel.add(myPanel, BorderLayout.NORTH);
    final JComponent additionalPanel = getAdditionalActionSettings(myProject);
    if (additionalPanel != null) {
      wholePanel.add(additionalPanel, BorderLayout.CENTER);
    }
    new RadioUpDownListener(
        myProjectButton,
        myModuleButton,
        myUncommitedFilesButton,
        myFileButton,
        myCustomScopeButton);
    return wholePanel;
  }