Search in sources :

Example 6 with HyperlinkLabel

use of com.intellij.ui.HyperlinkLabel in project android by JetBrains.

the class ConfigureAvdOptionsStep method createUIComponents.

private void createUIComponents() {
    Function<ScreenOrientation, Image> orientationIconFunction = new Function<ScreenOrientation, Image>() {

        @Override
        public Image apply(ScreenOrientation input) {
            return IconUtil.toImage(ORIENTATIONS.get(input).myIcon);
        }
    };
    Function<ScreenOrientation, String> orientationNameFunction = new Function<ScreenOrientation, String>() {

        @Override
        public String apply(ScreenOrientation input) {
            return ORIENTATIONS.get(input).myName;
        }
    };
    myOrientationToggle = new ASGallery<ScreenOrientation>(JBList.createDefaultListModel(ScreenOrientation.PORTRAIT, ScreenOrientation.LANDSCAPE), orientationIconFunction, orientationNameFunction, JBUI.size(50, 50), null);
    myOrientationToggle.setCellMargin(JBUI.insets(5, 20, 4, 20));
    myOrientationToggle.setBackground(JBColor.background());
    myOrientationToggle.setForeground(JBColor.foreground());
    myHardwareSkinHelpLabel = new HyperlinkLabel("How do I create a custom hardware skin?");
    myHardwareSkinHelpLabel.setHyperlinkTarget(AvdWizardUtils.CREATE_SKIN_HELP_LINK);
    mySkinComboBox = new SkinChooser(myProject, true);
}
Also used : ScreenOrientation(com.android.resources.ScreenOrientation) Function(com.google.common.base.Function) SystemImage(com.android.sdklib.repository.targets.SystemImage) HyperlinkLabel(com.intellij.ui.HyperlinkLabel)

Example 7 with HyperlinkLabel

use of com.intellij.ui.HyperlinkLabel 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());
        }
    });
}
Also used : HyperlinkEvent(javax.swing.event.HyperlinkEvent) VirtualFile(com.intellij.openapi.vfs.VirtualFile) VfsUtil.findFileByIoFile(com.intellij.openapi.vfs.VfsUtil.findFileByIoFile) FileChooser.chooseFile(com.intellij.openapi.fileChooser.FileChooser.chooseFile) VfsUtilCore.virtualToIoFile(com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile) File(java.io.File) HyperlinkLabel(com.intellij.ui.HyperlinkLabel) HyperlinkAdapter(com.intellij.ui.HyperlinkAdapter)

Example 8 with HyperlinkLabel

use of com.intellij.ui.HyperlinkLabel in project android by JetBrains.

the class AndroidRunConfigurationEditor method createUIComponents.

private void createUIComponents() {
    // JBColor keeps a strong reference to its parameter func, so, using a lambda avoids this reference and fixes a leak
    myOldVersionLabel = new HyperlinkLabel("", JBColor.RED, new JBColor(UIUtil::getLabelBackground), PlatformColors.BLUE);
    setSyncLinkMessage("");
    myOldVersionLabel.addHyperlinkListener(this);
}
Also used : JBColor(com.intellij.ui.JBColor) HyperlinkLabel(com.intellij.ui.HyperlinkLabel) UIUtil(com.intellij.util.ui.UIUtil)

Example 9 with HyperlinkLabel

use of com.intellij.ui.HyperlinkLabel in project android by JetBrains.

the class ResourceTablePanel method createUIComponents.

private void createUIComponents() {
    myEditTranslationsLink = new HyperlinkLabel("EDIT TRANSLATIONS");
    myEditTranslationsLink.addHyperlinkListener(this);
    myEditTranslationsLink.setVisible(false);
}
Also used : HyperlinkLabel(com.intellij.ui.HyperlinkLabel)

Example 10 with HyperlinkLabel

use of com.intellij.ui.HyperlinkLabel in project android by JetBrains.

the class ConfigureAndroidProjectStepFixture method enterPackageName.

@NotNull
public ConfigureAndroidProjectStepFixture enterPackageName(@NotNull String text) {
    LabelWithEditLink link = robot().finder().findByType(target(), LabelWithEditLink.class);
    HyperlinkLabel editLabel = robot().finder().findByType(link, HyperlinkLabel.class);
    robot().click(editLabel);
    JTextComponent textField = findTextFieldWithLabel("Package name:");
    replaceText(textField, text);
    // click "Done"
    robot().click(editLabel);
    return this;
}
Also used : LabelWithEditLink(com.android.tools.adtui.LabelWithEditLink) JTextComponent(javax.swing.text.JTextComponent) HyperlinkLabel(com.intellij.ui.HyperlinkLabel) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

HyperlinkLabel (com.intellij.ui.HyperlinkLabel)25 HyperlinkEvent (javax.swing.event.HyperlinkEvent)9 NotNull (org.jetbrains.annotations.NotNull)7 HyperlinkAdapter (com.intellij.ui.HyperlinkAdapter)5 HyperlinkListener (javax.swing.event.HyperlinkListener)4 Project (com.intellij.openapi.project.Project)3 VirtualFile (com.intellij.openapi.vfs.VirtualFile)3 DataContext (com.intellij.openapi.actionSystem.DataContext)2 FileChooser.chooseFile (com.intellij.openapi.fileChooser.FileChooser.chooseFile)2 VfsUtil.findFileByIoFile (com.intellij.openapi.vfs.VfsUtil.findFileByIoFile)2 VfsUtilCore.virtualToIoFile (com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile)2 File (java.io.File)2 IOException (java.io.IOException)2 ScreenOrientation (com.android.resources.ScreenOrientation)1 SystemImage (com.android.sdklib.repository.targets.SystemImage)1 LabelWithEditLink (com.android.tools.adtui.LabelWithEditLink)1 TabularLayout (com.android.tools.adtui.TabularLayout)1 ModelWizardDialog (com.android.tools.idea.wizard.model.ModelWizardDialog)1 Function (com.google.common.base.Function)1 ImmutableList (com.google.common.collect.ImmutableList)1