List of usage examples for com.intellij.openapi.ui DetailsComponent DetailsComponent
public DetailsComponent()
From source file:com.android.tools.idea.gradle.structure.DefaultSdksConfigurable.java
License:Apache License
public DefaultSdksConfigurable(@Nullable ConfigurableHost host) { myHost = host;// w w w . j a v a 2 s.com myWholePanel.setPreferredSize(new Dimension(700, 500)); myDetailsComponent = new DetailsComponent(); myDetailsComponent.setContent(myWholePanel); myDetailsComponent.setText("SDK Location"); }
From source file:com.android.tools.idea.gradle.structure.IdeSdksConfigurable.java
License:Apache License
public IdeSdksConfigurable(@Nullable BaseConfigurable host, @Nullable Project project) { myHost = host;// ww w . j a v a 2 s . co m myProject = project; myWholePanel.setPreferredSize(JBUI.size(700, 500)); myDetailsComponent = new DetailsComponent(); myDetailsComponent.setContent(myWholePanel); myDetailsComponent.setText("SDK Location"); // We can't update The IDE-level ndk directory. Due to that disabling the ndk directory option in the default Project Structure dialog. if (myProject == null || myProject.isDefault()) { myNdkLocationTextField.setEnabled(false); } adjustNdkQuickFixVisibility(); CardLayout layout = (CardLayout) myNdkDownloadPanel.getLayout(); layout.show(myNdkDownloadPanel, "loading"); ProgressIndicator logger = new StudioLoggerProgressIndicator(getClass()); RepoManager repoManager = AndroidSdks.getInstance().tryToChooseSdkHandler().getSdkManager(logger); StudioProgressRunner runner = new StudioProgressRunner(false, true, false, "Loading Remote SDK", true, project); RepoManager.RepoLoadedCallback onComplete = packages -> { if (packages.getRemotePackages().get(FD_NDK) != null) { layout.show(myNdkDownloadPanel, "link"); } else { myNdkDownloadPanel.setVisible(false); } }; Runnable onError = () -> myNdkDownloadPanel.setVisible(false); repoManager.load(RepoManager.DEFAULT_EXPIRATION_PERIOD_MS, null, ImmutableList.of(onComplete), ImmutableList.of(onError), runner, new StudioDownloader(), StudioSettingsController.getInstance(), false); FocusListener historyUpdater = new FocusAdapter() { @Override public void focusGained(FocusEvent e) { if (myHistory != null) { String id = myComponentsById.inverse().get(e.getComponent()); mySelectedComponentId = id; if (id != null) { myHistory.pushQueryPlace(); } } } }; installValidationListener(mySdkLocationTextField.getTextField()); installValidationListener(myJdkLocationTextField.getTextField()); installValidationListener(myNdkLocationTextField.getTextField()); myUseEmbeddedJdkCheckBox.addChangeListener(e -> { boolean useEmbeddedJdk = useEmbeddedJdk(); updateJdkTextField(useEmbeddedJdk); File embeddedJdkPath = EmbeddedDistributionPaths.getInstance().getEmbeddedJdkPath(); String path = embeddedJdkPath != null ? embeddedJdkPath.getPath() : ""; if (!useEmbeddedJdk) { // If the user-selected path is the same as the "embedded JDK" path, ignore it because there is no user-selected path yet. if (path.equals(myUserSelectedJdkHomePath)) { myUserSelectedJdkHomePath = ""; } path = myUserSelectedJdkHomePath; } myJdkLocationTextField.getTextField().setText(path); }); addHistoryUpdater("mySdkLocationTextField", mySdkLocationTextField.getTextField(), historyUpdater); addHistoryUpdater("myJdkLocationTextField", myJdkLocationTextField.getTextField(), historyUpdater); addHistoryUpdater("myNdkLocationTextField", myNdkLocationTextField.getTextField(), historyUpdater); }
From source file:com.android.tools.idea.gradle.variant.profiles.ProjectProfileSelectionDialog.java
License:Apache License
@NotNull private JComponent createProjectStructurePanel() { createProjectStructureTree();/*from w w w. ja va 2 s .co m*/ DetailsComponent details = new DetailsComponent(); details.setText("Project Structure"); details.setContent(createTreePanel(myProjectStructureTree)); removeEmptyBorder(details); return details.getComponent(); }
From source file:com.android.tools.idea.gradle.variant.profiles.ProjectProfileSelectionDialog.java
License:Apache License
@NotNull private JComponent createConflictsPanel() { createConflictTree();/*from w w w. j a v a 2s .c om*/ myConflictDetails = new DetailsComponent(); myConflictDetails.setText("Conflict Detail"); myConflictDetails.setContent(createTreePanel(myConflictTree)); removeEmptyBorder(myConflictDetails); createConflictsTable(); myConflictsTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { if (e.getValueIsAdjusting()) { return; } showConflictDetail(); } }); Splitter splitter = new Splitter(true, .25f); splitter.setHonorComponentsMinimumSize(true); DetailsComponent details = new DetailsComponent(); details.setText("Variant Selection Conflicts"); details.setContent(ScrollPaneFactory.createScrollPane(myConflictsTable)); removeEmptyBorder(details); splitter.setFirstComponent(details.getComponent()); splitter.setSecondComponent(myConflictDetails.getComponent()); return splitter; }
From source file:com.android.tools.idea.structure.AndroidHomeConfigurable.java
License:Apache License
public AndroidHomeConfigurable() { myWholePanel.setPreferredSize(new Dimension(700, 500)); myAndroidHomeLocation.getTextField().getDocument().addDocumentListener(new DocumentAdapter() { @Override//from w ww .j a v a 2 s . c o m protected void textChanged(DocumentEvent e) { boolean androidHomeValid = DefaultSdks.validateAndroidSdkPath(getAndroidHomeLocation()); setBackground(myAndroidHomeLocation, androidHomeValid); myAndroidHomeError.setText(androidHomeValid ? " " : "Please choose a valid Android SDK directory."); } }); myJavaHomeLocation.getTextField().getDocument().addDocumentListener(new DocumentAdapter() { @Override protected void textChanged(DocumentEvent e) { boolean javaHomeValid = JavaSdk.checkForJdk(getJavaHomeLocation()); setBackground(myJavaHomeLocation, javaHomeValid); myJavaHomeError.setText(javaHomeValid ? " " : "Please choose a valid JDK directory."); } }); myAndroidHomeError.setForeground(PathEditor.INVALID_COLOR); myJavaHomeError.setForeground(PathEditor.INVALID_COLOR); myDetailsComponent = new DetailsComponent(); myDetailsComponent.setContent(myWholePanel); myDetailsComponent.setText("Android SDK location"); myOriginalSdkHomePath = getDefaultAndroidHomePath(); myOriginalJdkHomePath = getDefaultJavaHomePath(); }
From source file:com.android.tools.idea.structure.DefaultSdksConfigurable.java
License:Apache License
public DefaultSdksConfigurable(@Nullable AndroidProjectStructureConfigurable host, @Nullable Project project) { myHost = host;// ww w . java 2s . c o m myProject = project; myWholePanel.setPreferredSize(new Dimension(700, 500)); myDetailsComponent = new DetailsComponent(); myDetailsComponent.setContent(myWholePanel); myDetailsComponent.setText("SDK Location"); // We can't update The IDE-level ndk directory. Due to that disabling the ndk directory option in the default Project Structure dialog. if (myProject == null || myProject.isDefault()) { myNdkLocationTextField.setEnabled(false); } final CardLayout layout = (CardLayout) myNdkDownloadPanel.getLayout(); layout.show(myNdkDownloadPanel, "loading"); final SdkState sdkState = SdkState.getInstance(AndroidSdkUtils.tryToChooseAndroidSdk()); sdkState.loadAsync(SdkState.DEFAULT_EXPIRATION_PERIOD_MS, false, null, new DispatchRunnable() { @Override public void doRun() { if (!sdkState.getPackages().getRemotePkgInfos().get(PkgType.PKG_NDK).isEmpty()) { layout.show(myNdkDownloadPanel, "link"); } else { myNdkDownloadPanel.setVisible(false); } } }, new DispatchRunnable() { @Override public void doRun() { myNdkDownloadPanel.setVisible(false); } }, false); }