use of com.intellij.ui.HyperlinkAdapter in project intellij-community by JetBrains.
the class TooltipUtil method createTooltip.
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.getInformationColor());
label.setOpaque(true);
HintManager.getInstance().showHint(label, RelativePoint.getSouthEastOf(link), HintManager.HIDE_BY_ANY_KEY | HintManager.HIDE_BY_TEXT_CHANGE, -1);
}
});
return link;
}
use of com.intellij.ui.HyperlinkAdapter in project android by JetBrains.
the class IdeSdksConfigurable method createNdkResetLink.
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
File androidNdkPath = IdeSdks.getInstance().getAndroidNdkPath();
assert androidNdkPath != null;
myNdkLocationTextField.setText(androidNdkPath.getPath());
}
});
}
use of com.intellij.ui.HyperlinkAdapter in project intellij-plugins by JetBrains.
the class DartProblemsFilterForm method createUIComponents.
private void createUIComponents() {
myResetFilterHyperlink = new HoverHyperlinkLabel(DartBundle.message("reset.filter"));
myResetFilterHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
protected void hyperlinkActivated(final HyperlinkEvent e) {
myListeners.forEach(FilterListener::filtersResetRequested);
}
});
}
use of com.intellij.ui.HyperlinkAdapter in project intellij-plugins by JetBrains.
the class FlexRunner method launchFlexConfig.
protected RunContentDescriptor launchFlexConfig(final Module module, final FlexBuildConfiguration bc, final FlashRunnerParameters runnerParameters, final RunProfileState state, final RunContentDescriptor contentToReuse, final ExecutionEnvironment environment) throws ExecutionException {
switch(bc.getTargetPlatform()) {
case Web:
final String urlOrPath = runnerParameters.isLaunchUrl() ? runnerParameters.getUrl() : bc.isUseHtmlWrapper() ? PathUtil.getParentPath(bc.getActualOutputFilePath()) + "/" + BCUtils.getWrapperFileName(bc) : bc.getActualOutputFilePath();
launchWithSelectedApplication(urlOrPath, runnerParameters.getLauncherParameters());
break;
case Desktop:
return standardLaunch(module.getProject(), state, contentToReuse, environment);
case Mobile:
switch(runnerParameters.getMobileRunTarget()) {
case Emulator:
return standardLaunch(module.getProject(), state, contentToReuse, environment);
case AndroidDevice:
final String androidDescriptorPath = getAirDescriptorPath(bc, bc.getAndroidPackagingOptions());
final String androidAppId = getApplicationId(androidDescriptorPath);
if (androidAppId == null) {
Messages.showErrorDialog(module.getProject(), FlexBundle.message("failed.to.read.app.id", FileUtil.toSystemDependentName(androidDescriptorPath)), FlexBundle.message("error.title"));
return null;
}
if (packAndInstallToAndroidDevice(module, bc, runnerParameters, androidAppId, false)) {
launchOnAndroidDevice(module.getProject(), bc.getSdk(), runnerParameters.getDeviceInfo(), androidAppId, false);
}
return null;
case iOSSimulator:
final String adtVersionSimulator = AirPackageUtil.getAdtVersion(module.getProject(), bc.getSdk());
final String iosSimulatorDescriptorPath = getAirDescriptorPath(bc, bc.getIosPackagingOptions());
final String iosSimulatorAppId = getApplicationId(iosSimulatorDescriptorPath);
if (iosSimulatorAppId == null) {
Messages.showErrorDialog(module.getProject(), FlexBundle.message("failed.to.read.app.id", FileUtil.toSystemDependentName(iosSimulatorDescriptorPath)), FlexBundle.message("error.title"));
return null;
}
if (packAndInstallToIOSSimulator(module, bc, runnerParameters, adtVersionSimulator, iosSimulatorAppId, false)) {
launchOnIosSimulator(module.getProject(), bc.getSdk(), iosSimulatorAppId, runnerParameters.getIOSSimulatorSdkPath(), false);
}
return null;
case iOSDevice:
final String adtVersion = AirPackageUtil.getAdtVersion(module.getProject(), bc.getSdk());
if (StringUtil.compareVersionNumbers(adtVersion, "3.4") >= 0) {
if (packAndInstallToIOSDevice(module, bc, runnerParameters, adtVersion, false)) {
final String appName = getApplicationName(getAirDescriptorPath(bc, bc.getIosPackagingOptions()));
ToolWindowManager.getInstance(module.getProject()).notifyByBalloon(ToolWindowId.RUN, MessageType.INFO, FlexBundle.message("ios.application.installed.to.run", appName));
}
} else {
if (AirPackageUtil.packageIpaForDevice(module, bc, runnerParameters, adtVersion, false)) {
final String outputFolder = PathUtil.getParentPath(bc.getActualOutputFilePath());
final String ipaName = bc.getIosPackagingOptions().getPackageFileName() + ".ipa";
final String message = FlexBundle.message("ios.application.packaged.to.run", ipaName);
ToolWindowManager.getInstance(module.getProject()).notifyByBalloon(ToolWindowId.RUN, MessageType.INFO, message, null, new HyperlinkAdapter() {
protected void hyperlinkActivated(final HyperlinkEvent e) {
ShowFilePathAction.openFile(new File(outputFolder + "/" + ipaName));
}
});
}
}
break;
}
break;
}
return null;
}
use of com.intellij.ui.HyperlinkAdapter in project scss-lint-plugin by idok.
the class ScssLintInspection method createHyperLink.
@NotNull
private HyperlinkLabel createHyperLink() {
// List path = ContainerUtil.newArrayList(JSBundle.message("settings.javascript.root.configurable.name"), JSBundle.message("settings.javascript.linters.configurable.name"), getDisplayName());
List<String> path = ContainerUtil.newArrayList(ScssLintBundle.message("scss.inspections.group.name"), ScssLintBundle.message("scss.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);
// } else {
// new ScssLintSettingsPage(null).showSettings();
}
// Settings settings = (Settings) Settings.KEY.getData(dataContext);
// if (settings == null) {
// configurable.showEditDialog();
// } else {
// settings.select(settings.find(getId()));
// }
//
// 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(ScssLintInspection.this.getId());
// if (configurable != null) {
// optionsEditor.clearSearchAndSelect(configurable);
// }
//
//
//
// Project project = CommonDataKeys.PROJECT.getData(dataContext);
// if(project == null) {
// LOG.warn("No project found in data context");
// } else {
// JSLinterConfigurable configurable = JSLinterInspection.this.getExternalAnnotatorForBatchInspection().createSettingsConfigurable(project);
// Settings settings = (Settings)Settings.KEY.getData(dataContext);
// if(settings == null) {
// configurable.showEditDialog();
// } else {
// settings.select(settings.find(configurable.getId()));
// }
// }
}
});
return settingsLink;
}
Aggregations