本文整理匯總了Java中com.intellij.openapi.ui.DialogWrapper.show方法的典型用法代碼示例。如果您正苦於以下問題:Java DialogWrapper.show方法的具體用法?Java DialogWrapper.show怎麽用?Java DialogWrapper.show使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.ui.DialogWrapper
的用法示例。
在下文中一共展示了DialogWrapper.show方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: invoke
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
private static void invoke(final PsiMethod method, final Project project, @Nullable final Editor editor) {
PsiMethod newMethod = SuperMethodWarningUtil.checkSuperMethod(method, RefactoringBundle.message("to.refactor"));
if (newMethod == null) return;
if (!newMethod.equals(method)) {
ChangeSignatureUtil.invokeChangeSignatureOn(newMethod, project);
return;
}
if (!CommonRefactoringUtil.checkReadOnlyStatus(project, method)) return;
final PsiClass containingClass = method.getContainingClass();
final PsiReferenceExpression refExpr = editor != null ? JavaTargetElementEvaluator.findReferenceExpression(editor) : null;
final boolean allowDelegation = containingClass != null && (!containingClass.isInterface() || PsiUtil.isLanguageLevel8OrHigher(containingClass));
final DialogWrapper dialog = new JavaChangeSignatureDialog(project, method, allowDelegation, refExpr == null ? method : refExpr);
dialog.show();
}
示例2: actionPerformed
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
@Override
public void actionPerformed(AnActionEvent e) {
List<AnAction> elements = getSelectedElements(e);
String path = ((ReopenProjectAction)elements.get(0)).getProjectPath();
final ChangeProjectIconForm form = new ChangeProjectIconForm(path);
DialogWrapper dialog = new DialogWrapper(null) {
{
init();
}
@Nullable
@Override
protected JComponent createCenterPanel() {
return form.myRootPanel;
}
};
dialog.show();
if (dialog.isOK()) {
try {
form.apply();
}
catch (IOException e1) {
System.out.println(e1);
}
}
}
示例3: showSettingsDialog
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
public static void showSettingsDialog(@Nullable Project project, final String id2Select, final String filter) {
ConfigurableGroup[] group = getConfigurableGroups(project, true);
group = filterEmptyGroups(group);
final Configurable configurable2Select = id2Select == null ? null : new ConfigurableVisitor.ByID(id2Select).find(group);
if (Registry.is("ide.new.settings.view")) {
new SettingsDialog(getProject(project), group, configurable2Select, filter).show();
return;
}
final DialogWrapper dialog = getDialog(project, group, configurable2Select);
new UiNotifyConnector.Once(dialog.getContentPane(), new Activatable.Adapter() {
@Override
public void showNotify() {
final OptionsEditor editor = (OptionsEditor)((DataProvider)dialog).getData(OptionsEditor.KEY.getName());
LOG.assertTrue(editor != null);
editor.select(configurable2Select, filter);
}
});
dialog.show();
}
示例4: showGenerationSettings
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
@Override
@NotNull
public final T showGenerationSettings(VirtualFile baseDir) throws ProcessCanceledException {
GeneratorPeer<T> peer = createPeer();
DialogWrapper dialog = new MyDialogWrapper(peer);
dialog.show();
if (dialog.getExitCode() != DialogWrapper.OK_EXIT_CODE) {
throw new ProcessCanceledException();
}
return peer.getSettings();
}
示例5: checkFacet
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
private static boolean checkFacet(final AndroidFacet facet) {
final CheckModulePanel panel = new CheckModulePanel();
panel.updateMessages(facet);
final boolean hasError = panel.hasError();
if (hasError || panel.hasWarnings()) {
DialogWrapper dialog = new DialogWrapper(facet.getModule().getProject()) {
{
if (!hasError) {
setOKButtonText("Continue");
}
init();
}
@NotNull
@Override
protected Action[] createActions() {
if (hasError) {
return new Action[]{getOKAction()};
}
return super.createActions();
}
@Override
protected JComponent createCenterPanel() {
return panel;
}
};
dialog.setTitle(hasError ? CommonBundle.getErrorTitle() : CommonBundle.getWarningTitle());
dialog.show();
return !hasError && dialog.isOK();
}
return true;
}
示例6: showStackStace
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
public static void showStackStace(@NotNull final Project project, @NotNull Throwable[] throwables) {
final StringBuilder messageBuilder = new StringBuilder();
for (Throwable t : throwables) {
if (messageBuilder.length() > 0) {
messageBuilder.append("\n\n");
}
messageBuilder.append(AndroidCommonUtils.getStackTrace(t));
}
final DialogWrapper wrapper = new DialogWrapper(project, false) {
{
init();
}
@Override
protected JComponent createCenterPanel() {
final JPanel panel = new JPanel(new BorderLayout());
final JTextArea textArea = new JTextArea(messageBuilder.toString());
textArea.setEditable(false);
textArea.setRows(40);
textArea.setColumns(70);
panel.add(ScrollPaneFactory.createScrollPane(textArea));
return panel;
}
};
wrapper.setTitle("Stack trace");
wrapper.show();
}
示例7: invokeDialog
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
@NotNull
protected PsiElement[] invokeDialog(final Project project, final PsiDirectory directory) {
final MyInputValidator validator = new JavaNameValidator(project, directory);
final MyContentPane contentPane = new MyContentPane();
final DialogWrapper dialog = new DialogWrapper(project, true) {
{
init();
setTitle(UIDesignerBundle.message("title.new.dialog"));
}
protected JComponent createCenterPanel() {
return contentPane.getPanel();
}
protected void doOKAction() {
myRecentGenerateOK = contentPane.myChkGenerateOK.isSelected();
myRecentGenerateCancel = contentPane.myChkGenerateCancel.isSelected();
myRecentGenerateMain = contentPane.myChkGenerateMain.isSelected();
final String inputString = contentPane.myTfClassName.getText().trim();
if (
validator.checkInput(inputString) &&
validator.canClose(inputString)
) {
close(OK_EXIT_CODE);
}
}
public JComponent getPreferredFocusedComponent() {
return contentPane.myTfClassName;
}
};
dialog.show();
return validator.getCreatedElements();
}
示例8: invokeDialog
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
@NotNull
protected PsiElement[] invokeDialog(Project project, PsiDirectory directory) {
final MyInputValidator validator = new JavaNameValidator(project, directory);
final DialogWrapper dialog = new MyDialog(project, validator);
dialog.show();
return validator.getCreatedElements();
}
示例9: showDialog
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
@Override
public void showDialog(@NotNull DialogWrapper dialog) {
dialog.show();
}
示例10: showDialog
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
protected void showDialog(@NotNull DialogWrapper dialog) {
dialog.show();
}