Пример #1
0
  private void updateRightPanel() {
    setOKActionEnabled(myCurrentTemplateItem != null);

    String description =
        myCurrentTemplateItem != null ? myCurrentTemplateItem.getDescription() : null;
    if (StringUtil.isNotEmpty(description)) {
      StringBuilder sb = new StringBuilder("<html><body><font face=\"Verdana\" ");
      sb.append(SystemInfo.isMac ? "" : "size=\"-1\"").append('>');
      sb.append(description).append("</font></body></html>");
      description = sb.toString();
    }
    myDescriptionPane.setText(description);
    myDescriptionPanel.setVisible(description != null);

    JComponent component =
        myCurrentTemplateItem != null ? myCurrentTemplateItem.getSettings() : null;
    myTemplateSettings.removeAll();
    if (component != null) {
      myTemplateSettings.add(
          component,
          new GridConstraints(
              0,
              0,
              1,
              1,
              GridConstraints.ANCHOR_NORTHWEST,
              GridConstraints.FILL_BOTH,
              GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
              GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
              null,
              null,
              null));
      myTemplateSettings.add(
          myProjectFormatPanel.getPanel(),
          new GridConstraints(
              1,
              0,
              1,
              1,
              GridConstraints.ANCHOR_NORTHWEST,
              GridConstraints.FILL_HORIZONTAL,
              GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
              GridConstraints.SIZEPOLICY_FIXED,
              null,
              null,
              null,
              1));
    }
    if (myCurrentTemplateItem != null)
      myCurrentTemplateItem.setNewProjectPath(myProjectPath.getPath());
    myTemplateSettingsHolder.setVisible(component != null);
  }
Пример #2
0
 private void fireProjectPathChanged(String newValue) {
   if (myCurrentTemplateItem != null) myCurrentTemplateItem.setNewProjectPath(newValue);
 }
 void saveSelection() {
   TemplateItem item = (TemplateItem) myList.getSelectedValue();
   if (item != null) {
     SelectTemplateSettings.getInstance().setLastTemplate(item.getGroupName(), item.getName());
   }
 }