Dialog Wrapper: get fit

This commit is contained in:
Konstantin Bulenkov
2012-02-13 10:16:55 +01:00
parent 7375e505d1
commit 5224001197
10 changed files with 72 additions and 48 deletions
@@ -44,7 +44,6 @@ import com.intellij.util.ui.DialogUtil;
import com.intellij.util.ui.UIUtil;
import org.intellij.lang.annotations.MagicConstant;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
@@ -1717,48 +1716,4 @@ public abstract class DialogWrapper {
}
private static enum ErrorPaintingType {DOT, SIGN, LINE}
public static final class ValidationInfo {
public final String message;
public final JComponent component;
public ValidationInfo(@NotNull String message, @Nullable JComponent component) {
this.message = message;
this.component = component;
}
public ValidationInfo(@NotNull String message) {
this(message, null);
}
}
public interface OptionAction extends Action {
@NotNull
Action[] getOptions();
abstract class Impl extends AbstractAction implements OptionAction {
private Action[] myOptions;
public Impl(@NotNull Action[] options) {
myOptions = options;
}
public Impl(String name, @NotNull Action[] options) {
super(name);
myOptions = options;
}
public Impl(String name, Icon icon, @NotNull Action[] options) {
super(name, icon);
myOptions = options;
}
@Override
public Action[] getOptions() {
return myOptions;
}
}
}
}
@@ -0,0 +1,28 @@
/*
* Copyright 2000-2012 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.openapi.ui;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
/**
* @author Konstantin Bulenkov
*/
public interface OptionAction extends Action {
@NotNull
Action[] getOptions();
}
@@ -0,0 +1,38 @@
/*
* Copyright 2000-2012 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.openapi.ui;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
/**
* @author Konstantin Bulenkov
*/
public final class ValidationInfo {
public final String message;
public final JComponent component;
public ValidationInfo(@NotNull String message, @Nullable JComponent component) {
this.message = message;
this.component = component;
}
public ValidationInfo(@NotNull String message) {
this(message, null);
}
}
@@ -18,6 +18,7 @@ package com.intellij.internal.validation;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.ui.ValidationInfo;
import javax.swing.*;
import java.util.regex.Pattern;
@@ -522,9 +522,6 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
return myHelpId;
}
private class CommitAction extends AbstractAction implements OptionAction {
private Action[] myOptions = new Action[0];
@@ -11,6 +11,7 @@ import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleType;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.ui.ValidationInfo;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.components.JBLabel;
@@ -14,6 +14,7 @@ import com.intellij.openapi.editor.ex.FocusChangeListener;
import com.intellij.openapi.keymap.KeymapUtil;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.ValidationInfo;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.EnumComboBoxModel;
@@ -17,6 +17,7 @@ package git4idea.checkin;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.ValidationInfo;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
@@ -25,6 +25,7 @@ import com.intellij.openapi.editor.Document;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.ui.ValidationInfo;
import com.intellij.psi.*;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.search.ProjectScope;
@@ -18,6 +18,7 @@ package org.jetbrains.plugins.groovy.refactoring.introduce.parameter;
import com.intellij.openapi.application.AccessToken;
import com.intellij.openapi.application.WriteAction;
import com.intellij.openapi.ui.Splitter;
import com.intellij.openapi.ui.ValidationInfo;
import com.intellij.openapi.ui.VerticalFlowLayout;
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.text.StringUtil;