本文整理匯總了Java中com.intellij.openapi.ui.DialogWrapper.isOK方法的典型用法代碼示例。如果您正苦於以下問題:Java DialogWrapper.isOK方法的具體用法?Java DialogWrapper.isOK怎麽用?Java DialogWrapper.isOK使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.ui.DialogWrapper
的用法示例。
在下文中一共展示了DialogWrapper.isOK方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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);
}
}
}
示例2: 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;
}