本文整理汇总了Java中com.intellij.ui.HyperlinkLabel.setHyperlinkTarget方法的典型用法代码示例。如果您正苦于以下问题:Java HyperlinkLabel.setHyperlinkTarget方法的具体用法?Java HyperlinkLabel.setHyperlinkTarget怎么用?Java HyperlinkLabel.setHyperlinkTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.HyperlinkLabel
的用法示例。
在下文中一共展示了HyperlinkLabel.setHyperlinkTarget方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addLicenses
import com.intellij.ui.HyperlinkLabel; //导入方法依赖的package包/类
private static void addLicenses(JPanel panel, Set<License> licenses) {
if (licenses == null) {
return;
}
JPanel licensesPanel = new JBPanel(new HorizontalLayout(1));
licensesPanel.setBackground(UIUtil.getTableBackground());
for (License license : licenses) {
if (CollectionUtils.isEmpty(license.moreInfoUrl)) {
licensesPanel.add(createJTextArea(createLicenseString(license), false));
continue;
}
HyperlinkLabel hyperlinkLabel = new HyperlinkLabel(createLicenseString(license));
hyperlinkLabel.setBackground(UIUtil.getTableBackground());
hyperlinkLabel.setHyperlinkTarget(license.moreInfoUrl.get(0));
licensesPanel.add(hyperlinkLabel);
}
JBLabel headerLabel = new JBLabel("Licenses:");
headerLabel.setBackground(UIUtil.getTableBackground());
headerLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
c.anchor = GridBagConstraints.NORTHWEST;
c.ipadx = 20;
c.ipady = 3;
c.gridy = 4;
panel.add(headerLabel, c);
c.gridx = 1;
c.weightx = 0.9;
panel.add(licensesPanel, c);
}
示例2: createWebHyperlink
import com.intellij.ui.HyperlinkLabel; //导入方法依赖的package包/类
@NotNull
public static HyperlinkLabel createWebHyperlink(@NotNull String text, @NotNull String url) {
HyperlinkLabel hyperlink = new HyperlinkLabel(text);
hyperlink.setHyperlinkTarget(url);
DefaultActionGroup actionGroup = new DefaultActionGroup();
actionGroup.add(new OpenLinkInBrowser(url));
actionGroup.add(new CopyLinkAction(url));
hyperlink.setComponentPopupMenu(ActionManager.getInstance().createActionPopupMenu("web hyperlink", actionGroup).getComponent());
return hyperlink;
}
示例3: createHyperlinkLabel
import com.intellij.ui.HyperlinkLabel; //导入方法依赖的package包/类
@NotNull
private static HyperlinkLabel createHyperlinkLabel(@NotNull String beforeLinkText,
@NotNull String linkText,
@NotNull String afterLinkText,
@NotNull String target) {
HyperlinkLabel label = new HyperlinkLabel();
label.setHyperlinkText(beforeLinkText, linkText, afterLinkText);
label.setHyperlinkTarget(target);
return label;
}
示例4: AppEngineSupportConfigurable
import com.intellij.ui.HyperlinkLabel; //导入方法依赖的package包/类
private AppEngineSupportConfigurable(FrameworkSupportModel model) {
myFrameworkSupportModel = model;
mySdkEditor = new AppEngineSdkEditor(model.getProject());
mySdkPanel.add(LabeledComponent.create(mySdkEditor.getMainComponent(), "Google App Engine SDK:"), BorderLayout.CENTER);
PersistenceApiComboboxUtil.setComboboxModel(myPersistenceApiComboBox, true);
if (model.isFrameworkSelected(JPA_FRAMEWORK_ID)) {
myPersistenceApiComboBox.setSelectedItem(PersistenceApi.JPA.getDisplayName());
}
model.addFrameworkListener(this);
myErrorLabel = new HyperlinkLabel();
myErrorLabel.setIcon(AllIcons.RunConfigurations.ConfigurationWarning);
myErrorLabel.setVisible(false);
myErrorLabel.setHyperlinkTarget(AppEngineSdkUtil.APP_ENGINE_DOWNLOAD_URL);
myErrorPanel.add(BorderLayout.CENTER, myErrorLabel);
final Component component = mySdkEditor.getComboBox().getEditor().getEditorComponent();
if (component instanceof JTextComponent) {
((JTextComponent)component).getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
checkSdk();
}
});
}
checkSdk();
}
示例5: AppEngineSupportConfigurable
import com.intellij.ui.HyperlinkLabel; //导入方法依赖的package包/类
private AppEngineSupportConfigurable(FrameworkSupportModel model) {
super(AppEngineSupportProvider.this, model);
mySdkEditor = new AppEngineSdkEditor(model.getProject());
mySdkPanel.add(LabeledComponent.create(mySdkEditor.getMainComponent(), "Google App Engine SDK:"), BorderLayout.CENTER);
PersistenceApiComboboxUtil.setComboboxModel(myPersistenceApiComboBox, true);
if (model.isFrameworkSelected(JPA_PROVIDER_ID)) {
myPersistenceApiComboBox.setSelectedItem(PersistenceApi.JPA.getDisplayName());
}
model.addFrameworkListener(this);
myErrorLabel = new HyperlinkLabel();
myErrorLabel.setIcon(AllIcons.RunConfigurations.ConfigurationWarning);
myErrorLabel.setVisible(false);
myErrorLabel.setHyperlinkTarget(AppEngineSdkUtil.APP_ENGINE_DOWNLOAD_URL);
myErrorPanel.add(BorderLayout.CENTER, myErrorLabel);
final Component component = mySdkEditor.getComboBox().getEditor().getEditorComponent();
if (component instanceof JTextComponent) {
((JTextComponent)component).getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
checkSdk();
}
});
}
checkSdk();
}