当前位置: 首页>>代码示例>>Java>>正文


Java HyperlinkLabel.setHyperlinkTarget方法代码示例

本文整理汇总了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);
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:35,代码来源:DetailsViewFactory.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:SwingHelper.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:GradleCompilerSettingsConfigurable.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:AppEngineSupportProvider.java

示例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();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:28,代码来源:AppEngineSupportProvider.java


注:本文中的com.intellij.ui.HyperlinkLabel.setHyperlinkTarget方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。