本文整理匯總了Java中com.intellij.util.ui.UIUtil.getWarningIcon方法的典型用法代碼示例。如果您正苦於以下問題:Java UIUtil.getWarningIcon方法的具體用法?Java UIUtil.getWarningIcon怎麽用?Java UIUtil.getWarningIcon使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.util.ui.UIUtil
的用法示例。
在下文中一共展示了UIUtil.getWarningIcon方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createCenterPanel
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
protected JComponent createCenterPanel() {
JBLabel desc = new JBLabel(wrapInHtml(makeDescription()));
JPanel options = new JPanel(new BorderLayout());
if (!myRebaseOverMergeProblemDetected) {
options.add(myAutoUpdateInFuture, BorderLayout.SOUTH);
}
if (!GitUtil.justOneGitRepository(myProject)) {
options.add(myUpdateAllRoots);
}
final int GAP = 15;
JPanel rootPanel = new JPanel(new BorderLayout(GAP, GAP));
rootPanel.add(desc);
rootPanel.add(options, BorderLayout.SOUTH);
JLabel iconLabel = new JLabel(myRebaseOverMergeProblemDetected ? UIUtil.getWarningIcon() : UIUtil.getQuestionIcon());
rootPanel.add(iconLabel, BorderLayout.WEST);
return rootPanel;
}
示例2: createCenterPanel
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
protected JComponent createCenterPanel() {
JLabel description = new JBLabel(
"<html>You are about to commit CRLF line separators to the Git repository.<br/>" +
"It is recommended to set core.autocrlf Git attribute to <code>" + RECOMMENDED_VALUE +
"</code> to avoid line separator issues.</html>");
JLabel additionalDescription = new JBLabel(
"<html>Fix and Commit: <code>git config --global core.autocrlf " + RECOMMENDED_VALUE + "</code> will be called,<br/>" +
"Commit as Is: the config value won't be set.</html>", UIUtil.ComponentStyle.SMALL);
JLabel readMore = new LinkLabel("Read more", null, new LinkListener() {
@Override
public void linkSelected(LinkLabel aSource, Object aLinkData) {
BrowserUtil.browse("https://help.github.com/articles/dealing-with-line-endings");
}
});
JLabel icon = new JLabel(UIUtil.getWarningIcon(), SwingConstants.LEFT);
myDontWarn = new JBCheckBox("Don't warn again");
myDontWarn.setMnemonic('w');
JPanel rootPanel = new JPanel(new GridBagLayout());
GridBag g = new GridBag()
.setDefaultInsets(new Insets(0, 6, DEFAULT_VGAP, DEFAULT_HGAP))
.setDefaultAnchor(GridBagConstraints.LINE_START)
.setDefaultFill(GridBagConstraints.HORIZONTAL);
rootPanel.add(icon, g.nextLine().next().coverColumn(4));
rootPanel.add(description, g.next());
rootPanel.add(readMore, g.nextLine().next().next());
rootPanel.add(additionalDescription, g.nextLine().next().next().pady(DEFAULT_HGAP));
rootPanel.add(myDontWarn, g.nextLine().next().next().insets(0, 0, 0, 0));
return rootPanel;
}
示例3: getWarningIcon
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@NotNull
public static Icon getWarningIcon() {
return UIUtil.getWarningIcon();
}
示例4: createCenterPanel
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
protected JComponent createCenterPanel() {
JLabel icon = new JLabel(UIUtil.getWarningIcon(), SwingConstants.LEFT);
JLabel description = new JLabel(getMessageText());
myNameTextField = new JTextField(20);
JBLabel nameLabel = new JBLabel("Name: ");
nameLabel.setDisplayedMnemonic('n');
nameLabel.setLabelFor(myNameTextField);
myEmailTextField = new JTextField(20);
JBLabel emailLabel = new JBLabel("E-mail: ");
emailLabel.setDisplayedMnemonic('e');
emailLabel.setLabelFor(myEmailTextField);
if (myProposedValues != null) {
myNameTextField.setText(myProposedValues.getFirst());
myEmailTextField.setText(myProposedValues.getSecond());
}
else {
myNameTextField.setText(SystemProperties.getUserName());
}
myGlobalCheckbox = new JBCheckBox("Set properties globally", true);
myGlobalCheckbox.setMnemonic('g');
JPanel rootPanel = new JPanel(new GridBagLayout());
GridBag g = new GridBag()
.setDefaultInsets(new Insets(0, 0, DEFAULT_VGAP, DEFAULT_HGAP))
.setDefaultAnchor(GridBagConstraints.LINE_START)
.setDefaultFill(GridBagConstraints.HORIZONTAL);
rootPanel.add(description, g.nextLine().next().coverLine(3).pady(DEFAULT_HGAP));
rootPanel.add(icon, g.nextLine().next().coverColumn(3));
rootPanel.add(nameLabel, g.next().fillCellNone().insets(new Insets(0, 6, DEFAULT_VGAP, DEFAULT_HGAP)));
rootPanel.add(myNameTextField, g.next());
rootPanel.add(emailLabel, g.nextLine().next().next().fillCellNone().insets(new Insets(0, 6, DEFAULT_VGAP, DEFAULT_HGAP)));
rootPanel.add(myEmailTextField, g.next());
rootPanel.add(myGlobalCheckbox, g.nextLine().next().next().coverLine(2));
return rootPanel;
}