public DvcsCommitAdditionalComponent(
      @NotNull final Project project, @NotNull CheckinProjectPanel panel) {
    myCheckinPanel = panel;
    myPanel = new JPanel(new GridBagLayout());
    final Insets insets = new Insets(2, 2, 2, 2);
    // add amend checkbox
    GridBagConstraints c = new GridBagConstraints();
    // todo change to MigLayout
    c.gridx = 0;
    c.gridy = 1;
    c.gridwidth = 2;
    c.anchor = GridBagConstraints.CENTER;
    c.insets = insets;
    c.weightx = 1;
    c.fill = GridBagConstraints.HORIZONTAL;

    myAmend = new NonFocusableCheckBox(DvcsBundle.message("commit.amend"));
    myAmend.setMnemonic('m');
    myAmend.setToolTipText(DvcsBundle.message("commit.amend.tooltip"));
    myPreviousMessage = myCheckinPanel.getCommitMessage();

    myAmend.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            if (myAmend.isSelected()) {
              if (myPreviousMessage.equals(
                  myCheckinPanel
                      .getCommitMessage())) { // if user has already typed something, don't revert
                                              // it
                if (myMessagesForRoots == null) {
                  loadMessagesInModalTask(project); // load all commit messages for all repositories
                }
                String message = constructAmendedMessage();
                if (!StringUtil.isEmptyOrSpaces(message)) {
                  myAmendedMessage = message;
                  substituteCommitMessage(myAmendedMessage);
                }
              }
            } else {
              // there was the amended message, but user has changed it => not reverting
              if (myCheckinPanel.getCommitMessage().equals(myAmendedMessage)) {
                myCheckinPanel.setCommitMessage(myPreviousMessage);
              }
            }
          }
        });
    myPanel.add(myAmend, c);
  }
  public AmendComponent(
      @NotNull Project project,
      @NotNull RepositoryManager<? extends Repository> repoManager,
      @NotNull CheckinProjectPanel panel,
      @NotNull String title) {
    myRepoManager = repoManager;
    myCheckinPanel = panel;
    myAmend = new NonFocusableCheckBox(title);
    myAmend.setMnemonic('m');
    myAmend.setToolTipText(DvcsBundle.message("commit.amend.tooltip"));
    myPreviousMessage = myCheckinPanel.getCommitMessage();

    myAmend.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            if (myAmend.isSelected()) {
              if (myPreviousMessage.equals(
                  myCheckinPanel
                      .getCommitMessage())) { // if user has already typed something, don't revert
                                              // it
                if (myMessagesForRoots == null) {
                  loadMessagesInModalTask(project); // load all commit messages for all repositories
                }
                String message = constructAmendedMessage();
                if (!StringUtil.isEmptyOrSpaces(message)) {
                  myAmendedMessage = message;
                  substituteCommitMessage(myAmendedMessage);
                }
              }
            } else {
              // there was the amended message, but user has changed it => not reverting
              if (myCheckinPanel.getCommitMessage().equals(myAmendedMessage)) {
                myCheckinPanel.setCommitMessage(myPreviousMessage);
              }
            }
          }
        });
  }
    protected void initComponents(
        AirspaceBuilderModel model, final AirspaceBuilderController controller) {
      final JCheckBox resizeNewShapesCheckBox;
      final JCheckBox enableEditCheckBox;

      JPanel newShapePanel = new JPanel();
      {
        JButton newShapeButton = new JButton("New shape");
        newShapeButton.setActionCommand(NEW_AIRSPACE);
        newShapeButton.addActionListener(controller);
        newShapeButton.setToolTipText("Create a new shape centered in the viewport");

        this.factoryComboBox = new JComboBox(defaultAirspaceFactories);
        this.factoryComboBox.setEditable(false);
        this.factoryComboBox.setToolTipText("Choose shape type to create");

        resizeNewShapesCheckBox = new JCheckBox("Fit new shapes to viewport");
        resizeNewShapesCheckBox.setActionCommand(SIZE_NEW_SHAPES_TO_VIEWPORT);
        resizeNewShapesCheckBox.addActionListener(controller);
        resizeNewShapesCheckBox.setSelected(controller.isResizeNewShapesToViewport());
        resizeNewShapesCheckBox.setAlignmentX(Component.LEFT_ALIGNMENT);
        resizeNewShapesCheckBox.setToolTipText(
            "New shapes are sized to fit the geographic viewport");

        enableEditCheckBox = new JCheckBox("Enable shape editing");
        enableEditCheckBox.setActionCommand(ENABLE_EDIT);
        enableEditCheckBox.addActionListener(controller);
        enableEditCheckBox.setSelected(controller.isEnableEdit());
        enableEditCheckBox.setAlignmentX(Component.LEFT_ALIGNMENT);
        enableEditCheckBox.setToolTipText("Allow modifications to shapes");

        Box newShapeBox = Box.createHorizontalBox();
        newShapeBox.add(newShapeButton);
        newShapeBox.add(Box.createHorizontalStrut(5));
        newShapeBox.add(this.factoryComboBox);
        newShapeBox.setAlignmentX(Component.LEFT_ALIGNMENT);

        JPanel gridPanel = new JPanel(new GridLayout(0, 1, 0, 5)); // rows, cols, hgap, vgap
        gridPanel.add(newShapeBox);
        gridPanel.add(resizeNewShapesCheckBox);
        gridPanel.add(enableEditCheckBox);

        newShapePanel.setLayout(new BorderLayout());
        newShapePanel.add(gridPanel, BorderLayout.NORTH);
      }

      JPanel entryPanel = new JPanel();
      {
        this.entryTable = new JTable(model);
        this.entryTable.setColumnSelectionAllowed(false);
        this.entryTable.setRowSelectionAllowed(true);
        this.entryTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        this.entryTable
            .getSelectionModel()
            .addListSelectionListener(
                new ListSelectionListener() {
                  public void valueChanged(ListSelectionEvent e) {
                    if (!ignoreSelectEvents) {
                      controller.actionPerformed(
                          new ActionEvent(e.getSource(), -1, SELECTION_CHANGED));
                    }
                  }
                });
        this.entryTable.setToolTipText("<html>Click to select<br>Double-Click to rename</html>");

        JScrollPane tablePane = new JScrollPane(this.entryTable);
        tablePane.setPreferredSize(new Dimension(200, 100));

        entryPanel.setLayout(new BorderLayout(0, 0)); // hgap, vgap
        entryPanel.add(tablePane, BorderLayout.CENTER);
      }

      JPanel selectionPanel = new JPanel();
      {
        JButton delselectButton = new JButton("Deselect");
        delselectButton.setActionCommand(CLEAR_SELECTION);
        delselectButton.addActionListener(controller);
        delselectButton.setToolTipText("Clear the selection");

        JButton deleteButton = new JButton("Delete Selected");
        deleteButton.setActionCommand(REMOVE_SELECTED);
        deleteButton.addActionListener(controller);
        deleteButton.setToolTipText("Delete selected shapes");

        JPanel gridPanel = new JPanel(new GridLayout(0, 1, 0, 5)); // rows, cols, hgap, vgap
        gridPanel.add(delselectButton);
        gridPanel.add(deleteButton);

        selectionPanel.setLayout(new BorderLayout());
        selectionPanel.add(gridPanel, BorderLayout.NORTH);
      }

      this.setLayout(new BorderLayout(30, 0)); // hgap, vgap
      this.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); // top, left, bottom, right
      this.add(newShapePanel, BorderLayout.WEST);
      this.add(entryPanel, BorderLayout.CENTER);
      this.add(selectionPanel, BorderLayout.EAST);

      controller.addPropertyChangeListener(
          new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent e) {
              if (SIZE_NEW_SHAPES_TO_VIEWPORT.equals(e.getPropertyName())) {
                resizeNewShapesCheckBox.setSelected(controller.isResizeNewShapesToViewport());
              } else if (ENABLE_EDIT.equals(e.getPropertyName())) {
                enableEditCheckBox.setSelected(controller.isEnableEdit());
              }
            }
          });
    }
 private void addToolTips() {
   _translationFactorSpinner.setToolTipText(
       "Für Punkte, die auf einer Straße liegen, wird die Darstellung orthogonal um diese Länge verschoben.");
   _joinByLineCheckBox.setToolTipText(
       "Hier wird festgelegt, ob die verschobene Darstellung mit dem Lagepunkt durch eine Linie verbunden wird.");
 }
示例#5
0
    private void createUI() {

      setThumbnailSubsampling();
      final Dimension imageSize = getScaledImageSize();
      thumbnailLoader =
          new ProgressMonitorSwingWorker<BufferedImage, Object>(
              this, "Loading thumbnail image...") {

            @Override
            protected BufferedImage doInBackground(ProgressMonitor pm) throws Exception {
              return createThumbNailImage(imageSize, pm);
            }

            @Override
            protected void done() {
              BufferedImage thumbnail = null;
              try {
                thumbnail = get();
              } catch (Exception e) {
                if (e instanceof IOException) {
                  showErrorDialog("Failed to load thumbnail image:\n" + e.getMessage());
                }
              }

              if (thumbnail != null) {
                imageCanvas.setImage(thumbnail);
              }
            }
          };
      thumbnailLoader.execute();
      imageCanvas = new SliderBoxImageDisplay(imageSize.width, imageSize.height, this);
      imageCanvas.setSize(imageSize.width, imageSize.height);
      setComponentName(imageCanvas, "ImageCanvas");

      imageScrollPane = new JScrollPane(imageCanvas);
      imageScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
      imageScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
      imageScrollPane
          .getViewport()
          .setExtentSize(new Dimension(MAX_THUMBNAIL_WIDTH, 2 * MAX_THUMBNAIL_WIDTH));
      setComponentName(imageScrollPane, "ImageScrollPane");

      subsetWidthLabel = new JLabel("####", JLabel.RIGHT);
      subsetHeightLabel = new JLabel("####", JLabel.RIGHT);

      setToVisibleButton = new JButton("Use Preview"); /*I18N*/
      setToVisibleButton.setMnemonic('v');
      setToVisibleButton.setToolTipText("Use coordinates of visible thumbnail area"); /*I18N*/
      setToVisibleButton.addActionListener(this);
      setComponentName(setToVisibleButton, "UsePreviewButton");

      fixSceneWidthCheck = new JCheckBox("Fix full width");
      fixSceneWidthCheck.setMnemonic('w');
      fixSceneWidthCheck.setToolTipText("Checks whether or not to fix the full scene width");
      fixSceneWidthCheck.addActionListener(this);
      setComponentName(fixSceneWidthCheck, "FixWidthCheck");

      fixSceneHeightCheck = new JCheckBox("Fix full height");
      fixSceneHeightCheck.setMnemonic('h');
      fixSceneHeightCheck.setToolTipText("Checks whether or not to fix the full scene height");
      fixSceneHeightCheck.addActionListener(this);
      setComponentName(fixSceneHeightCheck, "FixHeightCheck");

      JPanel textInputPane = GridBagUtils.createPanel();
      setComponentName(textInputPane, "TextInputPane");
      final JTabbedPane tabbedPane = new JTabbedPane();
      setComponentName(tabbedPane, "coordinatePane");
      tabbedPane.addTab("Pixel Coordinates", createPixelCoordinatesPane());
      tabbedPane.addTab("Geo Coordinates", createGeoCoordinatesPane());
      tabbedPane.setEnabledAt(1, canUseGeoCoordinates(product));

      GridBagConstraints gbc =
          GridBagUtils.createConstraints("insets.left=7,anchor=WEST,fill=HORIZONTAL, weightx=1.0");
      GridBagUtils.setAttributes(gbc, "gridwidth=2");
      GridBagUtils.addToPanel(textInputPane, tabbedPane, gbc, "gridx=0,gridy=0");

      GridBagUtils.setAttributes(gbc, "insets.top=7,gridwidth=1");
      GridBagUtils.addToPanel(textInputPane, new JLabel("Scene step X:"), gbc, "gridx=0,gridy=1");
      GridBagUtils.addToPanel(
          textInputPane, UIUtils.createSpinner(paramSX, 1, "#0"), gbc, "gridx=1,gridy=1");
      GridBagUtils.setAttributes(gbc, "insets.top=1");
      GridBagUtils.addToPanel(textInputPane, new JLabel("Scene step Y:"), gbc, "gridx=0,gridy=2");
      GridBagUtils.addToPanel(
          textInputPane, UIUtils.createSpinner(paramSY, 1, "#0"), gbc, "gridx=1,gridy=2");

      GridBagUtils.setAttributes(gbc, "insets.top=4");
      GridBagUtils.addToPanel(
          textInputPane, new JLabel("Subset scene width:"), gbc, "gridx=0,gridy=3");
      GridBagUtils.addToPanel(textInputPane, subsetWidthLabel, gbc, "gridx=1,gridy=3");

      GridBagUtils.setAttributes(gbc, "insets.top=1");
      GridBagUtils.addToPanel(
          textInputPane, new JLabel("Subset scene height:"), gbc, "gridx=0,gridy=4");
      GridBagUtils.addToPanel(textInputPane, subsetHeightLabel, gbc, "gridx=1,gridy=4");

      GridBagUtils.setAttributes(gbc, "insets.top=4,gridwidth=1");
      GridBagUtils.addToPanel(
          textInputPane, new JLabel("Source scene width:"), gbc, "gridx=0,gridy=5");
      GridBagUtils.addToPanel(
          textInputPane,
          new JLabel(String.valueOf(product.getSceneRasterWidth()), JLabel.RIGHT),
          gbc,
          "gridx=1,gridy=5");

      GridBagUtils.setAttributes(gbc, "insets.top=1");
      GridBagUtils.addToPanel(
          textInputPane, new JLabel("Source scene height:"), gbc, "gridx=0,gridy=6");
      GridBagUtils.addToPanel(
          textInputPane,
          new JLabel(String.valueOf(product.getSceneRasterHeight()), JLabel.RIGHT),
          gbc,
          "gridx=1,gridy=6");

      GridBagUtils.setAttributes(gbc, "insets.top=7,gridwidth=1, gridheight=2");
      GridBagUtils.addToPanel(textInputPane, setToVisibleButton, gbc, "gridx=0,gridy=7");

      GridBagUtils.setAttributes(gbc, "insets.top=7,gridwidth=1, gridheight=1");
      GridBagUtils.addToPanel(textInputPane, fixSceneWidthCheck, gbc, "gridx=1,gridy=7");

      GridBagUtils.setAttributes(gbc, "insets.top=1,gridwidth=1");
      GridBagUtils.addToPanel(textInputPane, fixSceneHeightCheck, gbc, "gridx=1,gridy=8");

      setLayout(new BorderLayout(4, 4));
      add(imageScrollPane, BorderLayout.WEST);
      add(textInputPane, BorderLayout.CENTER);
      setBorder(BorderFactory.createEmptyBorder(7, 7, 7, 7));

      updateUIState(null);
      imageCanvas.scrollRectToVisible(imageCanvas.getSliderBoxBounds());
    }
示例#6
0
  public Component getCustomOptionComponent() {

    /* DEPTH */
    final JSpinner jspnMaxDepth = new JSpinner(new SpinnerNumberModel(s_maxDepth + 1, 1, 100, 1));
    jspnMaxDepth.addChangeListener(
        new ChangeListener() {

          public void stateChanged(ChangeEvent e) {
            Integer value = (Integer) ((JSpinner) e.getSource()).getValue();
            s_maxDepth = value - 1;

            logger.debug("maxDepth " + (s_maxDepth + 1));
          }
        });
    final JRadioButton jrbMaxDepth = new JRadioButton("Depth");
    final JLabel lblMaxDepth = new JLabel("Depth: ");

    final JPanel jpMaxDepthSub =
        new JPanel() {
          @Override
          public void setEnabled(boolean b) {
            super.setEnabled(b);
            jspnMaxDepth.setEnabled(b);
            lblMaxDepth.setEnabled(b);
          }
        };
    jpMaxDepthSub.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 0));
    jpMaxDepthSub.add(lblMaxDepth);
    jpMaxDepthSub.add(jspnMaxDepth);

    ///
    final JPanel jpMaxDepth =
        new JPanel() {
          @Override
          public void setEnabled(boolean b) {
            super.setEnabled(b);
            jrbMaxDepth.setEnabled(b);
            jpMaxDepthSub.setEnabled(b);
          }
        };

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

    jpMaxDepth.add(GuiUtil.addComponentAsFlow(jrbMaxDepth, FlowLayout.LEFT));
    jpMaxDepth.add(GuiUtil.addComponentAsFlow(jpMaxDepthSub, FlowLayout.RIGHT));

    /* REPETITION */
    final JSpinner jspnMaxRept = new JSpinner(new SpinnerNumberModel(s_maxRept, 1, 100, 1));
    jspnMaxRept.addChangeListener(
        new ChangeListener() {

          public void stateChanged(ChangeEvent e) {
            s_maxRept = (Integer) ((JSpinner) e.getSource()).getValue();

            logger.debug("maxRept " + s_maxRept);
          }
        });

    final JRadioButton jrbMaxRept = new JRadioButton("Repetition");

    final JLabel lblMaxRept = new JLabel("Count: ");

    final JPanel jpMaxReptSub =
        new JPanel() {
          @Override
          public void setEnabled(boolean b) {
            super.setEnabled(b);
            jspnMaxRept.setEnabled(b);
            lblMaxRept.setEnabled(b);
          }
        };
    jpMaxReptSub.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 0));
    jpMaxReptSub.add(lblMaxRept);
    jpMaxReptSub.add(jspnMaxRept);

    final JPanel jpMaxRept =
        new JPanel() {
          @Override
          public void setEnabled(boolean b) {
            super.setEnabled(b);
            jrbMaxRept.setEnabled(b);
            jpMaxReptSub.setEnabled(b);
          }
        };
    jpMaxRept.setLayout(new BoxLayout(jpMaxRept, BoxLayout.Y_AXIS));

    jpMaxRept.add(GuiUtil.addComponentAsFlow(jrbMaxRept, FlowLayout.LEFT));
    jpMaxRept.add(GuiUtil.addComponentAsFlow(jpMaxReptSub, FlowLayout.RIGHT));

    ///////////////////////////////////////
    final JLabel lbl = new JLabel("Limit search by:", SwingConstants.LEFT);

    final JPanel panel =
        new JPanel() {
          @Override
          public void setEnabled(boolean b) {
            super.setEnabled(b);
            lbl.setEnabled(b);
            jpMaxDepth.setEnabled(b);
            jpMaxRept.setEnabled(b);
          }

          @Override
          public void setVisible(boolean b) {
            super.setVisible(b);
            final JPanel p = this;
            //                SwingUtilities.invokeLater( new Runnable() {
            //                    public void run() {
            Window win = SwingUtilities.getWindowAncestor(p);
            System.err.println(win);
            if (win != null) {
              System.err.println("packing");
              win.pack();
            }
            //                    }
            //                } );
          }
        };
    panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
    panel.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 0));
    panel.add(GuiUtil.addComponentAsFlow(lbl, FlowLayout.LEFT));
    panel.add(jpMaxDepth);
    panel.add(jpMaxRept);

    ButtonGroup bg = new ButtonGroup();
    bg.add(jrbMaxDepth);
    bg.add(jrbMaxRept);

    /* CHECKBOX */
    final JCheckBox chboxRepeat =
        new JCheckBox("Allow subtask recursive repetition", s_isSubtaskRepetitionAllowed);

    chboxRepeat.addChangeListener(
        new ChangeListener() {

          public void stateChanged(ChangeEvent e) {
            if (s_isSubtaskRepetitionAllowed == chboxRepeat.isSelected()) return;

            s_isSubtaskRepetitionAllowed = chboxRepeat.isSelected();
            panel.setVisible(s_isSubtaskRepetitionAllowed);

            logger.debug("m_isSubtaskRepetitionAllowed " + s_isSubtaskRepetitionAllowed);
          }
        });

    panel.setVisible(s_isSubtaskRepetitionAllowed);

    final JCheckBox chboxIncremental = new JCheckBox("Incremental", s_isIncremental);
    chboxIncremental.setToolTipText("Incremental depth-first search");

    chboxIncremental.addChangeListener(
        new ChangeListener() {

          public void stateChanged(ChangeEvent e) {

            if (s_isIncremental == chboxIncremental.isSelected()) return;

            s_isIncremental = chboxIncremental.isSelected();

            logger.debug("isIncremental " + s_isIncremental);
          }
        });

    final JCheckBox chboxOptimize =
        new JCheckBox("Disable optimization in subtasks", s_disableOptimizationInSubtasks);
    chboxOptimize.setToolTipText("Use for debugging purposes");

    chboxOptimize.addChangeListener(
        new ChangeListener() {

          public void stateChanged(ChangeEvent e) {

            if (s_disableOptimizationInSubtasks == chboxOptimize.isSelected()) return;

            s_disableOptimizationInSubtasks = chboxOptimize.isSelected();

            logger.debug("disableOptimizationInSubtasks " + s_disableOptimizationInSubtasks);
          }
        });

    JPanel container1 = new JPanel();
    container1.setLayout(new BoxLayout(container1, BoxLayout.Y_AXIS));
    container1.setBorder(BorderFactory.createTitledBorder("Planning settings"));
    container1.add(GuiUtil.addComponentAsFlow(chboxOptimize, FlowLayout.LEFT));
    container1.add(GuiUtil.addComponentAsFlow(chboxIncremental, FlowLayout.LEFT));
    container1.add(GuiUtil.addComponentAsFlow(chboxRepeat, FlowLayout.LEFT));
    container1.add(GuiUtil.addComponentAsFlow(panel, FlowLayout.LEFT));

    JPanel container2 = new JPanel(new GridLayout(2, 0));
    container2.setBorder(BorderFactory.createTitledBorder("Logging options"));

    final JCheckBox linear = new JCheckBox("Detailed linear planning", isLinearLoggingOn());
    linear.addChangeListener(
        new ChangeListener() {
          public void stateChanged(ChangeEvent e) {
            setLinearLoggingOn(linear.isSelected());
          }
        });
    container2.add(linear);
    final JCheckBox subtask = new JCheckBox("Detailed subtask planning", isSubtaskLoggingOn());
    subtask.addChangeListener(
        new ChangeListener() {
          public void stateChanged(ChangeEvent e) {
            setSubtaskLoggingOn(subtask.isSelected());
          }
        });
    container2.add(subtask);

    JPanel main = new JPanel();
    main.setLayout(new BoxLayout(main, BoxLayout.Y_AXIS));
    main.add(container1);
    main.add(container2);

    return main;
  }
示例#7
0
  /** Creating the configuration form */
  private void init() {
    ResourceManagementService resources = LoggingUtilsActivator.getResourceService();

    enableCheckBox =
        new SIPCommCheckBox(resources.getI18NString("plugin.loggingutils.ENABLE_DISABLE"));
    enableCheckBox.addActionListener(this);

    sipProtocolCheckBox =
        new SIPCommCheckBox(resources.getI18NString("plugin.sipaccregwizz.PROTOCOL_NAME"));
    sipProtocolCheckBox.addActionListener(this);

    jabberProtocolCheckBox =
        new SIPCommCheckBox(resources.getI18NString("plugin.jabberaccregwizz.PROTOCOL_NAME"));
    jabberProtocolCheckBox.addActionListener(this);

    String rtpDescription =
        resources.getI18NString("plugin.loggingutils.PACKET_LOGGING_RTP_DESCRIPTION");
    rtpProtocolCheckBox =
        new SIPCommCheckBox(
            resources.getI18NString("plugin.loggingutils.PACKET_LOGGING_RTP")
                + " "
                + rtpDescription);
    rtpProtocolCheckBox.addActionListener(this);
    rtpProtocolCheckBox.setToolTipText(rtpDescription);

    ice4jProtocolCheckBox =
        new SIPCommCheckBox(resources.getI18NString("plugin.loggingutils.PACKET_LOGGING_ICE4J"));
    ice4jProtocolCheckBox.addActionListener(this);

    JPanel mainPanel = new TransparentPanel();

    add(mainPanel, BorderLayout.NORTH);

    mainPanel.setLayout(new GridBagLayout());

    GridBagConstraints c = new GridBagConstraints();

    enableCheckBox.setAlignmentX(Component.LEFT_ALIGNMENT);

    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 1.0;
    c.gridx = 0;
    c.gridy = 0;
    mainPanel.add(enableCheckBox, c);

    String label = resources.getI18NString("plugin.loggingutils.PACKET_LOGGING_DESCRIPTION");
    JLabel descriptionLabel = new JLabel(label);
    descriptionLabel.setToolTipText(label);
    enableCheckBox.setToolTipText(label);
    descriptionLabel.setForeground(Color.GRAY);
    descriptionLabel.setFont(descriptionLabel.getFont().deriveFont(8));
    c.gridy = 1;
    c.insets = new Insets(0, 25, 10, 0);
    mainPanel.add(descriptionLabel, c);

    final JPanel loggersButtonPanel = new TransparentPanel(new GridLayout(0, 1));

    loggersButtonPanel.setBorder(
        BorderFactory.createTitledBorder(resources.getI18NString("service.gui.PROTOCOL")));

    loggersButtonPanel.add(sipProtocolCheckBox);
    loggersButtonPanel.add(jabberProtocolCheckBox);
    loggersButtonPanel.add(rtpProtocolCheckBox);
    loggersButtonPanel.add(ice4jProtocolCheckBox);

    c.insets = new Insets(0, 20, 10, 0);
    c.gridy = 2;
    mainPanel.add(loggersButtonPanel, c);

    final JPanel advancedPanel = new TransparentPanel(new GridLayout(0, 2));

    advancedPanel.setBorder(
        BorderFactory.createTitledBorder(resources.getI18NString("service.gui.ADVANCED")));

    fileCountField.getDocument().addDocumentListener(this);
    fileSizeField.getDocument().addDocumentListener(this);

    fileCountLabel =
        new JLabel(resources.getI18NString("plugin.loggingutils.PACKET_LOGGING_FILE_COUNT"));
    advancedPanel.add(fileCountLabel);
    advancedPanel.add(fileCountField);
    fileSizeLabel =
        new JLabel(resources.getI18NString("plugin.loggingutils.PACKET_LOGGING_FILE_SIZE"));
    advancedPanel.add(fileSizeLabel);
    advancedPanel.add(fileSizeField);

    c.gridy = 3;
    mainPanel.add(advancedPanel, c);

    archiveButton = new JButton(resources.getI18NString("plugin.loggingutils.ARCHIVE_BUTTON"));
    archiveButton.addActionListener(this);

    c = new GridBagConstraints();
    c.anchor = GridBagConstraints.LINE_START;
    c.weightx = 0;
    c.gridx = 0;
    c.gridy = 4;
    mainPanel.add(archiveButton, c);

    if (!StringUtils.isNullOrEmpty(getUploadLocation())) {
      uploadLogsButton =
          new JButton(resources.getI18NString("plugin.loggingutils.UPLOAD_LOGS_BUTTON"));
      uploadLogsButton.addActionListener(this);

      c.insets = new Insets(10, 0, 0, 0);
      c.gridy = 5;
      mainPanel.add(uploadLogsButton, c);
    }
  }