/*
 * Copyright 2000-2009 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.intellij.refactoring.util;

import com.intellij.openapi.help.HelpManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.MultiLineLabelUI;
import org.jetbrains.annotations.NonNls;

import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;

public class RefactoringMessageDialog extends DialogWrapper{
  private final String myMessage;
  private final String myHelpTopic;
  private final Icon myIcon;
  private final boolean myIsCancelButtonVisible;

  public RefactoringMessageDialog(String title, String message, String helpTopic, @NonNls String iconId, boolean showCancelButton, Project project) {
    super(project, false);
    setTitle(title);
    myMessage = message;
    myHelpTopic = helpTopic;
    myIsCancelButtonVisible =showCancelButton;
    setButtonsAlignment(SwingUtilities.CENTER);
    myIcon = UIManager.getIcon(iconId);
    init();
  }

  protected Action[] createActions(){
    ArrayList<Action> actions=new ArrayList<Action>();
    actions.add(getOKAction());
    if(myIsCancelButtonVisible){
      actions.add(getCancelAction());
    }
    if(myHelpTopic!=null){
      actions.add(getHelpAction());
    }
    return actions.toArray(new Action[actions.size()]);
  }

  protected JComponent createNorthPanel() {
    JLabel label = new JLabel(myMessage);
    label.setUI(new MultiLineLabelUI());
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(label, BorderLayout.CENTER);
    if (myIcon != null) {
      label.setIcon(myIcon);
      label.setIconTextGap(10);
    }
    panel.add(Box.createVerticalStrut(7), BorderLayout.SOUTH);
    return panel;
  }

  protected JComponent createCenterPanel() {
    return null;
  }

  protected void doHelpAction() {
    HelpManager.getInstance().invokeHelp(myHelpTopic);
  }
}

@@ -20,10 +20,10 @@
 0-20
-09
+11
  Jet
@@ -594,17 +594,16 @@
 se.%0A */%0A
-%0A
 package 
@@ -930,16 +930,39 @@
 rayList;
+%0Aimport java.util.List;
 %0A%0Apublic
@@ -1014,16 +1014,17 @@
 gWrapper
+ 
 %7B%0A  priv
@@ -1447,16 +1447,17 @@
 isible =
+ 
 showCanc
@@ -1470,56 +1470,8 @@
 on;%0A
-    setButtonsAlignment(SwingUtilities.CENTER);%0A
     
@@ -1515,32 +1515,44 @@
    init();%0A  %7D%0A%0A
+  @Override%0A
   protected Acti
@@ -1575,19 +1575,15 @@
 ns()
+ 
 %7B%0A    
-Array
 List
@@ -1598,17 +1598,19 @@
  actions
-=
+ = 
 new Arra
@@ -1664,16 +1664,17 @@
 ;%0A    if
+ 
 (myIsCan
@@ -1690,16 +1690,17 @@
 Visible)
+ 
 %7B%0A      
@@ -1743,16 +1743,17 @@
 %7D%0A    if
+ 
 (myHelpT
@@ -1760,15 +1760,18 @@
 opic
+ 
 !=
+ 
 null)
+ 
 %7B%0A  
@@ -1867,24 +1867,36 @@
 e()%5D);%0A  %7D%0A%0A
+  @Override%0A
   protected 
@@ -2006,24 +2006,25 @@
 LabelUI());%0A
+%0A
     JPanel p
@@ -2062,188 +2062,182 @@
 out(
-));%0A    panel.add(label, BorderLayout.CENTER);%0A    if (myIcon != null) %7B%0A      label.setIcon(myIcon);%0A      label.setIconTextGap(10);%0A    %7D%0A    panel.add(Box.createVerticalStrut(7)
+10, 0));%0A    if (myIcon != null) %7B%0A      panel.add(new JLabel(myIcon), BorderLayout.WEST);%0A      panel.add(label, BorderLayout.CENTER);%0A    %7D%0A    else %7B%0A      panel.add(label
 , Bo
@@ -2251,15 +2251,20 @@
 out.
-SOUTH);
+WEST);%0A    %7D
 %0A   
@@ -2275,32 +2275,44 @@
 urn panel;%0A  %7D%0A%0A
+  @Override%0A
   protected JCom
@@ -2362,16 +2362,28 @@
 l;%0A  %7D%0A%0A
+  @Override%0A
   protec

Fix refactoring message dialog for GTK+