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 EditorNotificationPanelFixture method performAction.
public IdeFrameFixture performAction(@NotNull final String label) {
checkState(target().isShowing(), "cannot click link on hidden notification");
HyperlinkLabel link = robot().finder().find(target(), new GenericTypeMatcher<HyperlinkLabel>(HyperlinkLabel.class) {
@Override
protected boolean isMatching(@NotNull HyperlinkLabel hyperlinkLabel) {
// IntelliJ's HyperLinkLabel class does not expose the getText method (it is package private)
return hyperlinkLabel.isShowing() && label.equals(Reflection.method("getText").withReturnType(String.class).in(hyperlinkLabel).invoke());
}
});
driver().click(link);
Wait.seconds(5).expecting("notification panel to disappear").until(() -> !target().isShowing());
return myIdeFrameFixture;
}
use of com.intellij.ui.HyperlinkLabel in project intellij-plugins by JetBrains.
the class AddAdapterSupportDialog method createInformationPanel.
@NotNull
private static JComponent createInformationPanel(@NotNull final String adapterHomePageUrl) {
JLabel label1 = new JLabel("See");
HyperlinkLabel hyperlink = SwingHelper.createWebHyperlink(adapterHomePageUrl);
JLabel label2 = new JLabel("for details.");
JPanel panel = SwingHelper.newHorizontalPanel(Component.BOTTOM_ALIGNMENT, SwingHelper.newLeftAlignedVerticalPanel(label1, Box.createVerticalStrut(2)), hyperlink, Box.createHorizontalStrut(5), SwingHelper.newLeftAlignedVerticalPanel(label2, Box.createVerticalStrut(2)));
return SwingHelper.wrapWithoutStretch(panel);
}
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