use of com.intellij.openapi.options.Configurable in project android by JetBrains.
the class SdkUpdaterConfigurable method isModified.
@Override
public boolean isModified() {
if (myPanel.isModified()) {
return true;
}
// If the user modifies the channel, comes back here, and then applies the change, we want to be able to update
// right away. Thus we mark ourselves as modified if UpdateSettingsConfigurable is modified, and then reload in
// apply().
DataContext dataContext = DataManager.getInstance().getDataContext(myPanel.getComponent());
Settings data = Settings.KEY.getData(dataContext);
if (data != null) {
Configurable updatesConfigurable = data.find("preferences.updates");
if (updatesConfigurable != null) {
return updatesConfigurable.isModified();
}
}
return false;
}
use of com.intellij.openapi.options.Configurable in project android by JetBrains.
the class RunSdkConfigAction method actionPerformed.
@Override
public void actionPerformed(@Nullable AnActionEvent e) {
UsageTracker.getInstance().log(AndroidStudioEvent.newBuilder().setCategory(EventCategory.SDK_MANAGER).setKind(AndroidStudioEvent.EventKind.SDK_MANAGER_TOOLBAR_CLICKED));
if (e != null && ActionPlaces.WELCOME_SCREEN.equals(e.getPlace())) {
// Invoked from Welcome Screen, might not have an SDK setup yet
AndroidSdkData sdkData = AndroidSdks.getInstance().tryToChooseAndroidSdk();
if (sdkData == null) {
// This probably shouldn't happen, but the check was there in the standalone launcher case...
return;
}
}
Configurable configurable = ConfigurableExtensionPointUtil.createApplicationConfigurableForProvider(SdkUpdaterConfigurableProvider.class);
ShowSettingsUtil.getInstance().showSettingsDialog(null, configurable.getClass());
}
use of com.intellij.openapi.options.Configurable in project android by JetBrains.
the class IdeSettingsDialogFixture method getProjectSettingsNames.
@NotNull
public List<String> getProjectSettingsNames() {
List<String> names = Lists.newArrayList();
JPanel optionsEditor = field("myEditor").ofType(JPanel.class).in(getDialogWrapper()).get();
List<JComponent> trees = findComponentsOfType(optionsEditor, "com.intellij.openapi.options.newEditor.SettingsTreeView");
assertThat(trees).hasSize(1);
JComponent tree = trees.get(0);
CachingSimpleNode root = field("myRoot").ofType(CachingSimpleNode.class).in(tree).get();
ConfigurableGroup[] groups = field("myGroups").ofType(ConfigurableGroup[].class).in(root).get();
for (ConfigurableGroup current : groups) {
Configurable[] configurables = current.getConfigurables();
for (Configurable configurable : configurables) {
names.add(configurable.getDisplayName());
}
}
return names;
}
use of com.intellij.openapi.options.Configurable in project android by JetBrains.
the class GradleRunnerCleanupTask method doCleanUp.
@Override
void doCleanUp(@NotNull Project project) {
ExtensionsArea area = Extensions.getArea(project);
ExtensionPoint<ConfigurableEP<Configurable>> projectConfigurable = area.getExtensionPoint(PROJECT_CONFIGURABLE);
// Disable the Gradle -> Runner settings.
for (ConfigurableEP<Configurable> configurableEP : projectConfigurable.getExtensions()) {
if (GradleConfigurable.class.getName().equals(configurableEP.instanceClass)) {
List<ConfigurableEP> children = new ArrayList<>();
for (ConfigurableEP child : configurableEP.children) {
if (!GradleRunnerConfigurable.class.getName().equals(child.instanceClass)) {
children.add(child);
}
}
configurableEP.children = children.toArray(new ConfigurableEP[children.size()]);
}
}
}
use of com.intellij.openapi.options.Configurable in project intellij-community by JetBrains.
the class ConfigurationErrorEvent method process.
@Override
public void process(@NotNull final TestEventXmlView xml) throws TestEventXmlView.XmlParserException {
final String errorTitle = xml.getEventTitle();
final String configurationErrorMsg = xml.getEventMessage();
final boolean openSettings = xml.isEventOpenSettings();
final Project project = getProject();
assert project != null;
final String message = openSettings ? String.format("<br>\n%s<br><br>\n\n<a href=\"Gradle settings\">Open gradle settings</a>", configurationErrorMsg) : String.format("<br>\n%s", configurationErrorMsg);
GradleNotification.getInstance(project).showBalloon(errorTitle, message, NotificationType.WARNING, new NotificationListener() {
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
notification.expire();
if ("Gradle settings".equals(event.getDescription())) {
ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(GradleConstants.SYSTEM_ID);
assert manager instanceof GradleManager;
GradleManager gradleManager = (GradleManager) manager;
Configurable configurable = gradleManager.getConfigurable(project);
ShowSettingsUtil.getInstance().editConfigurable(project, configurable);
} else {
BrowserUtil.browse(event.getDescription());
}
}
});
}
Aggregations