export html action: expand text field
authorDmitry Batkovich <dmitry.batkovich@jetbrains.com>
Wed, 4 May 2016 09:24:39 +0000 (12:24 +0300)
committerDmitry Batkovich <dmitry.batkovich@jetbrains.com>
Wed, 4 May 2016 09:24:39 +0000 (12:24 +0300)
platform/lang-impl/src/com/intellij/codeInspection/export/ExportToHTMLDialog.java

index c11e840a0d0eae2f5048a5111a5d46f2c2e19e28..6eb3c423f2bef968559c2753674bffe395e0a20b 100644 (file)
@@ -22,14 +22,16 @@ import com.intellij.openapi.project.Project;
 import com.intellij.openapi.ui.DialogWrapper;
 import com.intellij.openapi.ui.TextFieldWithBrowseButton;
 import com.intellij.ui.OptionGroup;
 import com.intellij.openapi.ui.DialogWrapper;
 import com.intellij.openapi.ui.TextFieldWithBrowseButton;
 import com.intellij.ui.OptionGroup;
+import com.intellij.util.ui.GraphicsUtil;
 
 import javax.swing.*;
 
 import javax.swing.*;
+import java.awt.*;
 
 public class ExportToHTMLDialog extends DialogWrapper{
   private final Project myProject;
 
 public class ExportToHTMLDialog extends DialogWrapper{
   private final Project myProject;
-  protected JCheckBox myCbOpenInBrowser;
-  protected TextFieldWithBrowseButton myTargetDirectoryField;
-  protected final boolean myCanBeOpenInBrowser;
+  private JCheckBox myCbOpenInBrowser;
+  private TextFieldWithBrowseButton myTargetDirectoryField;
+  private final boolean myCanBeOpenInBrowser;
 
   public ExportToHTMLDialog(Project project, final boolean canBeOpenInBrowser) {
     super(project, true);
 
   public ExportToHTMLDialog(Project project, final boolean canBeOpenInBrowser) {
     super(project, true);
@@ -42,12 +44,8 @@ public class ExportToHTMLDialog extends DialogWrapper{
 
   @Override
   protected JComponent createNorthPanel() {
 
   @Override
   protected JComponent createNorthPanel() {
-    OptionGroup optionGroup = new OptionGroup();
-
     myTargetDirectoryField = new TextFieldWithBrowseButton();
     myTargetDirectoryField = new TextFieldWithBrowseButton();
-    optionGroup.add(com.intellij.codeEditor.printing.ExportToHTMLDialog.assignLabel(myTargetDirectoryField, myProject));
-
-    return optionGroup.createPanel();
+    return com.intellij.codeEditor.printing.ExportToHTMLDialog.assignLabel(myTargetDirectoryField, myProject);
   }
 
   @Override
   }
 
   @Override
@@ -71,7 +69,9 @@ public class ExportToHTMLDialog extends DialogWrapper{
     if (myCanBeOpenInBrowser) {
       myCbOpenInBrowser.setSelected(exportToHTMLSettings.OPEN_IN_BROWSER);
     }
     if (myCanBeOpenInBrowser) {
       myCbOpenInBrowser.setSelected(exportToHTMLSettings.OPEN_IN_BROWSER);
     }
-    myTargetDirectoryField.setText(exportToHTMLSettings.OUTPUT_DIRECTORY);
+    final String text = exportToHTMLSettings.OUTPUT_DIRECTORY;
+    myTargetDirectoryField.setText(text);
+    myTargetDirectoryField.setPreferredSize(new Dimension(GraphicsUtil.stringWidth(text, myTargetDirectoryField.getFont()) + 100, myTargetDirectoryField.getPreferredSize().height));
   }
 
   public void apply() {
   }
 
   public void apply() {