use of com.intellij.ui.HyperlinkLabel in project android by JetBrains.
the class ServiceXmlParser method parseUiLink.
private void parseUiLink(@NotNull Attributes attributes) {
parseRowCol(attributes);
HyperlinkLabel link = myPanelBuilder.addLink(requireAttr(attributes, Schema.UiLink.ATTR_TEXT), toUri(requireAttr(attributes, Schema.UiLink.ATTR_URL)));
bindTopLevelProperties(link, attributes);
}
use of com.intellij.ui.HyperlinkLabel in project android by JetBrains.
the class DeveloperServicePanel method addToLinkPanel.
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
}
}
});
// apart using invisible rigid areas instead.
if (myLinksPanel.getComponentCount() > 0) {
myLinksPanel.add(Box.createRigidArea(new Dimension(JBUI.scale(10), 0)));
}
myLinksPanel.add(hyperlinkLabel);
}
use of com.intellij.ui.HyperlinkLabel in project android by JetBrains.
the class IdeSdksConfigurable method createNdkDownloadLink.
private void createNdkDownloadLink() {
myNdkDownloadHyperlinkLabel = new HyperlinkLabel();
myNdkDownloadHyperlinkLabel.setHyperlinkText("", "Download", " Android NDK.");
myNdkDownloadHyperlinkLabel.addHyperlinkListener(new HyperlinkAdapter() {
@Override
protected void hyperlinkActivated(HyperlinkEvent e) {
if (validateAndroidSdkPath() != null) {
Messages.showErrorDialog(getContentPanel(), "Please select a valid SDK before downloading the NDK.");
return;
}
List<String> requested = ImmutableList.of(FD_NDK);
ModelWizardDialog dialog = createDialogForPaths(myWholePanel, requested, false);
if (dialog != null && dialog.showAndGet()) {
File ndk = IdeSdks.getInstance().getAndroidNdkPath();
if (ndk != null) {
myNdkLocationTextField.setText(ndk.getPath());
}
validateState();
}
}
});
}
use of com.intellij.ui.HyperlinkLabel in project android by JetBrains.
the class GradleCompilerSettingsConfigurable method createHyperlinkLabel.
@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;
}
use of com.intellij.ui.HyperlinkLabel in project android by JetBrains.
the class AvdManagerDialogFixture method editAvdWithName.
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());
}
Aggregations