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


Java HyperlinkLabel类代码示例

本文整理汇总了Java中com.intellij.ui.HyperlinkLabel的典型用法代码示例。如果您正苦于以下问题:Java HyperlinkLabel类的具体用法?Java HyperlinkLabel怎么用?Java HyperlinkLabel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HyperlinkLabel类属于com.intellij.ui包,在下文中一共展示了HyperlinkLabel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createHyperLink

import com.intellij.ui.HyperlinkLabel; //导入依赖的package包/类
@NotNull
private HyperlinkLabel createHyperLink() {
    List<String> path = ContainerUtil.newArrayList(StylintBundle.message("stylint.inspections.group.name"), StylintBundle.message("stylint.inspection.group.name"), getDisplayName());
    String title = Joiner.on(" / ").join(path);
    final HyperlinkLabel settingsLink = new HyperlinkLabel(title);
    settingsLink.addHyperlinkListener(new HyperlinkAdapter() {
        public void hyperlinkActivated(HyperlinkEvent e) {
            DataContext dataContext = DataManager.getInstance().getDataContext(settingsLink);
            Project project = CommonDataKeys.PROJECT.getData(dataContext);
            if (project != null) {
                showSettings(project);
            }
        }
    });
    return settingsLink;
}
 
开发者ID:sertae,项目名称:stylint-plugin,代码行数:17,代码来源:StylintInspection.java

示例2: createHyperLink

import com.intellij.ui.HyperlinkLabel; //导入依赖的package包/类
@NotNull
    private HyperlinkLabel createHyperLink() {
//        List path = ContainerUtil.newArrayList(JSBundle.message("settings.javascript.root.configurable.name"), JSBundle.message("settings.javascript.linters.configurable.name"), getDisplayName());
        List path = ContainerUtil.newArrayList("JavaScript", SassLintBundle.message("sasslint.inspection.group.name"), getDisplayName());

        String title = Joiner.on(" / ").join(path);
        final HyperlinkLabel settingsLink = new HyperlinkLabel(title);
        settingsLink.addHyperlinkListener(new HyperlinkAdapter() {
            public void hyperlinkActivated(HyperlinkEvent e) {
                DataContext dataContext = DataManager.getInstance().getDataContext(settingsLink);
                OptionsEditor optionsEditor = OptionsEditor.KEY.getData(dataContext);
                if (optionsEditor == null) {
                    Project project = CommonDataKeys.PROJECT.getData(dataContext);
                    if (project != null) {
                        showSettings(project);
                    }
                    return;
                }
                Configurable configurable = optionsEditor.findConfigurableById(SassLintInspection.this.getId());
                if (configurable != null) {
                    optionsEditor.clearSearchAndSelect(configurable);
                }
            }
        });
        return settingsLink;
    }
 
开发者ID:idok,项目名称:sass-lint-plugin,代码行数:27,代码来源:SassLintInspection.java

示例3: createTooltip

import com.intellij.ui.HyperlinkLabel; //导入依赖的package包/类
public static HyperlinkLabel createTooltip(final String message) {
  final HyperlinkLabel link = new HyperlinkLabel("");
  link.setIcon(AllIcons.General.Help_small);
  link.setUseIconAsLink(true);
  link.setIconTextGap(0);
  link.addHyperlinkListener(new HyperlinkAdapter() {
    @Override
    protected void hyperlinkActivated(HyperlinkEvent e) {
      final JLabel label = new JLabel(message);
      label.setBorder(HintUtil.createHintBorder());
      label.setBackground(HintUtil.INFORMATION_COLOR);
      label.setOpaque(true);
      HintManager.getInstance()
        .showHint(label, RelativePoint.getSouthEastOf(link), HintManager.HIDE_BY_ANY_KEY | HintManager.HIDE_BY_TEXT_CHANGE, -1);
    }
  });
  return link;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:TooltipUtil.java

示例4: MyEnvironmentVariablesDialog

import com.intellij.ui.HyperlinkLabel; //导入依赖的package包/类
protected MyEnvironmentVariablesDialog() {
  super(EnvironmentVariablesTextFieldWithBrowseButton.this, true);
  myEnvVariablesTable = new EnvVariablesTable();
  myEnvVariablesTable.setValues(convertToVariables(myData.getEnvs(), false));

  myUseDefaultCb.setSelected(isPassParentEnvs());
  myWholePanel.add(myEnvVariablesTable.getComponent(), BorderLayout.CENTER);
  JPanel useDefaultPanel = new JPanel(new BorderLayout());
  useDefaultPanel.add(myUseDefaultCb, BorderLayout.CENTER);
  HyperlinkLabel showLink = new HyperlinkLabel(ExecutionBundle.message("env.vars.show.system"));
  useDefaultPanel.add(showLink, BorderLayout.EAST);
  showLink.addHyperlinkListener(new HyperlinkListener() {
    @Override
    public void hyperlinkUpdate(HyperlinkEvent e) {
      if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
        showParentEnvironmentDialog(MyEnvironmentVariablesDialog.this.getWindow());
      }
    }
  });

  myWholePanel.add(useDefaultPanel, BorderLayout.SOUTH);
  setTitle(ExecutionBundle.message("environment.variables.dialog.title"));
  init();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:EnvironmentVariablesTextFieldWithBrowseButton.java

示例5: createNdkDownloadLink

import com.intellij.ui.HyperlinkLabel; //导入依赖的package包/类
private void createNdkDownloadLink() {
  myNdkDownloadHyperlinkLabel = new HyperlinkLabel();
  myNdkDownloadHyperlinkLabel.setHyperlinkText("", "Download", " Android NDK.");
  myNdkDownloadHyperlinkLabel.addHyperlinkListener(new HyperlinkAdapter() {
    @Override
    protected void hyperlinkActivated(HyperlinkEvent e) {
      List<IPkgDesc> requested = ImmutableList.of(PkgDesc.Builder.newNdk(FullRevision.NOT_SPECIFIED).create());
      SdkQuickfixWizard wizard = new SdkQuickfixWizard(null, null, requested);
      wizard.init();
      if (wizard.showAndGet()) {
        File ndk = IdeSdks.getAndroidNdkPath();
        if (ndk != null) {
          myNdkLocationTextField.setText(ndk.getPath());
        }
        validateState();
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:DefaultSdksConfigurable.java

示例6: addToLinkPanel

import com.intellij.ui.HyperlinkLabel; //导入依赖的package包/类
private void addToLinkPanel(@NotNull String text, @NotNull final URI uri) {
  HyperlinkLabel hyperlinkLabel = new HyperlinkLabel(text);
  hyperlinkLabel.addHyperlinkListener(new HyperlinkAdapter() {
    @Override
    protected void hyperlinkActivated(HyperlinkEvent e) {
      try {
        Desktop.getDesktop().browse(uri);
      }
      catch (IOException ex) {
        // Don't care
      }
    }
  });

  // Setting the padding on myLinksPanel puts in ugly leading space, so we instead space links
  // apart using invisible rigid areas instead.
  if (myLinksPanel.getComponentCount() > 0) {
    myLinksPanel.add(Box.createRigidArea(new Dimension(10, 0)));
  }
  myLinksPanel.add(hyperlinkLabel);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:DeveloperServicePanel.java

示例7: addLink

import com.intellij.ui.HyperlinkLabel; //导入依赖的package包/类
public HyperlinkLabel addLink(@NotNull String text, @NotNull final URI uri) {
  HyperlinkLabel linkLabel = new HyperlinkLabel(text);
  linkLabel.addHyperlinkListener(new HyperlinkListener() {
    @Override
    public void hyperlinkUpdate(HyperlinkEvent e) {
      try {
        Desktop.getDesktop().browse(uri);
      }
      catch (IOException e1) {
        // Don't care
      }
    }
  });
  addComponent(linkLabel);
  return linkLabel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ServicePanelBuilder.java

示例8: configureHyperLinkLabelForClassName

import com.intellij.ui.HyperlinkLabel; //导入依赖的package包/类
private static void configureHyperLinkLabelForClassName(final RenderingParameters renderingParameters,
                                                        HyperlinkLabel link,
                                                        @Nullable final String className) {
  link.setOpaque(false);
  if (className == null) {
    return;
  }
  link.setHyperlinkText(className.substring(1 + className.lastIndexOf('.')));
  link.addHyperlinkListener(new HyperlinkListener() {
    @Override
    public void hyperlinkUpdate(HyperlinkEvent hyperlinkEvent) {
      PsiClass psiClass = NavigationEditorUtils.getPsiClass(renderingParameters.configuration.getModule(), className);
      if (psiClass != null) {
        AndroidRootComponent.launchEditor(renderingParameters, psiClass.getContainingFile(), false);
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:Selections.java

示例9: configureHyperlinkForXMLFile

import com.intellij.ui.HyperlinkLabel; //导入依赖的package包/类
private static void configureHyperlinkForXMLFile(final RenderingParameters renderingParameters,
                                                 HyperlinkLabel link,
                                                 @Nullable final String linkText,
                                                 @Nullable final String xmlFileName,
                                                 final boolean isMenu) {
  link.setOpaque(false);
  link.setHyperlinkText(linkText == null ? "" : linkText);
  link.addHyperlinkListener(new HyperlinkListener() {
    @Override
    public void hyperlinkUpdate(HyperlinkEvent hyperlinkEvent) {
      PsiFile layoutXmlFile =
        NavigationView.getLayoutXmlFile(isMenu, xmlFileName, renderingParameters.configuration, renderingParameters.project);
      AndroidRootComponent.launchEditor(renderingParameters, layoutXmlFile, false);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:Selections.java

示例10: editAvdWithName

import com.intellij.ui.HyperlinkLabel; //导入依赖的package包/类
public AvdEditWizardFixture editAvdWithName(@NotNull String name) {
  final TableView tableView = robot().finder().findByType(target(), TableView.class, true);
  JTableFixture tableFixture = new JTableFixture(robot(), tableView);
  JTableCellFixture cell = tableFixture.cell(name);
  final TableCell actionCell = TableCell.row(cell.row()).column(7);

  JTableCellFixture actionCellFixture = tableFixture.cell(actionCell);

  execute(new GuiTask() {
    @Override
    protected void executeInEDT() throws Throwable {
      tableView.editCellAt(actionCell.row, actionCell.column);
    }
  });

  JPanel actionPanel = (JPanel)actionCellFixture.editor();
  HyperlinkLabel editButtonLabel = robot().finder().find(actionPanel, new GenericTypeMatcher<HyperlinkLabel>(HyperlinkLabel.class) {
    @Override
    protected boolean isMatching(@NotNull HyperlinkLabel component) {
      return "Edit this AVD".equals(component.getToolTipText());
    }
  });
  robot().click(editButtonLabel);
  return AvdEditWizardFixture.find(robot());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:AvdManagerDialogFixture.java

示例11: createHyperLink

import com.intellij.ui.HyperlinkLabel; //导入依赖的package包/类
@NotNull
    private HyperlinkLabel createHyperLink() {
        //JSBundle.message("settings.javascript.root.configurable.name")
        List<String> path = ContainerUtil.newArrayList("HTML", getDisplayName());

        String title = Joiner.on(" / ").join(path);
        final HyperlinkLabel settingsLink = new HyperlinkLabel(title);
        settingsLink.addHyperlinkListener(new HyperlinkAdapter() {
            public void hyperlinkActivated(HyperlinkEvent e) {
//                DataContext dataContext = DataManager.getInstance().getDataContext(settingsLink);
//                OptionsEditor optionsEditor = OptionsEditor.KEY.getData(dataContext);
//                if (optionsEditor == null) {
//                    Project project = CommonDataKeys.PROJECT.getData(dataContext);
//                    if (project != null) {
//                        showSettings(project);
//                    }
//                    return;
//                }
//                Configurable configurable = optionsEditor.findConfigurableById(RTInspection.this.getId());
//                if (configurable != null) {
//                    optionsEditor.clearSearchAndSelect(configurable);
//                }
            }
        });
        return settingsLink;
    }
 
开发者ID:idok,项目名称:react-templates-plugin,代码行数:27,代码来源:RTInspection.java

示例12: createHyperLink

import com.intellij.ui.HyperlinkLabel; //导入依赖的package包/类
@NotNull
    private HyperlinkLabel createHyperLink() {
//        List path = ContainerUtil.newArrayList(JSBundle.message("settings.javascript.root.configurable.name"), JSBundle.message("settings.javascript.linters.configurable.name"), getDisplayName());
        List path = ContainerUtil.newArrayList("JavaScript", CoffeeLintBundle.message("coffeelint.inspection.group.name"), getDisplayName());

        String title = Joiner.on(" / ").join(path);
        final HyperlinkLabel settingsLink = new HyperlinkLabel(title);
        settingsLink.addHyperlinkListener(new HyperlinkAdapter() {
            public void hyperlinkActivated(HyperlinkEvent e) {
                DataContext dataContext = DataManager.getInstance().getDataContext(settingsLink);
                OptionsEditor optionsEditor = OptionsEditor.KEY.getData(dataContext);
                if (optionsEditor == null) {
                    Project project = CommonDataKeys.PROJECT.getData(dataContext);
                    if (project != null) {
                        showSettings(project);
                    }
                    return;
                }
                Configurable configurable = optionsEditor.findConfigurableById(CoffeeLintInspection.this.getId());
                if (configurable != null) {
                    optionsEditor.clearSearchAndSelect(configurable);
                }
            }
        });
        return settingsLink;
    }
 
开发者ID:idok,项目名称:coffee-lint-plugin,代码行数:27,代码来源:CoffeeLintInspection.java

示例13: createHyperLink

import com.intellij.ui.HyperlinkLabel; //导入依赖的package包/类
@NotNull
private HyperlinkLabel createHyperLink() {
    List path = ContainerUtil.newArrayList(JSBundle.message("settings.javascript.root.configurable.name"), JSBundle.message("settings.javascript.linters.configurable.name"), getDisplayName());

    String title = Joiner.on(" / ").join(path);
    final HyperlinkLabel settingsLink = new HyperlinkLabel(title);
    settingsLink.addHyperlinkListener(new HyperlinkAdapter() {
        public void hyperlinkActivated(HyperlinkEvent e) {
            DataContext dataContext = DataManager.getInstance().getDataContext(settingsLink);
            OptionsEditor optionsEditor = OptionsEditor.KEY.getData(dataContext);
            if (optionsEditor == null) {
                Project project = CommonDataKeys.PROJECT.getData(dataContext);
                if (project != null) {
                    showSettings(project);
                }
                return;
            }
            Configurable configurable = optionsEditor.findConfigurableById(ESLintInspection.this.getId());
            if (configurable != null) {
                optionsEditor.clearSearchAndSelect(configurable);
            }
        }
    });
    return settingsLink;
}
 
开发者ID:idok,项目名称:eslint-plugin,代码行数:26,代码来源:ESLintInspection.java

示例14: 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

示例15: createOptionsPanel

import com.intellij.ui.HyperlinkLabel; //导入依赖的package包/类
public JComponent createOptionsPanel() {
    JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    HyperlinkLabel settingsLink = createHyperLink();
    panel.setBorder(IdeBorderFactory.createTitledBorder(getDisplayName() + " options"));
    panel.add(settingsLink);
    return panel;
}
 
开发者ID:sertae,项目名称:stylint-plugin,代码行数:8,代码来源:StylintInspection.java


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