protected void setup(
      final AnAction action,
      JPanel root,
      final JLabel name,
      final JLabel description,
      JLabel icon) {
    name.setText(action.getTemplatePresentation().getText());
    name.setUI(DarculaWelcomeScreenLabelUI.createUI(name));
    name.setForeground(UIUtil.getPanelBackground());
    description.setUI(DarculaWelcomeScreenLabelUI.createUI(description));
    // icon.setIcon(action.getTemplatePresentation().getIcon());
    final String text = action.getTemplatePresentation().getDescription();
    final String html =
        XmlStringUtil.wrapInHtml(
            MessageFormat.format(text, ApplicationNamesInfo.getInstance().getFullProductName()));
    root.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    description.setText(html);
    description.setForeground(Gray._200);
    description.setEnabled(false);
    root.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseEntered(MouseEvent e) {
            description.setEnabled(true);
            name.setForeground(new Color(0xE09600));
          }

          @Override
          public void mouseExited(MouseEvent e) {
            description.setEnabled(false);
            name.setForeground(UIUtil.getPanelBackground());
          }

          @Override
          public void mouseClicked(MouseEvent e) {
            final ActionManager actionManager = ActionManager.getInstance();
            AnActionEvent evt =
                new AnActionEvent(
                    null,
                    DataManager.getInstance().getDataContext(e.getComponent()),
                    ActionPlaces.WELCOME_SCREEN,
                    action.getTemplatePresentation(),
                    actionManager,
                    0);
            action.beforeActionPerformedUpdate(evt);
            if (evt.getPresentation().isEnabled()) {
              action.actionPerformed(evt);
            }
          }
        });
  }
Exemplo n.º 2
0
 private JPanel getTypePanel() {
   JLabel label = new JLabel(this.entryTypeString, JLabel.CENTER);
   label.setFont(new Font("Serif", Font.BOLD, 20));
   label.setUI(new VerticalLabelUI());
   JPanel panel = new JPanel();
   panel.add(label);
   panel.setPreferredSize(new Dimension(30, 150));
   return panel;
 }
  @Nullable
  protected JComponent createCenterPanel() {
    JPanel panel = new JPanel();
    panel.setLayout(new GridBagLayout());

    GridBagConstraints gb = new GridBagConstraints();

    // top label.
    gb.insets = JBUI.insets(2);
    gb.weightx = 1;
    gb.weighty = 0;
    gb.gridwidth = 2;
    gb.gridheight = 1;
    gb.gridx = 0;
    gb.gridy = 0;
    gb.anchor = GridBagConstraints.WEST;
    gb.fill = GridBagConstraints.HORIZONTAL;

    File adminPath = new File(myPath, SVNFileUtil.getAdminDirectoryName());
    final boolean adminPathIsDirectory = adminPath.isDirectory();
    final String label = getMiddlePartOfResourceKey(adminPathIsDirectory);

    JLabel topLabel = new JLabel(getTopMessage(label));
    topLabel.setUI(new MultiLineLabelUI());
    panel.add(topLabel, gb);
    gb.gridy += 1;

    registerFormat(WorkingCopyFormat.ONE_DOT_SIX, label, panel, gb);
    registerFormat(WorkingCopyFormat.ONE_DOT_SEVEN, label, panel, gb);
    registerFormat(WorkingCopyFormat.ONE_DOT_EIGHT, label, panel, gb);

    final JPanel auxiliaryPanel = getBottomAuxiliaryPanel();
    if (auxiliaryPanel != null) {
      panel.add(auxiliaryPanel, gb);
      gb.gridy += 1;
    }

    myLoadingPanel = new JBLoadingPanel(new BorderLayout(), getDisposable());
    myLoadingPanel.add(panel, BorderLayout.CENTER);

    return myLoadingPanel;
  }
Exemplo n.º 4
0
  private JPanel getAbschnitt2() {
    FormLayout abschnitt2Pan =
        new FormLayout(
            "10dlu,70dlu,5dlu,p,10dlu,70dlu,5dlu,p,10dlu,70dlu,5dlu,p,10dlu",
            "10dlu,p,5dlu,p,5dlu,p,10dlu,p,5dlu,p,10dlu,p,5dlu,p,10dlu");
    PanelBuilder pabschnitt2 = new PanelBuilder(abschnitt2Pan);
    pabschnitt2.getPanel().setOpaque(false);
    CellConstraints ca2 = new CellConstraints();

    JLabel lbl1 = new JLabel("<html><u>Fomulardaten:</u>");
    pabschnitt2.add(lbl1, ca2.xy(2, 2));
    JLabel lbl2 = new JLabel("Fomulartyp:");
    pabschnitt2.add(lbl2, ca2.xy(2, 4));

    combobox2 =
        new JComboBox(new String[] {"4-Zeilig mit Fahrtkosten", "10-Zeilig o. Fahrtkosten"});
    combobox2.setActionCommand("zeilig");
    combobox2.addActionListener(this);
    pabschnitt2.add(combobox2, ca2.xyw(2, 6, 5));

    // JLabel lbl3 = new JLabel();
    JLabel lbl3 =
        new JLabel(
            "Abstand in Millimeter\nvom oberen Blattrand\nbis zur ersten\nDatumszeile:",
            null,
            SwingConstants.LEFT);
    lbl3.setHorizontalTextPosition(SwingConstants.LEFT);
    lbl3.setUI(new MultiLineLabelUI());
    pabschnitt2.add(lbl3, ca2.xy(2, 8));
    JLabel lbl4 =
        new JLabel(
            "Abstand in Millimeter\nvom linken Blattrand\nbiszum Beginn der\n1.Datumslinie:",
            null,
            SwingConstants.LEFT);
    lbl4.setHorizontalTextPosition(SwingConstants.LEFT);
    lbl4.setUI(new MultiLineLabelUI());
    pabschnitt2.add(lbl4, ca2.xy(6, 8));
    JLabel lbl5 =
        new JLabel(
            "Abstand in Millimeter\nzwischen den\nDatumszeilen\n(Y-Richtung):",
            null,
            SwingConstants.LEFT);
    lbl5.setHorizontalTextPosition(SwingConstants.LEFT);
    lbl5.setUI(new MultiLineLabelUI());
    pabschnitt2.add(lbl5, ca2.xy(10, 8));

    tf1[1] = new JRtaTextField("D", true, "6.2", "");
    tf1[1].setText("174,00");
    pabschnitt2.add(tf1[1], ca2.xy(2, 10));
    tf1[2] = new JRtaTextField("D", true, "6.2", "");
    tf1[2].setText("23,00");
    pabschnitt2.add(tf1[2], ca2.xy(6, 10));
    tf1[3] = new JRtaTextField("D", true, "6.2", "");
    tf1[3].setText("8,00");
    pabschnitt2.add(tf1[3], ca2.xy(10, 10));

    JLabel lbl6 = new JLabel("mm");
    pabschnitt2.add(lbl6, ca2.xy(4, 10));
    JLabel lbl7 = new JLabel("mm");
    pabschnitt2.add(lbl7, ca2.xy(8, 10));
    JLabel lbl8 = new JLabel("mm");
    pabschnitt2.add(lbl8, ca2.xy(12, 10));

    JLabel lbl9 = new JLabel("Länge der einzelnen\nDatumslinien:", null, SwingConstants.LEFT);
    lbl9.setHorizontalTextPosition(SwingConstants.LEFT);
    lbl9.setUI(new MultiLineLabelUI());
    pabschnitt2.add(lbl9, ca2.xy(2, 12));
    JLabel lbl10 =
        new JLabel(
            "Abstand in Millimeter\nzwischen den\nDatumsfeldern\n(X-Richtung):",
            null,
            SwingConstants.LEFT);
    lbl10.setHorizontalTextPosition(SwingConstants.LEFT);
    lbl10.setUI(new MultiLineLabelUI());
    pabschnitt2.add(lbl10, ca2.xy(6, 12));

    tf1[4] = new JRtaTextField("D", true, "6.2", "");
    tf1[4].setText("25,00");
    pabschnitt2.add(tf1[4], ca2.xy(2, 14));
    tf1[5] = new JRtaTextField("D", true, "6.2", "");
    tf1[5].setText("5,50");
    pabschnitt2.add(tf1[5], ca2.xy(6, 14));

    JLabel lbl11 = new JLabel("mm");
    pabschnitt2.add(lbl11, ca2.xy(4, 14));
    JLabel lbl12 = new JLabel("mm");
    pabschnitt2.add(lbl12, ca2.xy(8, 14));

    pabschnitt2.getPanel().validate();
    return pabschnitt2.getPanel();
  }
Exemplo n.º 5
0
 /** This method resets the label's UI delegate to the default UI for the current look and feel. */
 public void updateUI() {
   setUI((LabelUI) UIManager.getUI(this));
 }
Exemplo n.º 6
0
  /**
   * CLSdkChooserPanel - the panel to choose Common Lisp SDK
   *
   * @param project Current project
   */
  public CLSdkChooserPanel(final Project project) {
    myJdkChooser =
        new JdkChooserPanel(
            project, ApplicationManager.getApplication().getComponent(CLSdkType.class));

    setLayout(new GridBagLayout());
    setBorder(BorderFactory.createEtchedBorder());

    final JLabel label = new JLabel(CLBundle.message("module.cl.select.jdk"));
    label.setUI(new MultiLineLabelUI());
    add(
        label,
        new GridBagConstraints(
            0,
            GridBagConstraints.RELATIVE,
            2,
            1,
            1.0,
            0.0,
            GridBagConstraints.NORTHWEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(8, 10, 8, 10),
            0,
            0));

    final JLabel jdklabel = new JLabel(CLBundle.message("module.cl.prompt.label.project.jdk"));
    jdklabel.setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD));
    add(
        jdklabel,
        new GridBagConstraints(
            0,
            GridBagConstraints.RELATIVE,
            2,
            1,
            1.0,
            0.0,
            GridBagConstraints.NORTHWEST,
            GridBagConstraints.NONE,
            new Insets(8, 10, 0, 10),
            0,
            0));

    add(
        myJdkChooser,
        new GridBagConstraints(
            0,
            GridBagConstraints.RELATIVE,
            1,
            1,
            1.0,
            1.0,
            GridBagConstraints.NORTHWEST,
            GridBagConstraints.BOTH,
            new Insets(2, 10, 10, 5),
            0,
            0));
    JButton configureButton = new JButton(CLBundle.message("button.configure"));
    add(
        configureButton,
        new GridBagConstraints(
            1,
            GridBagConstraints.RELATIVE,
            1,
            1,
            0.0,
            1.0,
            GridBagConstraints.NORTHWEST,
            GridBagConstraints.NONE,
            new Insets(2, 0, 10, 5),
            0,
            0));

    configureButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            myJdkChooser.editJdkTable();
          }
        });
  }
Exemplo n.º 7
0
 public void setUI(LabelUI ui) {
   super.setUI(UI);
 }