本文整理汇总了Java中com.intellij.openapi.ui.Messages.CANCEL_BUTTON属性的典型用法代码示例。如果您正苦于以下问题:Java Messages.CANCEL_BUTTON属性的具体用法?Java Messages.CANCEL_BUTTON怎么用?Java Messages.CANCEL_BUTTON使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.openapi.ui.Messages
的用法示例。
在下文中一共展示了Messages.CANCEL_BUTTON属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SheetController
SheetController(final SheetMessage sheetMessage,
final String title,
final String message,
final Icon icon,
final String[] buttonTitles,
final String defaultButtonTitle,
final DialogWrapper.DoNotAskOption doNotAskOption,
final String focusedButtonTitle) {
if (icon != null) {
myIcon = icon;
}
myDoNotAskOption = doNotAskOption;
myDoNotAskResult = (doNotAskOption != null) && !doNotAskOption.isToBeShown();
mySheetMessage = sheetMessage;
buttons = new JButton[buttonTitles.length];
myResult = null;
int defaultButtonIndex = -1;
int focusedButtonIndex = -1;
for (int i = 0; i < buttons.length; i++) {
String buttonTitle = buttonTitles[i];
buttons[i] = new JButton();
buttons[i].setOpaque(false);
handleMnemonics(i, buttonTitle);
if (buttonTitle.equals(defaultButtonTitle)) {
defaultButtonIndex = i;
}
if (buttonTitle.equals(focusedButtonTitle) && !focusedButtonTitle.equals("Cancel")) {
focusedButtonIndex = i;
}
}
defaultButtonIndex = (focusedButtonIndex == defaultButtonIndex) || defaultButtonTitle == null ? 0 : defaultButtonIndex;
if (focusedButtonIndex != -1 && defaultButtonIndex != focusedButtonIndex) {
myFocusedComponent = buttons[focusedButtonIndex];
} else if (doNotAskOption != null) {
myFocusedComponent = doNotAskCheckBox;
} else if (buttons.length > 1) {
myFocusedComponent = buttons[buttons.length - 1];
}
myDefaultButton = (defaultButtonIndex == -1) ? buttons[0] : buttons[defaultButtonIndex];
if (myResult == null) {
myResult = Messages.CANCEL_BUTTON;
}
mySheetPanel = createSheetPanel(title, message, buttons);
initShadowImage();
}