本文整理匯總了Java中com.intellij.util.ui.UIUtil.HTML_MIME屬性的典型用法代碼示例。如果您正苦於以下問題:Java UIUtil.HTML_MIME屬性的具體用法?Java UIUtil.HTML_MIME怎麽用?Java UIUtil.HTML_MIME使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.intellij.util.ui.UIUtil
的用法示例。
在下文中一共展示了UIUtil.HTML_MIME屬性的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createCenterPanel
protected JComponent createCenterPanel() {
JPanel panel = new JPanel(new BorderLayout());
final JEditorPane messagePane = new JEditorPane(UIUtil.HTML_MIME, "");
messagePane.setEditable(false);
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(messagePane);
scrollPane.setPreferredSize(JBUI.size(500, 400));
panel.add(new JLabel(RefactoringBundle.message("the.following.problems.were.found")), BorderLayout.NORTH);
panel.add(scrollPane, BorderLayout.CENTER);
@NonNls StringBuffer buf = new StringBuffer();
for (String description : myConflictDescriptions) {
buf.append(description);
buf.append("<br><br>");
}
messagePane.setText(buf.toString());
return panel;
}
示例2: VcsCommitInfoBalloon
public VcsCommitInfoBalloon(@NotNull JTree tree) {
myTree = tree;
myEditorPane = new JEditorPane(UIUtil.HTML_MIME, "");
myEditorPane.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE);
myEditorPane.setEditable(false);
myEditorPane.setBackground(HintUtil.INFORMATION_COLOR);
myEditorPane.setFont(UIUtil.getToolTipFont());
myEditorPane.setBorder(HintUtil.createHintBorder());
Border margin = IdeBorderFactory.createEmptyBorder(3, 3, 3, 3);
myEditorPane.setBorder(new CompoundBorder(myEditorPane.getBorder(), margin));
myEditorPane.addHyperlinkListener(new HyperlinkAdapter() {
@Override
protected void hyperlinkActivated(HyperlinkEvent e) {
BrowserUtil.browse(e.getURL());
}
});
myWrapper = new Wrapper(myEditorPane);
myPopupBuilder = JBPopupFactory.getInstance().createComponentPopupBuilder(myWrapper, null);
myPopupBuilder.setCancelOnClickOutside(true).setResizable(true).setMovable(true).setRequestFocus(false)
.setMinSize(new Dimension(80, 30));
}
示例3: Browser
public Browser(@NotNull InspectionResultsView view) {
super(new BorderLayout());
myView = view;
myCurrentEntity = null;
myCurrentDescriptor = null;
myHTMLViewer = new JEditorPane(UIUtil.HTML_MIME, InspectionsBundle.message("inspection.offline.view.empty.browser.text"));
myHTMLViewer.setEditable(false);
myHyperLinkListener = new HyperlinkListener() {
@Override
public void hyperlinkUpdate(HyperlinkEvent e) {
Browser.this.hyperlinkUpdate(e);
}
};
myHTMLViewer.addHyperlinkListener(myHyperLinkListener);
final JScrollPane pane = ScrollPaneFactory.createScrollPane(myHTMLViewer);
pane.setBorder(null);
add(pane, BorderLayout.CENTER);
setupStyle();
}
示例4: createCenterPanel
@Override
protected JComponent createCenterPanel() {
JPanel panel = new JPanel(new BorderLayout(0, 2));
panel.add(new JLabel(RefactoringBundle.message("the.following.problems.were.found")), BorderLayout.NORTH);
@NonNls StringBuilder buf = new StringBuilder();
for (String description : myConflictDescriptions) {
buf.append(description);
buf.append("<br><br>");
}
JEditorPane messagePane = new JEditorPane(UIUtil.HTML_MIME, buf.toString());
messagePane.setEditable(false);
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(messagePane,
ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setPreferredSize(JBUI.size(500, 400));
panel.add(scrollPane, BorderLayout.CENTER);
if (getOKAction().isEnabled()) {
panel.add(new JLabel(RefactoringBundle.message("do.you.wish.to.ignore.them.and.continue")), BorderLayout.SOUTH);
}
return panel;
}
示例5: createCenterPanel
@Override
protected JComponent createCenterPanel() {
JPanel panel = new JPanel(new BorderLayout());
myMessagePane = new JEditorPane(UIUtil.HTML_MIME, "");
myMessagePane.setEditable(false);
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myMessagePane);
scrollPane.setPreferredSize(JBUI.size(500, 400));
panel.add(new JLabel(RefactoringBundle.message("the.following.problems.were.found")), BorderLayout.NORTH);
panel.add(scrollPane, BorderLayout.CENTER);
@NonNls StringBuffer buf = new StringBuffer();
for (String description : myConflictDescriptions) {
buf.append(description);
buf.append("<br><br>");
}
myMessagePane.setText(buf.toString());
return panel;
}
示例6: DataPanel
DataPanel(@NotNull Project project, boolean multiRoot, @NotNull Disposable disposable) {
super(UIUtil.HTML_MIME, "");
myProject = project;
myMultiRoot = multiRoot;
setEditable(false);
setOpaque(false);
putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE);
EditorColorsManager.getInstance().addEditorColorsListener(new EditorColorsAdapter() {
@Override
public void globalSchemeChange(EditorColorsScheme scheme) {
update();
}
}, disposable);
DefaultCaret caret = (DefaultCaret)getCaret();
caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
addHyperlinkListener(new HyperlinkListener() {
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED && SHOW_OR_HIDE_BRANCHES.equals(e.getDescription())) {
myExpanded = !myExpanded;
update();
}
else {
BrowserHyperlinkListener.INSTANCE.hyperlinkUpdate(e);
}
}
});
}
示例7: createCenterPanel
protected JComponent createCenterPanel() {
JPanel panel = new JPanel(new BorderLayout());
myBrowser = new JEditorPane(UIUtil.HTML_MIME, "");
panel.add(ScrollPaneFactory.createScrollPane(myBrowser));
panel.setPreferredSize(new Dimension(DEFAULT_WIDTH, DEFAULT_HEIGHT));
return panel;
}
示例8: NotificationPanel
public NotificationPanel() {
super(new BorderLayout());
myLabel = new JEditorPane(UIUtil.HTML_MIME, "");
myLabel.setEditable(false);
myLabel.setFont(UIUtil.getToolTipFont());
setBorder(BorderFactory.createEmptyBorder(1, 15, 1, 15));
add(myLabel, BorderLayout.CENTER);
myLabel.setBackground(getBackground());
}
示例9: initCommitMessageArea
private void initCommitMessageArea(final Project project, final CommittedChangeList changeList) {
myCommitMessageArea = new JEditorPane(UIUtil.HTML_MIME, "");
myCommitMessageArea.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
myCommitMessageArea.setEditable(false);
@NonNls final String text = IssueLinkHtmlRenderer.formatTextIntoHtml(project, changeList.getComment().trim());
myCommitMessageArea.setBackground(UIUtil.getComboBoxDisabledBackground());
myCommitMessageArea.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE);
commitMessageScroll = ScrollPaneFactory.createScrollPane(myCommitMessageArea);
myCommitMessageArea.setText(text);
myCommitMessageArea.setCaretPosition(0);
}
示例10: actionPerformed
@Override
public void actionPerformed(final AnActionEvent e) {
@NonNls final String delim = " -> ";
final StringBuffer buf = new StringBuffer();
processDependencies(getSelectedScope(myLeftTree), getSelectedScope(myRightTree), new Processor<List<PsiFile>>() {
@Override
public boolean process(final List<PsiFile> path) {
if (buf.length() > 0) buf.append("<br>");
buf.append(StringUtil.join(path, new Function<PsiFile, String>() {
@Override
public String fun(final PsiFile psiFile) {
return psiFile.getName();
}
}, delim));
return true;
}
});
final JEditorPane pane = new JEditorPane(UIUtil.HTML_MIME, XmlStringUtil.wrapInHtml(buf));
pane.setForeground(JBColor.foreground());
pane.setBackground(HintUtil.INFORMATION_COLOR);
pane.setOpaque(true);
final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(pane);
final Dimension dimension = pane.getPreferredSize();
scrollPane.setMinimumSize(new Dimension(dimension.width, dimension.height + 20));
scrollPane.setPreferredSize(new Dimension(dimension.width, dimension.height + 20));
JBPopupFactory.getInstance().createComponentPopupBuilder(scrollPane, pane).setTitle("Dependencies")
.setMovable(true).createPopup().showInBestPositionFor(e.getDataContext());
}
示例11: RenderErrorPanel
public RenderErrorPanel() {
super(new BorderLayout());
setOpaque(false);
myHTMLViewer = new JEditorPane(UIUtil.HTML_MIME, "<HTML><BODY>Render Problems</BODY></HTML>");
myHTMLViewer.setEditable(false);
myHyperLinkListener = new HyperlinkListener() {
@Override
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
JEditorPane pane = (JEditorPane)e.getSource();
if (e instanceof HTMLFrameHyperlinkEvent) {
HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent)e;
HTMLDocument doc = (HTMLDocument)pane.getDocument();
doc.processHTMLFrameHyperlinkEvent(evt);
return;
}
String url = e.getDescription();
if (url.equals(URL_ACTION_CLOSE)) {
close();
return;
}
performClick(url);
}
}
};
myHTMLViewer.addHyperlinkListener(myHyperLinkListener);
myHTMLViewer.setMargin(new Insets(3, 3, 3, 3));
myScrollPane = ScrollPaneFactory.createScrollPane(myHTMLViewer);
setupStyle();
add(myScrollPane, BorderLayout.CENTER);
}
示例12: showDetailsPopup
public static void showDetailsPopup(final Project project, final CommittedChangeList changeList) {
StringBuilder detailsBuilder = new StringBuilder("<html><head>");
detailsBuilder.append(UIUtil.getCssFontDeclaration(UIUtil.getLabelFont())).append("</head><body>");
final AbstractVcs vcs = changeList.getVcs();
CachingCommittedChangesProvider provider = null;
if (vcs != null) {
provider = vcs.getCachingCommittedChangesProvider();
if (provider != null && provider.getChangelistTitle() != null) {
detailsBuilder.append(provider.getChangelistTitle()).append(" #").append(changeList.getNumber()).append("<br>");
}
}
@NonNls String committer = "<b>" + changeList.getCommitterName() + "</b>";
detailsBuilder.append(VcsBundle.message("changelist.details.committed.format", committer,
DateFormatUtil.formatPrettyDateTime(changeList.getCommitDate())));
detailsBuilder.append("<br>");
if (provider != null) {
final CommittedChangeList originalChangeList = ReceivedChangeList.unwrap(changeList);
for(ChangeListColumn column: provider.getColumns()) {
if (ChangeListColumn.isCustom(column)) {
String value = column.getValue(originalChangeList).toString();
if (value.length() == 0) {
value = "<none>";
}
detailsBuilder.append(column.getTitle()).append(": ").append(XmlStringUtil.escapeString(value)).append("<br>");
}
}
}
detailsBuilder.append(IssueLinkHtmlRenderer.formatTextWithLinks(project, changeList.getComment()));
detailsBuilder.append("</body></html>");
JEditorPane editorPane = new JEditorPane(UIUtil.HTML_MIME, detailsBuilder.toString());
editorPane.setEditable(false);
editorPane.setBackground(HintUtil.INFORMATION_COLOR);
editorPane.select(0, 0);
editorPane.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE);
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(editorPane);
final JBPopup hint =
JBPopupFactory.getInstance().createComponentPopupBuilder(scrollPane, editorPane)
.setDimensionServiceKey(project, "changelist.details.popup", false)
.setResizable(true)
.setMovable(true)
.setRequestFocus(true)
.setTitle(VcsBundle.message("changelist.details.title"))
.createPopup();
hint.showInBestPositionFor(DataManager.getInstance().getDataContext());
}
示例13: createInspectionProfileSettingsPanel
private JPanel createInspectionProfileSettingsPanel() {
myBrowser = new JEditorPane(UIUtil.HTML_MIME, EMPTY_HTML);
myBrowser.setEditable(false);
myBrowser.setBorder(IdeBorderFactory.createEmptyBorder(5, 5, 5, 5));
myBrowser.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE);
initToolStates();
fillTreeData(myProfileFilter != null ? myProfileFilter.getFilter() : null, true);
JPanel descriptionPanel = new JPanel(new BorderLayout());
descriptionPanel.setBorder(IdeBorderFactory.createTitledBorder(InspectionsBundle.message("inspection.description.title"), false,
new Insets(2, 0, 0, 0)));
descriptionPanel.add(ScrollPaneFactory.createScrollPane(myBrowser), BorderLayout.CENTER);
myRightSplitter = new JBSplitter(true, "SingleInspectionProfilePanel.HORIZONTAL_DIVIDER_PROPORTION", DIVIDER_PROPORTION_DEFAULT);
myRightSplitter.setFirstComponent(descriptionPanel);
myOptionsPanel = new JPanel(new GridBagLayout());
initOptionsAndDescriptionPanel();
myRightSplitter.setSecondComponent(myOptionsPanel);
myRightSplitter.setHonorComponentsMinimumSize(true);
final JScrollPane tree = initTreeScrollPane();
final JPanel northPanel = new JPanel(new GridBagLayout());
northPanel.setBorder(IdeBorderFactory.createEmptyBorder(2, 0, 2, 0));
myProfileFilter.setPreferredSize(new Dimension(20, myProfileFilter.getPreferredSize().height));
northPanel.add(myProfileFilter, new GridBagConstraints(0, 0, 1, 1, 0.5, 1, GridBagConstraints.BASELINE_TRAILING, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
northPanel.add(createTreeToolbarPanel().getComponent(), new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
myMainSplitter = new JBSplitter(false, DIVIDER_PROPORTION_DEFAULT, 0.01f, 0.99f);
myMainSplitter.setSplitterProportionKey("SingleInspectionProfilePanel.VERTICAL_DIVIDER_PROPORTION");
myMainSplitter.setFirstComponent(tree);
myMainSplitter.setSecondComponent(myRightSplitter);
myMainSplitter.setHonorComponentsMinimumSize(false);
final JPanel panel = new JPanel(new BorderLayout());
panel.add(northPanel, BorderLayout.NORTH);
panel.add(myMainSplitter, BorderLayout.CENTER);
return panel;
}
示例14: createComponent
@Override
public JComponent createComponent() {
panel = new JPanel(new BorderLayout(5, 10));
JPanel content = new JPanel(new BorderLayout());
panel.add(content, BorderLayout.NORTH);
JEditorPane warningPane =
new JEditorPane(UIUtil.HTML_MIME,
"<html>Google Cloud Test Lab provides a wide array of virtual and physical devices, to use for running tests and debugging."
+ " Use it to run your tests against a matrix of device combinations with a single click.<br><br>"
+ "<a href='https://developers.google.com/cloud-test-lab'>More about Google Cloud Test Lab</a><br><br>"
+ "<a href='https://cloud.google.com/pricing'>Pricing information</a><br><br></html>");
if (!CloudConfigurationProvider.canEnable()) {
warningPane.setText("<html>This feature is coming soon. Stay tuned!<br><br>"
+ "For more information, please visit <a href='https://developers.google.com/cloud-test-lab'>Google Cloud Test Lab</a>.<br><br></html>");
}
warningPane.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE);
warningPane.setFont(enableCloudTesting.getFont());
warningPane.setEditable(false);
warningPane.setBackground(panel.getBackground());
HyperlinkListener hyperlinkListener = getHyperlinkListener();
warningPane.addHyperlinkListener(hyperlinkListener);
content.add(warningPane, BorderLayout.NORTH);
if (CloudConfigurationProvider.canEnable()) {
enableCloudTesting.setText("Enable testing and debugging in the cloud");
content.add(enableCloudTesting, BorderLayout.WEST);
JEditorPane legalDisclaimer =
new JEditorPane(UIUtil.HTML_MIME,
"<html><br><br><br>The Google Cloud Platform Terms of Service notwithstanding, your use of "
+ "Google Cloud Test Lab is governed by the "
+ "<a href='https://drive.google.com/open?id=0B9D68w_vPl-dX01mQzF2SEM4VE0'>Trusted Testers Agreement</a> and "
+ "by using Google Cloud Test Lab, you agree to its terms.");
legalDisclaimer.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE);
legalDisclaimer.setFont(enableCloudTesting.getFont().deriveFont(Font.ITALIC));
legalDisclaimer.setEditable(false);
legalDisclaimer.setBackground(panel.getBackground());
legalDisclaimer.addHyperlinkListener(hyperlinkListener);
panel.add(legalDisclaimer, BorderLayout.SOUTH);
}
return panel;
}