本文整理汇总了Java中com.intellij.ui.HyperlinkLabel.addHyperlinkListener方法的典型用法代码示例。如果您正苦于以下问题:Java HyperlinkLabel.addHyperlinkListener方法的具体用法?Java HyperlinkLabel.addHyperlinkListener怎么用?Java HyperlinkLabel.addHyperlinkListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.HyperlinkLabel
的用法示例。
在下文中一共展示了HyperlinkLabel.addHyperlinkListener方法的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;
}
示例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;
}
示例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;
}
示例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();
}
}
});
}
示例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);
}
示例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;
}
示例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);
}
}
});
}
示例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);
}
});
}
示例10: 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;
}
示例11: 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;
}
示例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());
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;
}
示例13: ConfigurableHandler
import com.intellij.ui.HyperlinkLabel; //导入方法依赖的package包/类
public ConfigurableHandler(HyperlinkLabel label,
final UnnamedConfigurable serverConfigurable,
C serverConfiguration,
ServerType<C> serverType) {
myServerConfigurable = serverConfigurable;
myServerConfiguration = serverConfiguration;
myServerType = serverType;
label.setHyperlinkText("Upload Public SSH Key");
label.addHyperlinkListener(this);
myLabel = label;
}
示例14: createOptionsPanel
import com.intellij.ui.HyperlinkLabel; //导入方法依赖的package包/类
@Nullable
@Override
public JComponent createOptionsPanel() {
final HyperlinkLabel codeStyleHyperlink = new HyperlinkLabel("Edit Code Style settings");
codeStyleHyperlink.addHyperlinkListener(new HyperlinkListener() {
@Override
public void hyperlinkUpdate(HyperlinkEvent e) {
DataManager.getInstance().getDataContextFromFocus().doWhenDone(new Consumer<DataContext>() {
@Override
public void consume(DataContext context) {
if (context != null) {
final Settings settings = Settings.KEY.getData(context);
if (settings != null) {
settings.select(settings.find(CodeStyleSchemesConfigurable.class));
}
else {
ShowSettingsUtil.getInstance()
.showSettingsDialog(CommonDataKeys.PROJECT.getData(context), CodeStyleSchemesConfigurable.class);
}
}
}
});
}
});
final JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.add(codeStyleHyperlink, BorderLayout.NORTH);
return panel;
}
示例15: createNdkResetLink
import com.intellij.ui.HyperlinkLabel; //导入方法依赖的package包/类
private void createNdkResetLink() {
myNdkResetHyperlinkLabel = new HyperlinkLabel();
myNdkResetHyperlinkLabel.setHyperlinkText("", "Select", " default NDK");
myNdkResetHyperlinkLabel.addHyperlinkListener(new HyperlinkAdapter() {
@Override
protected void hyperlinkActivated(HyperlinkEvent e) {
// known non-null since otherwise we won't show the link
//noinspection ConstantConditions
myNdkLocationTextField.setText(IdeSdks.getAndroidNdkPath().getPath());
}
});
}